2using System.Collections.Generic;
4using System.Threading.Tasks;
38 LinkedList<IElement> VectorElements =
new LinkedList<IElement>();
61 LinkedList<IElement> VectorElements =
new LinkedList<IElement>();
95 LinkedList<IElement> Elements2 =
new LinkedList<IElement>();
100 return Encapsulate(Elements2, CanEncapsulateAsMatrix, Node);
125 LinkedList<IElement> Elements2 =
new LinkedList<IElement>();
130 return Encapsulate(Elements2, CanEncapsulateAsMatrix, Node);
144 ISet CommonSuperSet =
null;
148 bool Upgraded =
false;
149 bool SameDimensions =
true;
153 if (CanEncapsulateAsMatrix && SameDimensions)
157 SameDimensions =
false;
160 if (!Columns.HasValue)
162 else if (Columns.Value != Vector.Dimension)
163 SameDimensions =
false;
167 if (CommonSuperSet is
null)
188 CommonSuperSet =
null;
197 if (CanEncapsulateAsMatrix && SameDimensions && Columns.HasValue)
206 if (!(CommonSuperSet is
null))
210 LinkedList<IElement> SuperElements =
new LinkedList<IElement>();
220 SuperElements.AddLast(
Element);
225 SuperElements.AddLast(Element2);
228 SuperElements =
null;
229 CommonSuperSet =
null;
235 if (!(SuperElements is
null))
239 if (!(CommonSuperSet is
null))
271 foreach (
IElement E
in Vector.VectorElements)
Base class for all types of elements.
abstract ISet AssociatedSet
Associated Set.
Base class for all types of sets.
abstract override bool Equals(object obj)
Compares the element to another.
Script runtime exception.
Class managing a script expression.
static IElement Encapsulate(object Value)
Encapsulates an object.
static bool UpgradeField(ref IElement E1, ref ISet Set1, ref IElement E2, ref ISet Set2)
Upgrades elements if necessary, to a common field extension, trying to make them compatible.
Base class for all nodes in a parsed script tree.
int Length
Length of expression covered by node.
virtual PatternMatchResult PatternMatch(IElement CheckAgainst, Dictionary< string, IElement > AlreadyFound)
Performs a pattern match operation.
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 ...
The field Z_2 of boolean numbers ([0]_2, 0 or false, and [1]_2, 1 or true).
Pseudo-field of Complex numbers, as an approximation of the field of real numbers.
The set of Date & Time values.
Pseudo-field of double numbers, as an approximation of the field of real numbers.
static readonly ObjectValue Null
Null value.
Represents a list of elements.
bool isAsync
If any of the elements are asynchronous
ScriptNode[] Elements
Elements.
override IElement Evaluate(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
static IVector Encapsulate(IElement[] Elements, bool CanEncapsulateAsMatrix, ScriptNode Node)
Encapsulates the elements of a vector.
static IVector Encapsulate(IEnumerable< object > Elements, bool CanEncapsulateAsMatrix, ScriptNode Node)
Encapsulates the elements of a vector.
static IElement Encapsulate(Array Elements, bool CanEncapsulateAsMatrix, ScriptNode Node)
Encapsulates the elements of a vector.
VectorDefinition(ScriptNode[] Elements, int Start, int Length, Expression Expression)
Creates a vector.
override async Task< IElement > EvaluateAsync(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
static IVector Encapsulate(ICollection< IElement > Elements, bool CanEncapsulateAsMatrix, ScriptNode Node)
Encapsulates the elements of a vector.
override PatternMatchResult PatternMatch(IElement CheckAgainst, Dictionary< string, IElement > AlreadyFound)
Performs a pattern match operation.
Basic interface for all types of elements.
IElement Encapsulate(ICollection< IElement > Elements, ScriptNode Node)
Encapsulates a set of elements into a similar structure as that provided by the current element.
Basic interface for matrices.
Basic interface for vectors.
int Dimension
Dimension of vector.
Basic interface for all types of module elements.
Basic interface for all types of sets.
PatternMatchResult
Status result of a pattern matching operation.