I wonder if there is a way to retrieve the global objective upper bound in a callback in Cplex (in cpp)? I tried several context/IloCplex/IloModel... methods but nothing worked.
1 Answer
I'll use Java notation, but C++ should be very similar if not the same. There is a method IloCplex.Callback.Context.getDoubleInfo() that takes an enumeration value as argument and returns a double precision value. The enumeration value IloCplex.Callback.Context.Info.BestBound is what you want.
-
$\begingroup$ I tried this method, but it raised an error, it's strange because i can call other attribut of the Info object but not the BestBound.
context.getLongInfo(IloCplex::Callback::Context::Info::BestBound);
raised : 1003 Cplex error code (Bad argument) Butcontext.getLongInfo(IloCplex::Callback::Context::Info::NodeDepth);
worked, there are defined in the same enum, maybe it comes from the 22.1 Cplex version $\endgroup$ Jul 24 at 6:59 -