Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
FlameVariationZeroParameters.cs
1using System;
3using System.Threading.Tasks;
10
12{
17 {
21 protected double[] homogeneousTransform = new double[] { 1, 0, 0, 0, 1, 0, 0, 0, 1 };
22
26 protected double variationWeight = 1;
27
32 : base(Start, Length, Expression)
33 {
34 }
35
40 {
41 return this;
42 }
43
47 public override string ToString()
48 {
49 return LambdaDefinition.ToString(this);
50 }
51
52 #region IFlameVariation Members
53
57 public abstract void Operate(ref double x, ref double y);
58
62 public void Initialize(double[] HomogeneousTransform, double VariationWeight)
63 {
64 this.homogeneousTransform = HomogeneousTransform;
65 this.variationWeight = VariationWeight;
66 }
67
68 #endregion
69
70 #region ILambdaExpression Members
71
76 {
77 double x = Expression.ToDouble(Arguments[0].AssociatedObjectValue);
78 double y = Expression.ToDouble(Arguments[1].AssociatedObjectValue);
79
80 this.Operate(ref x, ref y);
81
82 return new DoubleVector(new double[] { x, y });
83 }
84
88 public Task<IElement> EvaluateAsync(IElement[] Arguments, Variables Variables)
89 {
90 return Task.FromResult(this.Evaluate(Arguments, Variables));
91 }
92
96 public int NrArguments => 2;
97
101 public string[] ArgumentNames => parameterNames;
102
106 public ArgumentType[] ArgumentTypes => parameterTypes;
107
108 internal static readonly string[] parameterNames = new string[] { "x", "y" };
109 internal static readonly ArgumentType[] parameterTypes = new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar };
110
111 #endregion
112
113 #region IElement members
114
119 {
120 return this;
121 }
122
126 public IElement Encapsulate(ICollection<IElement> Elements, ScriptNode Node)
127 {
128 return this;
129 }
130
134 public bool TryConvertTo(Type DesiredType, out object Value)
135 {
136 Value = null;
137 return false;
138 }
139
144
148 public object AssociatedObjectValue => this;
149
153 public bool IsScalar => false;
154
158 public ICollection<IElement> ChildElements => Array.Empty<IElement>();
159
160 #endregion
161 }
162}
A chunked list is a linked list of chunks of objects of type T .
Definition: ChunkedList.cs:54
Class managing a script expression.
Definition: Expression.cs:41
static double ToDouble(object Object)
Converts an object to a double value.
Definition: Expression.cs:5110
FlameVariationZeroParameters(int Start, int Length, Expression Expression)
TODO
IElement Evaluate(IElement[] Arguments, Variables Variables)
TODO
IElement Encapsulate(ChunkedList< IElement > Elements, ScriptNode Node)
TODO
IElement Encapsulate(ICollection< IElement > Elements, ScriptNode Node)
TODO
abstract void Operate(ref double x, ref double y)
TODO
void Initialize(double[] HomogeneousTransform, double VariationWeight)
TODO
Task< IElement > EvaluateAsync(IElement[] Arguments, Variables Variables)
TODO
static readonly SetOfVariations Instance
TODO
Base class for funcions of zero variables.
Base class for all nodes in a parsed script tree.
Definition: ScriptNode.cs:69
int Length
Length of expression covered by node.
Definition: ScriptNode.cs:101
int Start
Start position in script expression.
Definition: ScriptNode.cs:92
Collection of variables.
Definition: Variables.cs:25
Basic interface for all types of elements.
Definition: IElement.cs:21
Basic interface for all types of sets.
Definition: ISet.cs:10
ArgumentType
Type of parameter used in a function definition or a lambda definition.
Definition: IFunction.cs:9