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;
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(Parameter, Start, Length, Expression)
32 {
33 }
34
38 public override string ToString()
39 {
40 return LambdaDefinition.ToString(this);
41 }
42
43 #region IFlameVariation Members
44
48 public void Initialize(double[] HomogeneousTransform, double VariationWeight)
49 {
50 this.homogeneousTransform = HomogeneousTransform;
51 this.variationWeight = VariationWeight;
52 }
53
57 public abstract void Operate(ref double x, ref double y);
58
59 #endregion
60
61 #region ILambdaExpression Members
62
67 {
68 double x = Expression.ToDouble(Arguments[0].AssociatedObjectValue);
69 double y = Expression.ToDouble(Arguments[1].AssociatedObjectValue);
70
71 this.Operate(ref x, ref y);
72
73 return new DoubleVector(new double[] { x, y });
74 }
75
79 public Task<IElement> EvaluateAsync(IElement[] Arguments, Variables Variables)
80 {
81 return Task.FromResult(this.Evaluate(Arguments, Variables));
82 }
83
87 public int NrArguments => 2;
88
92 public string[] ArgumentNames => FlameVariationZeroParameters.parameterNames;
93
98
99 #endregion
100
101 #region IElement members
102
106 public IElement Encapsulate(ICollection<IElement> Elements, ScriptNode Node)
107 {
108 return this;
109 }
110
114 public bool TryConvertTo(Type DesiredType, out object Value)
115 {
116 Value = null;
117 return false;
118 }
119
124
128 public object AssociatedObjectValue => this;
129
133 public bool IsScalar => false;
134
138 public ICollection<IElement> ChildElements => new IElement[0];
139
140 #endregion
141 }
142}
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
Task< IElement > EvaluateAsync(IElement[] Arguments, Variables Variables)
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: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