highs-js API reference
    Preparing search index...

    Interface HessianInput

    Sparse symmetric Hessian Q for the quadratic objective sense * (offset + c'x + 0.5 * x'Qx).

    Storage is compressed by column. starts follows the same offset invariants as a CSC matrix and must have dimension + 1 entries; indices contains zero-based row indices, and starts[dimension] === indices.length === values.length. Duplicate row indices within a column are invalid.

    For "triangular", provide the lower triangle only: an entry in column j has row i >= j. For "square", provide the complete symmetric matrix, including both off-diagonal (i, j) and (j, i) entries. Values are entries of Q; do not pre-multiply them by 0.5.

    Example: Q = [[2, 1], [1, 4]] is triangularly encoded by starts: [0, 2, 3], indices: [0, 1, 1], values: [2, 1, 4]. It contributes x0^2 + x0*x1 + 2*x1^2 to the objective. Inputs are copied synchronously.

    interface HessianInput {
        dimension: number;
        format: HessianFormat;
        indices: IndexInput;
        starts: IndexInput;
        values: NumberInput;
    }
    Index
    dimension: number

    Number of rows and columns in square matrix Q. When the Hessian is passed to a model, this must equal that model's numCols, because there is one Hessian coordinate per decision variable. It must be a non-negative signed 32-bit integer.

    Selects which entries of symmetric matrix Q are supplied.

    "triangular" stores only the lower triangle in compressed-column form, so every entry in column j must have row index i >= j. HiGHS infers the mirrored upper triangle. "square" stores every matrix entry, so each off-diagonal value must be supplied in both symmetric coordinates and the resulting matrix must be symmetric.

    indices: IndexInput

    Zero-based row coordinate of each packed Hessian value. Position k represents matrix coordinate (indices[k], j), where column j is the unique column whose interval starts[j] <= k < starts[j + 1] contains it.

    Every index must satisfy 0 <= indices[k] < dimension. In triangular mode it must additionally satisfy indices[k] >= j. A column must not contain a duplicate row index. The array length must equal values.length and the final starts entry.

    starts: IndexInput

    Compressed-column boundaries into indices and values. Hessian column j occupies positions from starts[j] inclusive to starts[j + 1] exclusive. Equal adjacent values represent an empty column.

    The array must have exactly dimension + 1 entries, begin with 0, be nondecreasing, and end with indices.length === values.length === starts[dimension]. For example, [0, 2, 3] means column 0 has two stored entries and column 1 has one.

    values: NumberInput

    Entries of symmetric matrix Q, parallel to indices. values[k] is the value at the row given by indices[k] and the column determined by starts. These are entries of Q itself in objective 0.5 * x'Qx; do not halve diagonal values or double off-diagonal values.

    Values must be finite numbers and the length must equal indices.length and the final starts entry. For triangular encoding of Q = [[2, 1], [1, 4]], use starts: [0, 2, 3], indices: [0, 1, 1], and values: [2, 1, 4].