highs-js API reference
    Preparing search index...

    Interface SparseMatrix

    Detached compressed-sparse snapshot owned by JavaScript. Its arrays obey the SparseMatrixInput layout, and the last starts value is the stored nonzero count. The properties are readonly references, but typed-array elements are mutable; changing them never changes the native model.

    interface SparseMatrix {
        format: MatrixFormat;
        indices: Int32Array;
        numCols: number;
        numRows: number;
        starts: Int32Array;
        values: Float64Array;
    }
    Index
    format: MatrixFormat

    Orientation of this snapshot. In "csc", starts groups coefficients by column and indices contains row indices. In "csr", starts groups by row and indices contains column indices.

    indices: Int32Array

    Zero-based minor coordinate at each packed position: a row number for CSC or a column number for CSR. indices[k] identifies the coordinate of values[k]; the enclosing row/column is determined from starts.

    numCols: number

    Number of matrix columns. It bounds CSR indices values and determines the number of packed segments (numCols) when format === "csc".

    numRows: number

    Number of matrix rows. It bounds CSC indices values and determines the number of packed segments (numRows) when format === "csr".

    starts: Int32Array

    Packed-segment boundaries. Segment j occupies positions from starts[j] inclusive to starts[j + 1] exclusive in both indices and values. Segments are columns for CSC and rows for CSR. The array begins with zero, is nondecreasing, and its final entry equals the two data-array lengths.

    values: Float64Array

    Stored coefficients parallel to indices. values[k] and indices[k] describe one coordinate in the packed segment containing position k. This typed array is detached from Wasm; mutating it changes only the snapshot and never the native model.