CGAL 5.1 - CGAL and Solvers
|
#include <Concepts/MixedIntegerProgramTraits.h>
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.
Creation | |
MixedIntegerProgramTraits () | |
Default constructor. More... | |
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. More... | |
const std::vector< MixedIntegerProgramVariable * > & | variables () const |
Returns the variables. More... | |
std::vector< MixedIntegerProgramVariable * > & | variables () |
std::size_t | number_of_constraints () const |
Returns the number of constraints. More... | |
const std::vector< MixedIntegerProgramLinearConstraint * > & | constraints () const |
Returns the constraints. More... | |
std::vector< MixedIntegerProgramLinearConstraint * > & | constraints () |
std::size_t | number_of_continuous_variables () const |
Returns the number of continuous variables. More... | |
std::size_t | number_of_integer_variables () const |
Returns the number of integer variables. More... | |
std::size_t | number_of_binary_variables () const |
Returns the number of binary variables. More... | |
bool | is_continuous () const |
Returns true if all variables are continuous. More... | |
bool | is_mixed_integer_program () const |
Returns true if this is a mixed integer program. More... | |
bool | is_integer_program () const |
Returns true if this is an integer program. More... | |
bool | is_binary_program () const |
Returns true if binary program. More... | |
const MixedIntegerProgramLinearObjective * | objective () const |
Returns the objective. More... | |
MixedIntegerProgramLinearObjective * | objective () |
bool | solve () |
Solves the program. Returns false if failed. More... | |
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. More... | |
MixedIntegerProgramTraits< FT >::MixedIntegerProgramTraits | ( | ) |
Default constructor.
void MixedIntegerProgramTraits< FT >::clear | ( | ) |
Clears all variables, constraints, and the objective.
std::vector<MixedIntegerProgramLinearConstraint*>& MixedIntegerProgramTraits< FT >::constraints | ( | ) |
const std::vector<MixedIntegerProgramLinearConstraint*>& MixedIntegerProgramTraits< FT >::constraints | ( | ) | const |
Returns the constraints.
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.
bool MixedIntegerProgramTraits< FT >::is_binary_program | ( | ) | const |
Returns true if binary program.
bool MixedIntegerProgramTraits< FT >::is_continuous | ( | ) | const |
Returns true if all variables are continuous.
bool MixedIntegerProgramTraits< FT >::is_integer_program | ( | ) | const |
Returns true if this is an integer program.
bool MixedIntegerProgramTraits< FT >::is_mixed_integer_program | ( | ) | const |
Returns true if this is a mixed integer program.
std::size_t MixedIntegerProgramTraits< FT >::number_of_binary_variables | ( | ) | const |
Returns the number of binary variables.
std::size_t MixedIntegerProgramTraits< FT >::number_of_constraints | ( | ) | const |
Returns the number of constraints.
std::size_t MixedIntegerProgramTraits< FT >::number_of_continuous_variables | ( | ) | const |
Returns the number of continuous variables.
std::size_t MixedIntegerProgramTraits< FT >::number_of_integer_variables | ( | ) | const |
Returns the number of integer variables.
std::size_t MixedIntegerProgramTraits< FT >::number_of_variables | ( | ) | const |
Returns the number of variables.
MixedIntegerProgramLinearObjective* MixedIntegerProgramTraits< FT >::objective | ( | ) |
const MixedIntegerProgramLinearObjective* MixedIntegerProgramTraits< FT >::objective | ( | ) | const |
Returns the objective.
const std::vector<FT>& MixedIntegerProgramTraits< FT >::solution | ( | ) | const |
Returns the result.
bool MixedIntegerProgramTraits< FT >::solve | ( | ) |
Solves the program. Returns false if failed.
std::vector<MixedIntegerProgramVariable*>& MixedIntegerProgramTraits< FT >::variables | ( | ) |
const std::vector<MixedIntegerProgramVariable*>& MixedIntegerProgramTraits< FT >::variables | ( | ) | const |
Returns the variables.