ROOC
    Preparing search index...

    Class LinearConstraint

    A constraint of a linear model, which stores only its nonzero coefficients: getValues()[k] is the coefficient of the variable at position getIndices()[k] of the model's getVariables().

    const variables = linear.getVariables()
    for (const constraint of linear.getConstraints()) {
    const values = constraint.getValues()
    constraint.getIndices().forEach((index, k) => console.log(values[k], variables[index]))
    }
    Index
    instance: _LinearConstraint
    • Get the coefficient of every variable of the model, zeros included, in the order of the model's variables

      Returns number[]

    • Get the indexes of the variables with a nonzero coefficient, in increasing order. An index is the position of the variable in the model's getVariables()

      Returns number[]

    • Get the nonzero coefficients, getValues()[k] is the coefficient of the variable at getIndices()[k]

      Returns number[]