Originally posted by: SystemAdmin
What problems do you observe? Compiler, linker, runtime problems?
Is it just a typo or did you leave out the index j in the second conversion intentionally?
Your second conversion should read
model.add(IloConversion(env, edge[j], ILOFLOAT)); // RESET
Note the j index. There is no IloConversion constructor that accepts arrays as second argument.
I guess you got an IloCplex::MultipleConversionException? Look at the reference manual.
It explicitly states that there can be only one IloConversion for each variable.
To remove a conversion from a model you should end() that conversion (this is also
explained in the reference manual):
// Add the conversion.
IloConversion conversion(env, edge [j], ILOINT);
model.add(conversion);
// Remove the conversion.
conversion.end();
#CPLEXOptimizers#DecisionOptimization