QuadraticConstraint

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

Representation of a quadratic constraint.

Constructs a quadratic constraint, consisting of a linear and a quadratic term.

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 part of the constraint.

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

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

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

Attributes

QuadraticConstraint.linear

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

QuadraticConstraint.name

Returns the name of the constraint.

QuadraticConstraint.quadratic

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

QuadraticConstraint.quadratic_program

Returns the parent QuadraticProgram.

QuadraticConstraint.rhs

Returns the right-hand-side of the constraint.

QuadraticConstraint.sense

Returns the sense of the constraint.

Methods

QuadraticConstraint.evaluate(x)

Evaluate the left-hand-side of the constraint.