5using System.Threading.Tasks;
102 return Encapsulate(Elements2, CanEncapsulateAsMatrix, Node);
120 return Encapsulate(Elements2, CanEncapsulateAsMatrix, Node);
149 return Encapsulate(Elements2, CanEncapsulateAsMatrix, Node);
163 ISet CommonSuperSet =
null;
167 bool Upgraded =
false;
168 bool SameDimensions =
true;
172 if (CanEncapsulateAsMatrix && SameDimensions)
176 SameDimensions =
false;
179 if (!Columns.HasValue)
181 else if (Columns.Value != Vector.Dimension)
182 SameDimensions =
false;
186 if (CommonSuperSet is
null)
207 CommonSuperSet =
null;
216 if (CanEncapsulateAsMatrix && SameDimensions && Columns.HasValue)
225 if (!(CommonSuperSet is
null))
244 SuperElements.Add(Element2);
247 SuperElements =
null;
248 CommonSuperSet =
null;
254 if (!(SuperElements is
null))
258 if (!(CommonSuperSet is
null))
290 foreach (
IElement E
in Vector.VectorElements)
A chunked list is a linked list of chunks of objects of type T .
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.
static IElement Encapsulate(IEnumerable Elements, bool CanEncapsulateAsMatrix, ScriptNode Node)
Encapsulates the elements of a vector.
Basic interface for all types of elements.
IElement Encapsulate(ChunkedList< 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.