Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
FlameVariationOneParameter.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(Parameter, Start, Length, Expression)
33 {
34 }
35
39 public override string ToString()
40 {
41 return LambdaDefinition.ToString(this);
42 }
43
44 #region IFlameVariation Members
45
49 public void Initialize(double[] HomogeneousTransform, double VariationWeight)
50 {
51 this.homogeneousTransform = HomogeneousTransform;
52 this.variationWeight = VariationWeight;
53 }
54
58 public abstract void Operate(ref double x, ref double y);
59
60 #endregion
61
62 #region ILambdaExpression Members
63
68 {
69 double x = Expression.ToDouble(Arguments[0].AssociatedObjectValue);
70 double y = Expression.ToDouble(Arguments[1].AssociatedObjectValue);
71
72 this.Operate(ref x, ref y);
73
74 return new DoubleVector(new double[] { x, y });
75 }
76
80 public Task<IElement> EvaluateAsync(IElement[] Arguments, Variables Variables)
81 {
82 return Task.FromResult(this.Evaluate(Arguments, Variables));
83 }
84
88 public int NrArguments => 2;
89
93 public string[] ArgumentNames => FlameVariationZeroParameters.parameterNames;
94
99
100 #endregion
101
102 #region IElement members
103
108 {
109 return this;
110 }
111
115 public IElement Encapsulate(ICollection<IElement> Elements, ScriptNode Node)
116 {
117 return this;
118 }
119
123 public bool TryConvertTo(Type DesiredType, out object Value)
124 {
125 Value = null;
126 return false;
127 }
128
133
137 public object AssociatedObjectValue => this;
138
142 public bool IsScalar => false;
143
147 public ICollection<IElement> ChildElements => Array.Empty<IElement>();
148
149 #endregion
150 }
151}
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
Task< IElement > EvaluateAsync(IElement[] Arguments, Variables Variables)
TODO
IElement Encapsulate(ChunkedList< IElement > Elements, ScriptNode Node)
TODO
IElement Evaluate(IElement[] Arguments, Variables Variables)
TODO
FlameVariationOneParameter(ScriptNode Parameter, int Start, int Length, Expression Expression)
TODO
void Initialize(double[] HomogeneousTransform, double VariationWeight)
TODO
abstract void Operate(ref double x, ref double y)
TODO
IElement Encapsulate(ICollection< IElement > Elements, ScriptNode Node)
TODO
static readonly SetOfVariations Instance
TODO
Base class for funcions of one scalar variable.
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