Originally posted by: vera_deschamps
Dear Forum
I am using the following (senseless, but for the purpose of the question slimmed-down) user cut callback:
ILOUSERCUTCALLBACK1 (myUserCallback_fractional_cuts, IloBoolVarArray, variables) {
IloEnv env = getEnv();
// extract solution
IloNumArray values (env);
getValues (values, variables);
//env.setNormalizer (IloFalse);
IloExpr HM_cut_lhs (env);
HM_cut_lhs += variables[0];
HM_cut_lhs += variables[0];
add (HM_cut_lhs >= 0);
values.end();
return;
}
This code appears to "freeze" on my computer: it waits indefinitely in __psunch_mutexwait when adding the constraint. This seems to be caused since I add the same variable twice to the constraint (otherwise it works as expected). Everything works if I uncomment the setNormalizer constraint.
Could you please let me know if this behaviour is expected? I get the same behaviour when I use "IloTrue" in the setNormalizer constraint. In that case, however, I would have expected CPLEX to correctly deal with the fact that the same variable is added twice? Also, shouldn't an exception be raised, rather than the code freezing? (I am running in debug mode, that is, an assert (false); terminates the program.)
Many thanks!
#CPLEXOptimizers#DecisionOptimization