Commit 6f9a8cad authored by Max Lyon's avatar Max Lyon
Browse files

set a start solution for Gurobi

parent 2ddf01b9
Pipeline #5915 failed with stages
in 6 minutes and 21 seconds
...@@ -125,6 +125,12 @@ solve(NProblemInterface* _problem, ...@@ -125,6 +125,12 @@ solve(NProblemInterface* _problem,
case 2 : vars.push_back( model.addVar(-GRB_INFINITY, GRB_INFINITY, 0.0, GRB_BINARY ) ); break; case 2 : vars.push_back( model.addVar(-GRB_INFINITY, GRB_INFINITY, 0.0, GRB_BINARY ) ); break;
} }
// set start
std::vector<double> start(vars.size());
_problem->initial_x(start.data());
for (int i = 0; i < _problem->n_unknowns(); ++i)
vars[i].set(GRB_DoubleAttr_Start, start[i]);
// Integrate new variables // Integrate new variables
model.update(); model.update();
......
Supports Markdown
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