Skip to content

This site describes solve-engine 2.44.0, the version npm installs.

matrixValue

function matrixValue(
rows,
cols,
data,
unit?,
places?
): Value;

Defined in: packages/engine/src/vm/Value.ts:1376

Create a Matrix value from an explicit shape + column-major data array. data.length must equal rows*cols, callers building a matrix from row-major source syntax (e.g. the [1,2;3,4] literal) must transpose into column-major order before calling this; see MatrixOps.ts’s rowMajorToColumnMajor().

unit, when given, is the unit every numeric cell is read in (see MatrixData.unit); the caller has already converted the cells into it. places, when given, is the place count each cell is shown to (see MatrixData.places), one entry per cell of data.

ParameterType
rowsnumber
colsnumber
datareadonly MatrixEntry[]
unit?string
places?readonly (number | undefined)[]

Value