3using System.Reflection;
19 private bool[] values;
20 private ICollection<IElement> elements;
21 private readonly
int dimension;
31 this.dimension =
Values.Length;
52 if (this.values is
null)
54 bool[] v =
new bool[this.dimension];
62 while (!(Loop is
null))
64 for (j = Loop.
Start, c = Loop.
Pos; j < c; j++)
100 if (this.elements is
null)
105 for (i = 0; i < this.dimension; i++)
111 return this.elements;
123 StringBuilder sb =
null;
125 foreach (
bool d
in this.
Values)
128 sb =
new StringBuilder(
"[");
140 return sb.ToString();
151 if (this.associatedVectorSpace is
null)
154 return this.associatedVectorSpace;
179 bool[] v =
new bool[this.dimension];
181 for (i = 0; i < this.dimension; i++)
204 bool[] v =
new bool[this.dimension];
205 for (i = 0; i < this.dimension; i++)
206 v[i] =
Values[i] ^ Values2[i];
237 for (i = 0; i < this.dimension; i++)
239 if (
Values[i] != Values2[i])
256 for (i = 0; i < this.dimension; i++)
301 if (this.zero is
null)
317 if (Index < 0 || Index >= this.dimension)
332 if (Index < 0 || Index >= this.dimension)
336 throw new ScriptException(
"Elements in a boolean vector are required to be boolean values.");
339 this.elements =
null;
352 if (DesiredType == typeof(
bool[]))
357 else if (DesiredType.IsAssignableFrom(typeof(
BooleanVector).GetTypeInfo()))
Node referencing a chunk in a ChunkedList<T>
ChunkNode< T > Next
Next chunk
int Pos
Index after the last element in chunk.
int Start
Index of first element in chunk.
A chunked list is a linked list of chunks of objects of type T .
Base class for all types of elements.
abstract object AssociatedObjectValue
Associated object value.
Base class for all types of vector space elements (vectors).
Base class for script exceptions.
Class managing a script expression.
static bool TryConvert(object Value, Type DesiredType, bool AcceptInformationLoss, out object Result)
Tries to convert an object Value to an object of type DesiredType .
static string ToString(double Value)
Converts a value to a string, that can be parsed as part of an expression.
Base class for all nodes in a parsed script tree.
override IVectorSpaceElement MultiplyScalar(IFieldElement Scalar)
Tries to multiply a scalar to the current element.
override int Dimension
Dimension of vector.
override bool Equals(object obj)
Compares the element to another.
BooleanVector(params bool[] Values)
Boolean-valued vector.
override IElement Encapsulate(ICollection< IElement > Elements, ScriptNode Node)
Encapsulates a set of elements into a similar structure as that provided by the current element.
override ICollection< IElement > ChildElements
An enumeration of child elements. If the element is a scalar, this property will return null.
override bool TryConvertTo(Type DesiredType, out object Value)
Converts the value to a .NET type.
override IElement GetElement(int Index)
Gets an element of the vector.
bool[] Values
Vector element values.
override bool IsScalar
If the element represents a scalar value.
override IAbelianGroupElement Add(IAbelianGroupElement Element)
Tries to add an element to the current element.
ICollection< IElement > Elements
Vector elements.
override IAbelianGroupElement Zero
Returns the zero element of the group.
override int GetHashCode()
Calculates a hash code of the element.
override IVectorSpace AssociatedVectorSpace
Associated Right-VectorSpace.
override object AssociatedObjectValue
Associated object value.
override void SetElement(int Index, IElement Value)
Sets an element in the vector.
BooleanVector(ICollection< IElement > Elements)
Boolean-valued vector.
override IElement Encapsulate(ChunkedList< IElement > Elements, ScriptNode Node)
Encapsulates a set of elements into a similar structure as that provided by the current element.
override string ToString()
override IGroupElement Negate()
Negates the element.
Pseudo-vector space of Boolean-valued vectors.
static IElement Encapsulate(Array Elements, bool CanEncapsulateAsMatrix, ScriptNode Node)
Encapsulates the elements of a vector.
Basic interface for all types of abelian group elements.
Basic interface for all types of elements.
object AssociatedObjectValue
Associated object value.
Basic interface for all types of field elements.
Basic interface for all types of group elements.
Basic interface for all types of module elements.
Basic interface for all types of modules.