An ordered, operable parser aggregate with heterogeneous ParserEntity elements.

remarks

Vector is not restricted to numeric linear-algebra values. General arithmetic is element-wise: scalar operands are broadcast across the Vector, while Vector operands are paired by position and must have the same length. Vector-to-Vector times remains an element-wise product rather than an alias for dot. A Matrix operand interprets this Vector as a row vector for the standard

`Vector * Matrix`

product; orientation is supplied by operand position rather than stored on the Vector. Structural methods such as append, insert, extend, reverse, and trim mutate this Vector. True linear-algebra operations (dot, cross, and norm) require Expression elements.

`dot`

requires equal lengths, while

`cross`

requires two three-element Vectors. These operations throw rather than assigning arithmetic meaning to arbitrary aggregate elements. Construction from a Collection copies its elements. Construction from an array normalizes inputs but retains existing parser entities; copy deep-copies every element. Comparisons are component-wise predicates, not a total ordering, and return false for a type or length mismatch.

Members

__get__(indices: number[]): ParserEntityMethod

Returns the element at the given zero-based index. Used by the parser for bracket indexing, e.g. [a, b, c][1] returns b.

throws

UnexpectedDataType If the index is out of bounds.

Parameters

NameTypeDescription
indicesnumber[]Zero-based parser indices after index-base adjustment.

Returns

ParserEntity — The stored parser entity.

__set__(indices: number[], value: ParserEntity): voidMethod

Sets the element at the given index.

Parameters

NameTypeDescription
indicesnumber[]A single-element array [i]
valueParserEntityThe value to set

Returns

void

abs(): VectorMethod

No description is available yet.

Returns

Vector

add(x: ParserEntity): thisMethod

Appends an existing parser entity by reference and returns this Vector.

Parameters

NameTypeDescription
xParserEntity

Returns

this

append(e: ParserEntity): thisMethod

Appends an existing parser entity by reference.

Parameters

NameTypeDescription
eParserEntityElement to append.

Returns

this

arrayMap(callback: (e: ParserEntity): unknown): unknown[]Method

No description is available yet.

Parameters

NameTypeDescription
callback(e: ParserEntity): unknown

Returns

unknown[]

at(i: number): ParserEntityMethod

Returns the stored entity at a zero-based index without copying it.

Parameters

NameTypeDescription
inumberZero-based index.

Returns

ParserEntity — The entity, or `undefined` at runtime for an out-of-range index.

clear(): thisMethod

Removes all elements from the vector.

Returns

this

copy(): VectorMethod

Copies the Vector and every contained entity.

Returns

Vector

count(): numberMethod

Gets the number of current elements in the Vector.

Returns

number — Current length.

cross(v: Vector): VectorMethod

Computes the three-dimensional cross product.

throws

DimensionError Unless both Vectors have exactly three elements.

throws

UnexpectedDataType If any required element is not an Expression.

Parameters

NameTypeDescription
vVector

Returns

Vector

dataType: "VEC"Property

No description is available yet.

delete(x: ParserEntity): booleanMethod

No description is available yet.

Parameters

NameTypeDescription
xParserEntity

Returns

boolean

dimensions(): number[]Method

No description is available yet.

Returns

number[]

dimensionsMatch(x: ParserEntity): xMethod

No description is available yet.

Parameters

NameTypeDescription
xParserEntity

Returns

x

div(x: NerdamerInput): VectorMethod

Divides corresponding elements, or broadcasts a scalar divisor.

remarks

Vector-to-Vector division is element-wise and requires equal lengths. This is distinct from scalar division, which applies the same divisor to every element.

throws

DimensionError If a Vector divisor has a different length.

Parameters

NameTypeDescription
xNerdamerInput

Returns

Vector

dot(v: Vector): ExpressionMethod

Computes the sum of pairwise products.

throws

DimensionError If the Vector lengths differ.

throws

UnexpectedDataType If a required element is not an Expression.

Parameters

NameTypeDescription
vVector

Returns

Expression

elements: ParserEntity[]Property

No description is available yet.

eq(V: ParserEntity): booleanMethod

No description is available yet.

Parameters

NameTypeDescription
VParserEntity

Returns

boolean

evaluate(): VectorMethod

Evaluates a copied Vector, resolving symbolic bracket access when values are supplied.

Parameters

NameTypeDescription
valuesParserValuesObject

Returns

Vector

expand(): VectorMethod

Expands a copied Vector, leaving this one unchanged.

Returns

Vector

extend(v: ParserEntity): VectorMethod

Appends another Vector's element references, mutating this Vector.

throws

UnexpectedDataType If

`v`

is not a Vector.

Parameters

NameTypeDescription
vParserEntityVector whose elements should be appended.

Returns

Vector — This Vector.

factor(): VectorMethod

No description is available yet.

Returns

Vector

getExpressionAt(n: number): ExpressionMethod

Returns an element after verifying that it is an Expression.

throws

UnexpectedDataType If the stored entity is not an Expression.

Parameters

NameTypeDescription
nnumberZero-based index.

Returns

Expression — The stored Expression reference.

gt(V: ParserEntity): booleanMethod

No description is available yet.

Parameters

NameTypeDescription
VParserEntity

Returns

boolean

gte(V: ParserEntity): booleanMethod

No description is available yet.

Parameters

NameTypeDescription
VParserEntity

Returns

boolean

indexOf(x: ParserEntity): numberMethod

Gets the index of the first element structurally equal to

`x`

.

Parameters

NameTypeDescription
xParserEntityValue to locate.

Returns

number — The zero-based index, or `-1` when absent.

insert(i: number, x: ParserEntity): thisMethod

Inserts an entity by reference before the provided index.

Parameters

NameTypeDescription
inumberZero-based insertion index.
xParserEntityEntity to insert.

Returns

this — This mutated Vector.

isEnumerable: booleanProperty

No description is available yet.

isVector(obj: unknown): objMethod

No description is available yet.

Parameters

NameTypeDescription
objunknown

Returns

obj

lt(V: ParserEntity): booleanMethod

No description is available yet.

Parameters

NameTypeDescription
VParserEntity

Returns

boolean

lte(V: ParserEntity): booleanMethod

No description is available yet.

Parameters

NameTypeDescription
VParserEntity

Returns

boolean

minus(x: NerdamerInput): VectorMethod

Subtracts corresponding elements, or broadcasts a scalar subtrahend.

throws

DimensionError If a Vector operand has a different length.

Parameters

NameTypeDescription
xNerdamerInput

Returns

Vector

norm(): ExpressionMethod

Returns the Euclidean norm

`sqrt(sum(abs(element)^2))`

.

throws

UnexpectedDataType If any element is not an Expression.

Returns

Expression

plus(x: NerdamerInput): VectorMethod

Adds corresponding elements, or broadcasts a scalar addend.

throws

DimensionError If a Vector operand has a different length.

Parameters

NameTypeDescription
xNerdamerInput

Returns

Vector

pop(index?: number): ParserEntity | undefinedMethod

Removes an element given an index. If none is provided it removes the last element. Indices are zero-based.

Parameters

NameTypeDescription
indexnumberOptional zero-based index.

Returns

ParserEntity | undefined — The removed entity, or `undefined` when no entity is present.

pow(x: NerdamerInput): VectorMethod

Raises corresponding elements to powers, or broadcasts a scalar exponent.

throws

DimensionError If a Vector exponent has a different length.

Parameters

NameTypeDescription
xNerdamerInput

Returns

Vector

precision: numberProperty

No description is available yet.

prod(): ExpressionMethod

Multiplies all Expression elements in order.

throws

UnexpectedDataType If an element is not an Expression.

Returns

Expression — Their product, or one for an empty Vector.

remove(x: ParserEntity): VectorMethod

Removes the first element equal to

`x`

, rather than matching by reference.

Parameters

NameTypeDescription
xParserEntityValue to remove.

Returns

Vector — This Vector, whether or not a match was found.

reverse(): thisMethod

Reverses the Vector in place.

Returns

this — This Vector.

simplify(): VectorMethod

No description is available yet.

Returns

Vector

sum(): ExpressionMethod

Adds all Expression elements in order.

throws

UnexpectedDataType If an element is not an Expression.

Returns

Expression — Their sum, or zero for an empty Vector.

symbolicAccessor: Expression[]Property

Public index expressions retained when bracket access cannot yet be resolved. This state belongs to a copied structured entity, never the stored source value.

symbolicTarget: ExpressionProperty

Original symbolic target used to render and later re-evaluate bracket access.

text(): stringMethod

No description is available yet.

Returns

string

times(x: NerdamerInput): VectorMethod

Multiplies corresponding Vector elements, broadcasts a scalar factor, or multiplies this Vector from the left of a Matrix.

remarks

Vector-to-Vector multiplication is the element-wise (Hadamard) product. Use dot when a scalar inner product is intended. For a Matrix operand, this Vector is interpreted as a row vector. Nonzero-width products reuse the existing Matrix-vector product through the transpose; a compatible zero-width Matrix has the empty Vector as its result because its transpose cannot be represented.

throws

DimensionError If Vector dimensions are incompatible.

throws

MathError If Matrix dimensions are incompatible.

Parameters

NameTypeDescription
xNerdamerInput

Returns

Vector

toPolynomial(vars: string[]): PolynomialMethod

Interprets ordered elements as ascending polynomial coefficients.

Parameters

NameTypeDescription
varsstring[]

Returns

Polynomial

toString(): stringMethod

No description is available yet.

Returns

string

trim(): VectorMethod

Removes every element equal to zero.

Returns

Vector — This mutated Vector.

withSymbolicAccessor(target: Expression, indices: Expression[]): VectorMethod

Returns a copied structured entity carrying an unresolved bracket access. Existing accessor state is retained so chained symbolic access can be extended.

Parameters

NameTypeDescription
targetExpression
indicesExpression[]

Returns

Vector