You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function Cut::getCuts now returns a vector of CPLEX cuts. If one wants to use Gurobi, then one has to edit the function Cut::getCuts because 1) we need another return type, and 2) we have to call Cut::createGurobiConstraint instead of Cut::createIloRange.
We may avoid this by making Cut::getCuts a template function with two specialized template values (i.e., CPLEX and Gurobi). To avoid that the new template function breaks with the current code we can set the default value of the template to CPLEX.
The function will then be called as
auto const cuts = cut_ptr->getCuts<CPLEX>(model.d_env, model.d_x, x_val, true);
The text was updated successfully, but these errors were encountered:
michieluithetbroek
changed the title
Generalize
Generalize the function Cut::getCuts such that is works for multiple solvers without the need to edit the function
Apr 10, 2020
michieluithetbroek
changed the title
Generalize the function Cut::getCuts such that is works for multiple solvers without the need to edit the function
Generalize the function Cut::getCuts such that is works for multiple solvers without the need to edit the function (use templates)
Apr 10, 2020
The function
Cut::getCuts
now returns a vector of CPLEX cuts. If one wants to use Gurobi, then one has to edit the functionCut::getCuts
because 1) we need another return type, and 2) we have to callCut::createGurobiConstraint
instead ofCut::createIloRange
.We may avoid this by making
Cut::getCuts
a template function with two specialized template values (i.e., CPLEX and Gurobi). To avoid that the new template function breaks with the current code we can set the default value of the template to CPLEX.The function will then be called as
The text was updated successfully, but these errors were encountered: