Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 |
|
---|
6 | namespace AutoDiff
|
---|
7 | {
|
---|
8 | /// <summary>
|
---|
9 | /// Represents a variable term. Variable terms are substituted for real values during evaluation and
|
---|
10 | /// differentiation.
|
---|
11 | /// </summary>
|
---|
12 | [Serializable]
|
---|
13 | public class Variable : Term
|
---|
14 | {
|
---|
15 | /// <summary>
|
---|
16 | /// Accepts a term visitor
|
---|
17 | /// </summary>
|
---|
18 | /// <param name="visitor">The term visitor to accept.</param>
|
---|
19 | public override void Accept(ITermVisitor visitor)
|
---|
20 | {
|
---|
21 | visitor.Visit(this);
|
---|
22 | }
|
---|
23 |
|
---|
24 | /// <summary>
|
---|
25 | /// Accepts a term visitor with a generic result
|
---|
26 | /// </summary>
|
---|
27 | /// <typeparam name="TResult">The type of the result from the visitor's function</typeparam>
|
---|
28 | /// <param name="visitor">The visitor to accept</param>
|
---|
29 | /// <returns>
|
---|
30 | /// The result from the visitor's visit function.
|
---|
31 | /// </returns>
|
---|
32 | public override TResult Accept<TResult>(ITermVisitor<TResult> visitor)
|
---|
33 | {
|
---|
34 | return visitor.Visit(this);
|
---|
35 | }
|
---|
36 | }
|
---|
37 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.