Originally posted by: SystemAdmin
//Okay, any chance that the new objective expression contains a variable that the LP does not already contain?
No. Absolutely not.
//Also, what happens if you invoke getExpr on the objective and then invoke setExpr with that expression, something like
Does that blow up as well?
Yes -- I can get the objective expression but can not set the same expression again one line after that.
//I'm assuming here that within the callback you are modifying a second problem (LP) that is distinct from the problem to which the callback is attached.
It might be, I also suspect this. But I am pretty much sure that there is only one model which is initialized in the constructor of class and can be exported to be checked.
//I don't think CPLEX will let you modify a model while it's being solved, but I'm pretty sure you already know that and are not doing it (just checking).
Callback is attached to an MIP while the problem to be solved is an lp and they are totally different. I am not changing any element of the MIP that I am in its callback.
I faced with such problem with callbacks before. This time I said ok I will write a class instead of simple Macro based callbacks.
thanks
#CPLEXOptimizers#DecisionOptimization