LinearConstraint

class LinearConstraint(quadratic_program, name, linear, sense, rhs)[source]

Representation of a linear constraint.

Parameters
  • quadratic_program (Any) – The parent quadratic program.

  • name (str) – The name of the constraint.

  • linear (Union[ndarray, spmatrix, List[float], Dict[Union[int, str], float]]) – The coefficients specifying the linear constraint.

  • sense (ConstraintSense) – The sense of the constraint.

  • rhs (float) – The right-hand-side of the constraint.

Attributes

LinearConstraint.linear

Returns the linear expression corresponding to the left-hand-side of the constraint.

LinearConstraint.name

Returns the name of the constraint.

LinearConstraint.quadratic_program

Returns the parent QuadraticProgram.

LinearConstraint.rhs

Returns the right-hand-side of the constraint.

LinearConstraint.sense

Returns the sense of the constraint.

Methods

LinearConstraint.evaluate(x)

Evaluate the left-hand-side of the constraint.