Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
Wraps the MPCallback in order to catch and store exceptions. More...
Public Member Functions | |
MPCallbackWrapper (MPCallback *callback) | |
MPCallback * | GetCallback () const |
void | CatchException (XPRSprob cbprob) |
void | LogCaughtExceptions () |
Wraps the MPCallback in order to catch and store exceptions.
Definition at line 261 of file xpress_interface.cc.
|
inlineexplicit |
Definition at line 263 of file xpress_interface.cc.
|
inline |
Since our (C++) call-back functions are called from the XPRESS (C) code, exceptions thrown in our call-back code are not caught by XPRESS. We have to catch them, interrupt XPRESS, and log them after XPRESS is effectively interrupted (ie after solve).
Definition at line 269 of file xpress_interface.cc.
|
inline |
Definition at line 264 of file xpress_interface.cc.
|
inline |
We don't want the interface to throw exceptions, plus it causes SWIG issues in Java & Python. Instead, we'll only log them. (The use cases where the user has to raise an exception inside their call-back does not seem to be frequent, anyway.)
Definition at line 275 of file xpress_interface.cc.