45 #ifndef MEILP_SOLVER_HPP 46 #define MEILP_SOLVER_HPP 49 #include "config_HAVE_COIN_OR.hpp" 50 #include "config_HAVE_GLPK.hpp" 51 #include "config_HAVE_LP_SOLVE.hpp" 124 void resize(
size_t count);
130 virtual void copy(
const std::map<int, double>& i_coeffs);
141 virtual void print(std::ostream& os) = 0;
178 virtual void make(
int nvars) = 0;
183 virtual int solve() = 0;
197 virtual void add_row(std::map<int, double>& i_coeffs,
double i_rhs,
ilp_sign i_sign,
const std::string& name) = 0;
216 virtual void set_int(
int i) = 0;
224 virtual void set_bnds(
int var,
double lowbo,
double upbo);
231 virtual void set_lowbo(
int var,
double bound);
238 virtual void set_upbo(
int var,
double bound);
263 virtual void set_col_name(
int var,
const std::string& name) = 0;
308 virtual void print_to_file(
const std::string& file_name) = 0;
virtual void set_bnds(int var, double lowbo, double upbo)
Set lower and upper bound of a variable.
virtual int solve()=0
Solve the linear problem.
virtual void copy(const std::map< int, double > &i_coeffs)
REF_FORWARD_DECL(meilp_solver)
RefCount type definition of the meilp_solver class structure.
CustomUnorderedMap< int, double > upper_bounds
The upper bound of the variables. They will be really set by solve method.
CustomUnorderedMap< int, double > lower_bounds
The lower bound of the variables. They will be really set by solve method.
void setMaximumSeconds(int MAX_t)
???
virtual void set_upbo(int var, double bound)
Set upper bound of a variable.
virtual void add_row(std::map< int, double > &i_coeffs, double i_rhs, ilp_sign i_sign, const std::string &name)=0
Add a constraint to the ilp formulation.
virtual std::string get_col_name(int var)=0
Get name of a variable (column)
int unique_column_id
unique column identifier
virtual void objective_add(std::map< int, double > &i_coeffs, ilp_dir dir)=0
Set the objective function.
meilp_solver()
Constructor.
redefinition of map to manage ordered/unordered structures
virtual int get_number_variables() const =0
Return the number of variables.
virtual void set_binary(int i)
Set a variable to have only binary values.
void resize(size_t count)
std::map< int, int > priority
variables priority
void set_priority(const std::map< int, int > &_priority)
Set the variable priority.
ilp_dir
Type of objective function.
virtual int solve_ilp()=0
Solve the integer linear problem.
int debug_level
debug_level
absl::flat_hash_map< T, U, Hash, Eq, Alloc > CustomUnorderedMap
virtual ~meilp_solver()
virtual destructor
int * int_buffer
indexes in the constraint buffer
void set_debug_level(int dl)
Set the verbosity (debug_level)
virtual void print_to_file(const std::string &file_name)=0
Print the problem.
Base class providing several methods to encapsulate the interface to several ilp solver.
virtual void set_all_bounds()=0
Set the lower and upper of the variables using lower_bounds and upper_bounds.
supported_solvers
List of currently supported solvers.
virtual void set_int(int i)=0
Set a variable to have only integer values.
virtual void get_vars_solution(std::map< int, double > &vars) const =0
Return the solution of the problem.
Template definition of refcount.
static meilp_solverRef create_solver(supported_solvers solver_type)
Factory static member function.
virtual int add_empty_column()=0
Add an empty column ???
virtual void print(std::ostream &os)=0
Print the problem.
size_t nel
number of elements in the constraint buffer
virtual void make(int nvars)=0
???
int MAX_time
Time-out value.
virtual int get_number_constraints() const =0
Return the number of constraints.
ilp_sign
Possible operator in constraints.
double * real_buffer
values in the constraint buffer
virtual void set_col_name(int var, const std::string &name)=0
Set name of a variable (column)
virtual void set_lowbo(int var, double bound)
Set lower bound of a variable.