Constraint#

class Constraint(quadratic_program, name, sense, rhs)[source]#

Bases: QuadraticProgramElement

Abstract Constraint Class.

Initializes the constraint.

প্যারামিটার:
  • quadratic_program (Any) -- The parent QuadraticProgram.

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

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

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

Attributes

name#

Returns the name of the constraint.

রিটার্নস:

The name of the constraint.

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

abstract evaluate(x)[source]#

Evaluate left-hand-side of constraint for given values of variables.

প্যারামিটার:

x (ndarray | List | Dict[int | str, float]) -- The values to be used for the variables.

রিটার্নস:

The left-hand-side of the constraint.

রিটার্ন টাইপ:

float