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;
2using System.Collections.Generic;
3using System.Threading.Tasks;
9
11{
16 {
20 protected double[] homogeneousTransform = new double[] { 1, 0, 0, 0, 1, 0, 0, 0, 1 };
21
25 protected double variationWeight = 1;
26
31 : base(Start, Length, Expression)
32 {
33 }
34
39 {
40 return this;
41 }
42
46 public override string ToString()
47 {
48 return LambdaDefinition.ToString(this);
49 }
50
51 #region IFlameVariation Members
52
56 public abstract void Operate(ref double x, ref double y);
57
61 public void Initialize(double[] HomogeneousTransform, double VariationWeight)
62 {
63 this.homogeneousTransform = HomogeneousTransform;
64 this.variationWeight = VariationWeight;
65 }
66
67 #endregion
68
69 #region ILambdaExpression Members
70
75 {
76 double x = Expression.ToDouble(Arguments[0].AssociatedObjectValue);
77 double y = Expression.ToDouble(Arguments[1].AssociatedObjectValue);
78
79 this.Operate(ref x, ref y);
80
81 return new DoubleVector(new double[] { x, y });
82 }
83
87 public Task<IElement> EvaluateAsync(IElement[] Arguments, Variables Variables)
88 {
89 return Task.FromResult(this.Evaluate(Arguments, Variables));
90 }
91
95 public int NrArguments => 2;
96
100 public string[] ArgumentNames => parameterNames;
101
105 public ArgumentType[] ArgumentTypes => parameterTypes;
106
107 internal static readonly string[] parameterNames = new string[] { "x", "y" };
108 internal static readonly ArgumentType[] parameterTypes = new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar };
109
110 #endregion
111
112 #region IElement members
113
117 public IElement Encapsulate(ICollection<IElement> Elements, ScriptNode Node)
118 {
119 return this;
120 }
121
125 public bool TryConvertTo(Type DesiredType, out object Value)
126 {
127 Value = null;
128 return false;
129 }
130
135
139 public object AssociatedObjectValue => this;
140
144 public bool IsScalar => false;
145
149 public ICollection<IElement> ChildElements => new IElement[0];
150
151 #endregion
152 }
153}
Class managing a script expression.
Definition: Expression.cs:39
static double ToDouble(object Object)
Converts an object to a double value.
Definition: Expression.cs:4824
FlameVariationZeroParameters(int Start, int Length, Expression Expression)
TODO
IElement Evaluate(IElement[] Arguments, Variables Variables)
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:20
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