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 the exponential function <c>e^x</c>
|
---|
10 | /// </summary>
|
---|
11 | [Serializable]
|
---|
12 | public class Exp : Term
|
---|
13 | {
|
---|
14 | /// <summary>
|
---|
15 | /// Constructs a new instance of the <see cref="Exp"/> type.
|
---|
16 | /// </summary>
|
---|
17 | /// <param name="arg">The exponent of the function.</param>
|
---|
18 | public Exp(Term arg)
|
---|
19 | {
|
---|
20 | Arg = arg;
|
---|
21 | }
|
---|
22 |
|
---|
23 | /// <summary>
|
---|
24 | /// Gets the exponent term.
|
---|
25 | /// </summary>
|
---|
26 | public Term Arg { get; private set; }
|
---|
27 |
|
---|
28 | /// <summary>
|
---|
29 | /// Accepts a term visitor
|
---|
30 | /// </summary>
|
---|
31 | /// <param name="visitor">The term visitor to accept</param>
|
---|
32 | public override void Accept(ITermVisitor visitor)
|
---|
33 | {
|
---|
34 | visitor.Visit(this);
|
---|
35 | }
|
---|
36 |
|
---|
37 | /// <summary>
|
---|
38 | /// Accepts a term visitor with a generic result
|
---|
39 | /// </summary>
|
---|
40 | /// <typeparam name="TResult">The type of the result from the visitor's function</typeparam>
|
---|
41 | /// <param name="visitor">The visitor to accept</param>
|
---|
42 | /// <returns>
|
---|
43 | /// The result from the visitor's visit function.
|
---|
44 | /// </returns>
|
---|
45 | public override TResult Accept<TResult>(ITermVisitor<TResult> visitor)
|
---|
46 | {
|
---|
47 | return visitor.Visit(this);
|
---|
48 | }
|
---|
49 | }
|
---|
50 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.