QuadraticConstraint#

class QuadraticConstraint(quadratic_program, name, linear, quadratic, sense, rhs)[ソース]#

ベースクラス: Constraint

Representation of a quadratic constraint.

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

パラメータ:
  • quadratic_program (Any) – The parent quadratic program.

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

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

  • quadratic (ndarray | spmatrix | List[List[float]] | Dict[Tuple[int | str, 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

linear#

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

戻り値:

The left-hand-side linear expression.

name#

Returns the name of the constraint.

戻り値:

The name of the constraint.

quadratic#

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

戻り値:

The left-hand-side quadratic expression.

quadratic_program#

Returns the parent QuadraticProgram.

戻り値:

The parent QuadraticProgram.

rhs#

Returns the right-hand-side of the constraint.

戻り値:

The right-hand-side of the constraint.

sense#

Returns the sense of the constraint.

戻り値:

The sense of the constraint.

Methods

evaluate(x)[ソース]#

Evaluate the left-hand-side of the constraint.

パラメータ:

x (ndarray | List | Dict[int | str, float]) – The values of the variables to be evaluated.

戻り値:

The left-hand-side of the constraint given the variable values.

戻り値の型:

float