1
$\begingroup$

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.

Bound

$\endgroup$

1 Answer 1

1
$\begingroup$

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.

$\endgroup$
2
  • $\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) But context.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
  • $\begingroup$ My bad, It works with getDoubleInfo() $\endgroup$ Jul 24 at 7:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.