Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
JuliaStepVariation.cs
1using System.Numerics;
4
6{
11 {
15 public JuliaStepVariation(ScriptNode Parameter1, ScriptNode Parameter2, int Start, int Length, Expression Expression)
16 : base(Parameter1, Parameter2, Start, Length, Expression)
17 {
18 }
19
24 : base(Parameter1, null, Start, Length, Expression)
25 {
26 }
27
28 private JuliaStepVariation(Complex z, ScriptNode Parameter, int Start, int Length, Expression Expression)
29 : base(z, Parameter, Start, Length, Expression)
30 {
31 }
32
33 private JuliaStepVariation(double Re, double Im, ScriptNode Parameter1, ScriptNode Parameter2,
35 : base(Re, Im, Parameter1, Parameter2, Start, Length, Expression)
36 {
37 }
38
43 {
44 if (Arguments[1] is null || Arguments[1].AssociatedObjectValue is null)
45 {
46 return new JuliaStepVariation(Expression.ToComplex(Arguments[0].AssociatedObjectValue),
47 this.Arguments[0], this.Start, this.Length, this.Expression);
48 }
49 else
50 {
51 return new JuliaStepVariation(
52 Expression.ToDouble(Arguments[0].AssociatedObjectValue),
53 Expression.ToDouble(Arguments[1].AssociatedObjectValue),
54 this.Arguments[0], this.Arguments[1], Start, Length, this.Expression);
55 }
56 }
57
61 public override void Operate(ref double x, ref double y)
62 {
63 double x2 = x * x - y * y + this.re;
64 y = 2 * x * y + this.im;
65 x = x2;
66 }
67
71 public override string FunctionName => nameof(JuliaStepVariation);
72 }
73}
Class managing a script expression.
Definition: Expression.cs:39
static Complex ToComplex(object Object)
Converts an object to a complex value.
Definition: Expression.cs:4942
static double ToDouble(object Object)
Converts an object to a double value.
Definition: Expression.cs:4824
JuliaStepVariation(ScriptNode Parameter1, int Start, int Length, Expression Expression)
TODO
override void Operate(ref double x, ref double y)
TODO
override IElement Evaluate(IElement[] Arguments, Variables Variables)
TODO
JuliaStepVariation(ScriptNode Parameter1, ScriptNode Parameter2, int Start, int Length, Expression Expression)
TODO
ScriptNode[] Arguments
Function arguments.
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