3using System.Threading.Tasks;
76 if (DR >=
long.MinValue && DR <=
long.MaxValue && Math.Truncate(DR) == DR)
150 if (LeftChildren.Count == RightChildren.Count)
153 IEnumerator<IElement> eLeft = LeftChildren.GetEnumerator();
154 IEnumerator<IElement> eRight = RightChildren.GetEnumerator();
158 while (eLeft.MoveNext() && eRight.MoveNext())
173 foreach (
IElement LeftChild
in LeftChildren)
177 foreach (
IElement RightChild
in RightChildren)
180 LeftResult.Add(Right.
Encapsulate(RightResult, Node));
214 return Left.Differentiate(VariableName,
Variables);
241 Left.Differentiate(VariableName,
Variables),
245 Right.Differentiate(VariableName,
Variables),
A chunked list is a linked list of chunks of objects of type T .
void Add(T Item)
Adds an item to the collection.
Script runtime exception.
Class managing a script expression.
Base class for all binary operators.
ScriptNode right
Right operand.
ScriptNode left
Left operand.
bool isAsync
If subtree is asynchroneous.
Represents a constant element value.
Base class for all nodes in a parsed script tree.
int Length
Length of expression covered by node.
ScriptNode DifferentiationChainRule(string VariableName, Variables Variables, ScriptNode Argument, ScriptNode Differentiation)
Implements the differentiation chain rule, by differentiating the argument and multiplying it to the ...
Expression Expression
Expression of which the node is a part.
int Start
Start position in script expression.
abstract IElement Evaluate(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection. This method should be ...
virtual Task< IElement > EvaluateAsync(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection. This method should be ...
static readonly DoubleNumber OneElement
1
static readonly DoubleNumber TwoElement
2
static IElement EvaluateMultiplication(IElement Left, IElement Right, ScriptNode Node)
Multiplies two operands.
override async Task< IElement > EvaluateAsync(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
Power(ScriptNode Left, ScriptNode Right, int Start, int Length, Expression Expression)
Power operator.
override IElement Evaluate(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
ScriptNode Differentiate(string VariableName, Variables Variables)
Differentiates a script node, if possible.
static IElement EvaluatePower(IElement Left, IElement Right, ScriptNode Node)
Calculates Left ^ Right.
static IElement EvaluateSubtraction(IElement Left, IElement Right, ScriptNode Node)
Subtracts the right operand from the left one.
Basic interface for all types of commutative ring with identity elements.
Basic interface for all types of elements.
object AssociatedObjectValue
Associated object value.
ICollection< IElement > ChildElements
An enumeration of child elements. If the element is a scalar, this property will return null.
IElement Encapsulate(ChunkedList< IElement > Elements, ScriptNode Node)
Encapsulates a set of elements into a similar structure as that provided by the current element.
bool IsScalar
If the element represents a scalar value.
Basic interface for all types of ring elements.
Base interface for lambda expressions.