Constraint
Bases: QuadraticProgramElement
Abstract Constraint Class.
Source code in q3as/quadratic/problems/constraint.py
name: str
property
Returns the name of the constraint.
Returns:
| Type | Description |
|---|---|
str
|
The name of the constraint. |
rhs: float
property
writable
Returns the right-hand-side of the constraint.
Returns:
| Type | Description |
|---|---|
float
|
The right-hand-side of the constraint. |
sense: ConstraintSense
property
writable
Returns the sense of the constraint.
Returns:
| Type | Description |
|---|---|
ConstraintSense
|
The sense of the constraint. |
__init__(quadratic_program, name, sense, rhs)
Initializes the constraint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
quadratic_program |
Any
|
The parent QuadraticProgram. |
required |
name |
str
|
The name of the constraint. |
required |
sense |
ConstraintSense
|
The sense of the constraint. |
required |
rhs |
float
|
The right-hand-side of the constraint. |
required |
Source code in q3as/quadratic/problems/constraint.py
evaluate(x)
abstractmethod
Evaluate left-hand-side of constraint for given values of variables.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x |
Union[ndarray, List, Dict[Union[int, str], float]]
|
The values to be used for the variables. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The left-hand-side of the constraint. |