#include <Concepts/MixedIntegerProgramTraits.h>
MixedIntegerProgramVariable
is a concept of a variable in a Mixed Integer Programming (MIP) problem.
- Has Models:
CGAL::Variable<FT>
|
| MixedIntegerProgramVariable (MixedIntegerProgramTraits *solver, Variable_type type, FT lb=, FT ub, const std::string &name, int idx) |
| Constructs a variable initialized with the pointer of the solver it belongs to, the variable type, lower bound, upper bound, name, and index. More...
|
|
◆ FT
◆ Variable_type
A variable can be continuous, integer, or binary.
Enumerator |
---|
CONTINUOUS | |
INTEGER | |
BINARY | |
◆ MixedIntegerProgramVariable()
Constructs a variable initialized with the pointer of the solver it belongs to, the variable type, lower bound, upper bound, name, and index.
◆ get_bounds()
void MixedIntegerProgramVariable::get_bounds |
( |
FT & |
lb, |
|
|
FT & |
ub |
|
) |
| const |
Gets both lower and upper bounds.
◆ index()
int MixedIntegerProgramVariable::index |
( |
| ) |
const |
Returns the index of the variable.
◆ infinity()
static FT MixedIntegerProgramVariable::infinity |
( |
| ) |
|
|
static |
Gets the infinity threshold (e.g., 1e20).
Values greater than this value are considered as infinity.
◆ lower_bound()
FT MixedIntegerProgramVariable::lower_bound |
( |
| ) |
const |
◆ name()
const std::string& MixedIntegerProgramVariable::name |
( |
| ) |
const |
Returns the name of the variable.
◆ set_bounds()
void MixedIntegerProgramVariable::set_bounds |
( |
FT |
lb, |
|
|
FT |
ub |
|
) |
| |
Sets both lower and upper bounds.
◆ set_index()
void MixedIntegerProgramVariable::set_index |
( |
int |
idx | ) |
|
Sets the index of the variable.
◆ set_lower_bound()
void MixedIntegerProgramVariable::set_lower_bound |
( |
FT |
lb | ) |
|
◆ set_name()
void MixedIntegerProgramVariable::set_name |
( |
const std::string & |
n | ) |
|
Sets the name of the variable.
◆ set_solution_value()
void MixedIntegerProgramVariable::set_solution_value |
( |
FT |
value | ) |
|
Sets the solution value (should be called internally by the solver).
◆ set_upper_bound()
void MixedIntegerProgramVariable::set_upper_bound |
( |
FT |
ub | ) |
|
◆ set_variable_type()
void MixedIntegerProgramVariable::set_variable_type |
( |
Variable_type |
t | ) |
|
Sets/Changes the variable type.
◆ solution_value()
FT MixedIntegerProgramVariable::solution_value |
( |
bool |
rounded = false | ) |
const |
Returns the value of the variable in the current solution.
- Note
- (1) Valid only if the program was successfully solved. (2) If the variable is integer and rounded == true, then the value will be rounded to the nearest integer.
◆ solver() [1/2]
◆ solver() [2/2]
Returns the solver that owns this variable.
◆ upper_bound()
FT MixedIntegerProgramVariable::upper_bound |
( |
| ) |
const |
◆ variable_type()
Variable_type MixedIntegerProgramVariable::variable_type |
( |
| ) |
const |
Returns the variable type.