Skip to content

This site describes solve-engine as it is on main: 2.43.0, which npm does not have yet. npm installs 2.40.0, so a page may show an answer that version does not give yet.

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