CGAL 5.0 - CGAL and Solvers
|
Concept describing the set of requirements for (constrained or unconstrained) Mixed Integer Programming (MIP) problems. A model of this concept stores the integer variables, linear objective, and linear constraints (if any) and provides a method to solve the problem.
CGAL::Mixed_integer_program_traits<T>
CGAL::GLPK_mixed_integer_program_traits<T>
CGAL::SCIP_mixed_integer_program_traits<T>
Creation | |
MixedIntegerProgramTraits () | |
Default constructor. | |
Operations | |
MixedIntegerProgramVariable * | create_variable (Variable_type type, FT lb, FT ub, const std::string &name) |
Creates a single variable, adds it to the solver, and returns its pointer. More... | |
std::vector< MixedIntegerProgramVariable * > | create_variables (std::size_t n) |
Creates a set of variables, adds them to the solver, and returns their pointers. More... | |
MixedIntegerProgramLinearConstraint * | create_constraint (FT lb, FT ub, const std::string &name) |
Creates a single linear constraint, adds it to the solver, and returns the pointer. More... | |
std::vector< MixedIntegerProgramLinearConstraint * > | create_constraints (std::size_t n) |
Creates a set of linear constraints, adds them to the solver, and returns their pointers. More... | |
MixedIntegerProgramLinearObjective * | create_objective (Sense sense) |
Creates the objective function and returns the pointer. More... | |
std::size_t | number_of_variables () const |
Returns the number of variables. | |
const std::vector< MixedIntegerProgramVariable * > & | variables () const |
Returns the variables. | |
std::vector< MixedIntegerProgramVariable * > & | variables () |
std::size_t | number_of_constraints () const |
Returns the number of constraints. | |
const std::vector< MixedIntegerProgramLinearConstraint * > & | constraints () const |
Returns the constraints. | |
std::vector< MixedIntegerProgramLinearConstraint * > & | constraints () |
std::size_t | number_of_continuous_variables () const |
Returns the number of continuous variables. | |
std::size_t | number_of_integer_variables () const |
Returns the number of integer variables. | |
std::size_t | number_of_binary_variables () const |
Returns the number of binary variables. | |
bool | is_continuous () const |
Returns true if all variables are continuous. | |
bool | is_mixed_integer_program () const |
Returns true if this is a mixed integer program. | |
bool | is_integer_program () const |
Returns true if this is an integer program. | |
bool | is_binary_program () const |
Returns true if binary program. | |
const MixedIntegerProgramLinearObjective * | objective () const |
Returns the objective. | |
MixedIntegerProgramLinearObjective * | objective () |
bool | solve () |
Solves the program. Returns false if failed. | |
const std::vector< FT > & | solution () const |
Returns the result. More... | |
const std::string & | error_message () const |
Returns the error message. More... | |
void | clear () |
Clears all variables, constraints, and the objective. | |
MixedIntegerProgramLinearConstraint* MixedIntegerProgramTraits< FT >::create_constraint | ( | FT | lb, |
FT | ub, | ||
const std::string & | name | ||
) |
Creates a single linear constraint, adds it to the solver, and returns the pointer.
std::vector<MixedIntegerProgramLinearConstraint*> MixedIntegerProgramTraits< FT >::create_constraints | ( | std::size_t | n | ) |
Creates a set of linear constraints, adds them to the solver, and returns their pointers.
MixedIntegerProgramLinearObjective* MixedIntegerProgramTraits< FT >::create_objective | ( | Sense | sense | ) |
Creates the objective function and returns the pointer.
MixedIntegerProgramVariable* MixedIntegerProgramTraits< FT >::create_variable | ( | Variable_type | type, |
FT | lb, | ||
FT | ub, | ||
const std::string & | name | ||
) |
Creates a single variable, adds it to the solver, and returns its pointer.
std::vector<MixedIntegerProgramVariable*> MixedIntegerProgramTraits< FT >::create_variables | ( | std::size_t | n | ) |
Creates a set of variables, adds them to the solver, and returns their pointers.
const std::string& MixedIntegerProgramTraits< FT >::error_message | ( | ) | const |
Returns the error message.
const std::vector<FT>& MixedIntegerProgramTraits< FT >::solution | ( | ) | const |
Returns the result.