Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize the function Cut::getCuts such that is works for multiple solvers without the need to edit the function (use templates) #2

Open
michieluithetbroek opened this issue Apr 10, 2020 · 0 comments

Comments

@michieluithetbroek
Copy link
Owner

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);
@michieluithetbroek 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 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant