LinearConstraint¶

class
LinearConstraint
(quadratic_program, name, linear, sense, rhs)[source]¶ Bases:
qiskit_optimization.problems.constraint.Constraint
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 righthandside of the constraint.
Attributes
Returns the linear expression corresponding to the lefthandside of the constraint.
Methods
evaluate
(x)Evaluate the lefthandside of the constraint.