highs-js API reference
    Preparing search index...

    Type Alias IndexSelection

    IndexSelection:
        | { from: number; kind: "range"; to: number }
        | { indices: IndexInput; kind: "set" }
        | { kind: "mask"; mask: MaskInput }

    Selection of current zero-based rows or columns.

    A range is inclusive and requires 0 <= from <= to < axisLength. A set must contain valid indices in strictly increasing order. A mask has exactly axisLength entries and selects true/1 positions. Results are ordered by ascending current model index for every selection kind.

    For bulk changes, range/set value arrays are packed with one value per selected item. Mask value arrays instead span the complete axis; only values at selected positions are consumed. For example, selecting columns 1 and 2 with mask [0, 1, 1, 0] requires a four-element value array such as [0, 20, 30, 0], not [20, 30].

    Type Declaration

    • { from: number; kind: "range"; to: number }
      • Readonlyfrom: number

        First selected current row/column index. It is zero-based and must satisfy 0 <= from <= to; deletion or insertion can change which model item occupies this index in a later call.

      • Readonlykind: "range"

        Selects every current axis position from from through to, including both endpoints. Use this when the desired rows/columns are contiguous.

      • Readonlyto: number

        Last selected current row/column index, included in the selection. It must satisfy from <= to < currentAxisLength. Empty ranges are not represented; use an empty set if the operation supports one.

    • { indices: IndexInput; kind: "set" }

      Indices must increase strictly, matching the stable C set operations.

      • Readonlyindices: IndexInput

        Zero-based current model indices in strictly increasing order, with no duplicates. Every value must be below the current axis length. This order is also the packed order expected by parallel values in bulk range/set mutation methods.

      • Readonlykind: "set"

        Selects explicitly listed current rows/columns. Use this for a sparse, non-contiguous selection where a full-axis mask would be inconvenient.

    • { kind: "mask"; mask: MaskInput }

      Masks contain one boolean/0/1 entry per model row or column.

      • Readonlykind: "mask"

        Selects current axis positions whose corresponding mask entry is true/1; false/0 entries are not selected.

      • Readonlymask: MaskInput

        Full-axis bitmap with exactly one entry per current model row or column. Each entry must be exactly boolean or 0/1. Unlike range/set mutations, parallel mutation vectors also span the full axis rather than containing only selected values. For mask [0, 1, 1, 0], costs might therefore be [0, 20, 30, 0]; only positions 1 and 2 are consumed.