Commit 2ddf01b9 authored by Max Lyon's avatar Max Lyon

change gurobi solver interface to accept const refs to vectors

parent 0b8c4ddf
Pipeline #5598 failed with stages
in 6 minutes and 40 seconds
Subproject commit be2213b87bda432649715ddb7967f56d27be0fdf
Subproject commit 86ada33be371319082946389b144b7b6acf9c9d3
......@@ -83,8 +83,8 @@ static void process_gurobi_exception(const GRBException& _exc)
bool
GUROBISolver::
solve(NProblemInterface* _problem,
std::vector<NConstraintInterface*>& _constraints,
std::vector<PairIndexVtype>& _discrete_constraints,
const std::vector<NConstraintInterface *> &_constraints,
const std::vector<PairIndexVtype> &_discrete_constraints,
const double _time_limit)
{
DEB_enter_func;
......@@ -273,8 +273,8 @@ solve(NProblemInterface* _problem,
bool
GUROBISolver::
solve_two_phase(NProblemInterface* _problem, // problem instance
std::vector<NConstraintInterface*>& _constraints, // linear constraints
std::vector<PairIndexVtype>& _discrete_constraints, // discrete constraints
const std::vector<NConstraintInterface*>& _constraints, // linear constraints
const std::vector<PairIndexVtype>& _discrete_constraints, // discrete constraints
const double _time_limit0, // time limit phase 1 in seconds
const double _gap0, // MIP gap phase 1
const double _time_limit1, // time limit phase 2 in seconds
......@@ -288,8 +288,8 @@ solve_two_phase(NProblemInterface* _problem, //
bool
GUROBISolver::
solve_two_phase(NProblemInterface* _problem, // problem instance
std::vector<NConstraintInterface*>& _constraints, // linear constraints
std::vector<PairIndexVtype>& _discrete_constraints, // discrete constraints
const std::vector<NConstraintInterface *> &_constraints, // linear constraints
const std::vector<PairIndexVtype> &_discrete_constraints, // discrete constraints
const double _time_limit0, // time limit phase 1 in seconds
const double _gap0, // MIP gap phase 1
const double _time_limit1, // time limit phase 2 in seconds
......
......@@ -43,14 +43,14 @@ class COMISODLLEXPORT GUROBISolver
{
public:
// ********** SOLVE **************** //
bool solve(NProblemInterface* _problem, // problem instance
std::vector<NConstraintInterface*>& _constraints, // linear constraints
std::vector<PairIndexVtype>& _discrete_constraints, // discrete constraints
const double _time_limit = 60 ); // time limit in seconds
bool solve(NProblemInterface* _problem, // problem instance
const std::vector<NConstraintInterface*>& _constraints, // linear constraints
const std::vector<PairIndexVtype>& _discrete_constraints, // discrete constraints
const double _time_limit = 60 ); // time limit in seconds
bool solve(NProblemInterface* _problem, // problem instance
std::vector<NConstraintInterface*>& _constraints, // linear constraints
const double _time_limit = 60 ) // time limit in seconds
const std::vector<NConstraintInterface*>& _constraints, // linear constraints
const double _time_limit = 60 ) // time limit in seconds
{
std::vector<PairIndexVtype> dc;
return solve(_problem, _constraints, dc, _time_limit);
......@@ -62,16 +62,16 @@ public:
// phase 2) starts only if in phase 1 no solution with a MIP gap lower than _gap1 was found and
// uses _gap1 and _time_limit2 as parameters
bool solve_two_phase(NProblemInterface* _problem, // problem instance
std::vector<NConstraintInterface*>& _constraints, // linear constraints
std::vector<PairIndexVtype>& _discrete_constraints, // discrete constraints
const std::vector<NConstraintInterface*>& _constraints, // linear constraints
const std::vector<PairIndexVtype>& _discrete_constraints, // discrete constraints
const double _time_limit0 = 60, // time limit phase 1 in seconds
const double _gap0 = 0.001, // MIP gap phase 1
const double _time_limit1 = 120, // time limit phase 2 in seconds
const double _gap1 = 0.2 ); // MIP gap phase 2
bool solve_two_phase(NProblemInterface* _problem, // problem instance
std::vector<NConstraintInterface*>& _constraints, // linear constraints
std::vector<PairIndexVtype>& _discrete_constraints, // discrete constraints
const std::vector<NConstraintInterface*>& _constraints, // linear constraints
const std::vector<PairIndexVtype>& _discrete_constraints, // discrete constraints
const double _time_limit0, // time limit phase 1 in seconds
const double _gap0 , // MIP gap phase 1
const double _time_limit1, // time limit phase 2 in seconds
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment