CGAL 5.6.1 - CGAL and Solvers
|
MixedIntegerProgramLinearConstraint
is a concept of a linear constraint in a Mixed Integer Programming (MIP) problem.
Creation | |
MixedIntegerProgramLinearConstraint (MixedIntegerProgramTraits *solver, FT lb, FT ub, const std::string &name, int idx) | |
Constructs a linear constraint, initialized with the solver it belongs to, the lower bound, upper bound, name, and index. | |
Operations | |
const std::string & | name () const |
Returns the name of the constraint. | |
void | set_name (const std::string &n) |
Sets the name of the constraint. | |
int | index () const |
Returns the index of the constraint. | |
void | set_index (int idx) |
Sets the index of the constraint. | |
const MixedIntegerProgramTraits * | solver () const |
Returns the solver that owns this constraint. | |
MixedIntegerProgramTraits * | solver () |
void | set_lower_bound (FT lb) |
Sets the lower bound. | |
void | set_upper_bound (FT ub) |
Sets the upper bound. | |
void | set_bounds (FT lb, FT ub) |
Sets both lower and upper bounds. | |
FT | lower_bound () const |
Gets the lower bound. | |
FT | upper_bound () const |
Gets the upper bound. | |
void | get_bounds (FT &lb, FT &ub) const |
Gets both lower and upper bounds. | |
void | set_coefficients (const std::unordered_map< const MixedIntegerProgramVariable *, FT > &coeffs) |
Sets the coefficients of the constraint. | |
void | add_coefficient (const MixedIntegerProgramVariable *var, FT coeff) |
Adds a coefficient to a variable of the constraint. | |
const std::unordered_map< const MixedIntegerProgramVariable *, FT > & | coefficients () const |
Returns the coefficients of the constraint. | |
FT | get_coefficient (const MixedIntegerProgramVariable *var) const |
Gets the coefficient of the variable in this constraint. | |
void | set_offset (FT value) |
Sets the constant term. | |
FT | offset () const |
Gets the constant term. | |
void | clear () |
Clears all variables and sets the constant term to zero. More... | |
static FT | infinity () |
Gets the infinity threshold (e.g., 1e20). More... | |
void MixedIntegerProgramLinearConstraint< FT >::clear | ( | ) |
Clears all variables and sets the constant term to zero.
Useful to reuse the object to define a new linear constraint.
|
static |
Gets the infinity threshold (e.g., 1e20).
Values greater than this value are considered as infinity.