Reputation: 3
I'm new in cplex, I found in python the function: add_indicator_constraint, but in c++ I can't find anything like that. Can someone show me, please?
Upvotes: 0
Views: 137
Reputation: 10059
in the example ilofixnet.cpp in CPLEX_Studio201\cplex\examples\src\cpp you can see a good example of indicator constraint in C++
// Add logical constraints that require x[i]==0 if f[i] is 0.
for (IloInt i = 0; i < x.getSize(); ++i)
model.add(IloIfThen(env, f[i] == 0, x[i] == 0));
Upvotes: 1