![]() |
Google OR-Tools v9.12
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 254 of file xpress_interface.cc.
|
inlineexplicit |
Definition at line 256 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 262 of file xpress_interface.cc.
|
inline |
Definition at line 257 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 268 of file xpress_interface.cc.