A rectangular two-dimensional matrix of scalar Expression elements.

remarks

Construction validates that all nonempty rows have the same length and converts every entry to an Expression; nested parser aggregates are not matrix elements. Existing Expression entries are retained, so use copy when independent element objects are required.

`copy`

, evaluate, and expand return deep independent matrices. Addition, subtraction, and division remain element-wise. times implements scalar scaling, matrix multiplication, and matrix-vector multiplication, while pow implements integer matrix powers. Scalar and matrix products return new Matrices; a matrix-vector product returns a new Vector. each, set, and parser assignment mutate this matrix. Direct

`get`

/

`set`

indices are zero-based. The compatibility accessor e and the row/col helpers are one-based. Matrix comparisons are component-wise predicates, not a total or lexicographic ordering; a type or dimension mismatch compares false.

Members

__get__(indices: number[]): ParserEntityMethod

Returns a row at the given zero-based index as a Vector. Used by the parser for bracket indexing, e.g. matrix[0] returns the first row. This enables chained indexing: matrix[0][1] returns the element at row 0, col 1.

throws

MathError If either index is out of bounds.

Parameters

NameTypeDescription
indicesnumber[]Zero-based indices (after INDEX_BASE adjustment). Single index [i] returns row i as a Vector. Two indices [i, j] returns the element at row i, col j.

Returns

ParserEntity — A copied row Vector for one index, or the stored Expression for two.

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

Sets a zero-based cell or replaces an entire row. [i, j] sets the element at row i, col j. [i] requires a Vector whose length matches the matrix column count.

throws

UnexpectedDataType If a full-row assignment does not receive a Vector.

throws

MathError If an index is out of bounds or a replacement row has the wrong length.

Parameters

NameTypeDescription
indicesstring | number[]Zero-based indices
valueParserEntityThe value to set

Returns

void

abs(): MatrixMethod

No description is available yet.

Returns

Matrix

augment(matrix: Matrix): MatrixMethod

Returns the horizontal augmentation

`[this | matrix]`

without mutating either input.

throws

MathError If the row counts differ.

Parameters

NameTypeDescription
matrixMatrix

Returns

Matrix

canMultiplyFromLeft(M: Matrix): booleanMethod

No description is available yet.

Parameters

NameTypeDescription
MMatrix

Returns

boolean

col(n: number): MatrixMethod

No description is available yet.

Parameters

NameTypeDescription
nnumber

Returns

Matrix

cols(): numberMethod

No description is available yet.

Returns

number

Matrix(...elements: Vector | NerdamerInput[][]): MatrixConstructor

Creates a matrix from array or Vector rows.

throws

MathError If nonempty rows have different lengths.

throws

UnexpectedDataType If an entry cannot be converted to an Expression.

Parameters

NameTypeDescription
elementsVector | NerdamerInput[][]Rows containing values convertible to scalar Expressions.

Returns

Matrix

copy(): MatrixMethod

Copies the matrix and every Expression element.

Returns

Matrix

dataType: "MAT"Property

No description is available yet.

determinant(): ExpressionMethod

Computes the determinant by triangular elimination. The determinant of the empty matrix is one.

throws

UnsupportedOperationError If the matrix is not square.

Returns

Expression

dimensions(): number[]Method

No description is available yet.

Returns

number[]

div(x: NerdamerInput): MatrixMethod

Divides corresponding entries, or broadcasts a scalar divisor.

throws

DimensionError If a Matrix divisor has different dimensions.

Parameters

NameTypeDescription
xNerdamerInput

Returns

Matrix

e(i: number, j: number): ExpressionMethod

No description is available yet.

Parameters

NameTypeDescription
inumber
jnumber

Returns

Expression

each(fn: (e: Expression, i?: string | number, j?: string | number): Expression): MatrixMethod

Replaces every element with the callback result, mutating this matrix. Callback row and column indices are zero-based.

Parameters

NameTypeDescription
fn(e: Expression, i?: string | number, j?: string | number): Expression

Returns

Matrix

elements: Expression[][]Property

No description is available yet.

eq(M: ParserEntity): booleanMethod

No description is available yet.

Parameters

NameTypeDescription
MParserEntity

Returns

boolean

evaluate(): MatrixMethod

Evaluates a copied matrix, resolving symbolic cell access when values are supplied.

Parameters

NameTypeDescription
valuesParserValuesObject

Returns

Matrix

expand(): MatrixMethod

Expands a copied matrix, leaving this one unchanged.

Returns

Matrix

factor(): MatrixMethod

No description is available yet.

Returns

Matrix

fill(rows: number, cols: number, value: Expression): MatrixMethod

Creates a matrix whose cells are independent copies of

`value`

.

Parameters

NameTypeDescription
rowsnumber
colsnumber
valueExpression

Returns

Matrix

get(row: number, col: number): ExpressionMethod

No description is available yet.

Parameters

NameTypeDescription
rownumber
colnumber

Returns

Expression

gt(M: ParserEntity): booleanMethod

No description is available yet.

Parameters

NameTypeDescription
MParserEntity

Returns

boolean

gte(M: ParserEntity): booleanMethod

No description is available yet.

Parameters

NameTypeDescription
MParserEntity

Returns

boolean

identity(n: number): MatrixMethod

Creates the

`n`

by

`n`

identity matrix.

Parameters

NameTypeDescription
nnumber

Returns

Matrix

inspect(): stringMethod

No description is available yet.

Returns

string

inverse(): MatrixMethod

Computes an inverse by augmenting with the identity and eliminating rows.

throws

UnsupportedOperationError If the matrix is not square.

throws

MathError If the matrix is singular.

Returns

Matrix — A new inverse matrix; this matrix is unchanged.

isEnumerable: booleanProperty

No description is available yet.

isMatrix(obj: unknown): objMethod

No description is available yet.

Parameters

NameTypeDescription
objunknown

Returns

obj

isSingular(): booleanMethod

No description is available yet.

Returns

boolean

isSquare(): booleanMethod

No description is available yet.

Returns

boolean

lt(M: ParserEntity): booleanMethod

No description is available yet.

Parameters

NameTypeDescription
MParserEntity

Returns

boolean

lte(M: ParserEntity): booleanMethod

No description is available yet.

Parameters

NameTypeDescription
MParserEntity

Returns

boolean

map(callback: (a: Expression, row?: string | number, col?: string | number): Expression): MatrixMethod

Returns a new matrix populated by callback results without mutating this matrix.

Parameters

NameTypeDescription
callback(a: Expression, row?: string | number, col?: string | number): Expression

Returns

Matrix

minus(x: NerdamerInput): MatrixMethod

Subtracts corresponding entries, or broadcasts a scalar subtrahend.

throws

DimensionError If a Matrix operand has different dimensions.

Parameters

NameTypeDescription
xNerdamerInput

Returns

Matrix

multiply(x: Expression): MatrixMethod

Delegates the public multiplication alias to the Matrix-specific times() contract.

Parameters

NameTypeDescription
xExpression

Returns

Matrix

nullspace(prime?: string | number | Expression): Expression[][]Method

Computes a basis for the nullspace using the same reduced row-echelon form as rref.

remarks

Without

`prime`

, the basis is computed with exact symbolic Expression arithmetic. When

`prime`

is supplied, the existing modular arithmetic path is preserved and basis entries are reduced modulo that value. Each free column contributes one basis vector, ordered by increasing free-column index. A full-column-rank matrix therefore returns an empty basis.

Parameters

NameTypeDescription
primestring | number | ExpressionOptional modulus for finite-field nullspace arithmetic.

Returns

Expression[][] — Basis vectors as independent Expression arrays ordered by matrix column.

plus(x: NerdamerInput): MatrixMethod

Adds corresponding entries, or broadcasts a scalar addend.

throws

DimensionError If a Matrix operand has different dimensions.

Parameters

NameTypeDescription
xNerdamerInput

Returns

Matrix

pow(x: NerdamerInput): MatrixMethod

Raises this matrix to an integer power without mutating it. Positive powers use matrix multiplication, zero returns the identity, and negative powers use the matrix inverse. A rectangular matrix is accepted only for the identity power

`1`

; all other matrix powers require a square matrix.

throws

UnsupportedOperationError If the exponent is not an integer, or if a nontrivial power is requested for a rectangular matrix.

throws

MathError If a negative power requires the inverse of a singular matrix.

Parameters

NameTypeDescription
xNerdamerInput

Returns

Matrix

precision: numberProperty

No description is available yet.

rank(): numberMethod

No description is available yet.

Returns

number

row(n: number): MatrixMethod

No description is available yet.

Parameters

NameTypeDescription
nnumber

Returns

Matrix

rows(): numberMethod

No description is available yet.

Returns

number

rref(prime?: string | number | Expression): MatrixMethod

Returns reduced row-echelon form without mutating this matrix. When

`prime`

is supplied, pivot arithmetic is performed modulo that value. Otherwise pivots and zero rows are determined by exact Expression equality.

Parameters

NameTypeDescription
primestring | number | Expression

Returns

Matrix

set(row: number, col: number, value: ParserEntity): thisMethod

Sets a zero-based cell after converting

`value`

to an Expression.

Parameters

NameTypeDescription
rownumber
colnumber
valueParserEntity

Returns

this

simplify(): MatrixMethod

No description is available yet.

Returns

Matrix

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(M: Expression): MatrixMethod

Returns scalar multiplication, the matrix product

`this * M`

, or the matrix-vector product

`this * v`

.

throws

MathError If matrix or vector dimensions are incompatible.

throws

UnsupportedOperationError If the operand is not a supported scalar, Matrix, or Vector.

Parameters

NameTypeDescription
MExpression

Returns

Matrix

toRightTriangular(): MatrixMethod

Returns a row-echelon copy produced by forward elimination and row swaps.

Returns

Matrix

toString(): stringMethod

No description is available yet.

Returns

string

toUpperTriangular(): MatrixMethod

No description is available yet.

Returns

Matrix

trace(): ExpressionMethod

Returns the sum of the main diagonal. The empty matrix has trace zero.

throws

MathError If the matrix is not square.

Returns

Expression

transpose(): MatrixMethod

Returns a transposed matrix. Existing elements are normalized by the constructor.

Returns

Matrix

unroll(): VectorMethod

Returns elements as a column-major Vector.

Returns

Vector

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

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

Matrix

zeroMatrix(rows: number, cols: number): MatrixMethod

Creates a matrix filled with symbolic zeros.

Parameters

NameTypeDescription
rowsnumber
colsnumber

Returns

Matrix