19 private double doubleSum = 0;
20 private long count = 0;
21 private bool isDouble =
true;
42 if (this.doubleValues is
null)
45 this.doubleValues.
Clear();
47 this.elementValues =
null;
58 this.doubleSum += D.Value;
59 this.doubleValues.
Add(D.Value);
61 else if (this.sum is
null)
63 this.isDouble =
false;
66 if (this.doubleValues.
Count > 0)
71 while (!(Loop is
null))
73 for (i = Loop.
Start, c = Loop.
Pos; i < c; i++)
103 else if (this.isDouble)
105 double Average = this.doubleSum / this.count;
112 while (!(Loop is
null))
114 for (i = Loop.
Start, c = Loop.
Pos; i < c; i++)
117 Result += Term * Term;
123 return new DoubleNumber(Math.Sqrt(Result /
this.count));
134 while (!(Loop is
null))
136 for (i = Loop.
Start, c = Loop.
Pos; i < c; i++)
Node referencing a chunk in a ChunkedList<T>
ChunkNode< T > Next
Next chunk
int Pos
Index after the last element in chunk.
T[] Elements
Array of elements in chunk.
int Start
Index of first element in chunk.
A chunked list is a linked list of chunks of objects of type T .
void Clear()
Clears the collection.
ChunkNode< T > FirstChunk
First chunk
int Count
Number of elements in collection.
void Add(T Item)
Adds an item to the collection.
Base class for all types of elements.
static IElement EvaluateSquareRoot(IElement Operand, ScriptNode Node)
Calculates the square root of an operand.
StandardDeviation(v) iterative evaluator
override IElement GetAggregatedResult()
Gets the aggregated result.
override void RestartEvaluator()
Restarts the evaluator.
override void AggregateElement(IElement Element)
Aggregates one new element.
StandardDeviationEvaluator(StandardDeviation Node)
StandardDeviation(v) iterative evaluator
StandardDeviation(v), StdDev(v)
An interative evaluator of a function or operation defined by a single ScriptNode.
ScriptNode Node
Node being iteratively evaluated.
static readonly ObjectValue Null
Null value.
static IElement EvaluateAddition(IElement Left, IElement Right, ScriptNode Node)
Adds two operands.
static IElement EvaluateDivision(IElement Left, IElement Right, ScriptNode Node)
Divides the right operand from the left one.
static IElement EvaluateMultiplication(IElement Left, IElement Right, ScriptNode Node)
Multiplies two operands.
static IElement EvaluateSubtraction(IElement Left, IElement Right, ScriptNode Node)
Subtracts the right operand from the left one.
Basic interface for all types of elements.