C++ Reference: class MPConstraint

Note: This documentation is automatically generated.

Method
basis_status

Return type: MPSolver::BasisStatus

Clear

Return type: void

Clears all variables and coefficients. Does not clear the bounds.

dual_value

Return type: double

GetCoefficient

Return type: double

Arguments: const MPVariable* const var

index

Return type: int

Returns the index of the constraint in the MPSolver::constraints_.

indicator_value

Return type: bool

indicator_variable

Return type: const MPVariable*

is_lazy

Return type: bool

Advanced usage: returns true if the constraint is "lazy" (see below).

lb

Return type: double

Returns the lower bound.

name

Return type: const std::string&

Returns the name of the constraint.

set_is_lazy

Return type: void

Arguments: bool laziness

SetBounds

Return type: void

Arguments: double lb, double ub

Sets both the lower and upper bounds.

SetCoefficient

Return type: void

Arguments: const MPVariable* const var, double coeff

SetLB

Return type: void

Arguments: double lb

Sets the lower bound.

SetUB

Return type: void

Arguments: double ub

Sets the upper bound.

terms

Return type: const absl::flat_hash_map<const MPVariable*, double>&

ub

Return type: double

Returns the upper bound.