XPRS_msp_setcbmsghandler
XPRS_msp_setcbmsghandler |
Purpose
Declares an output callback function, called every time a line of message text is output by a MIP solution pool object.
Synopsis
int XPRS_CC XPRS_msp_setcbmsghandler(XPRSmipsolpool msp, int (XPRS_CC *f_msghandler)(XPRSobject vXPRSObject, void * vUserContext, void * vSystemThreadId, const char * sMsg, int iMsgType, int iMsgCode), void * p)
Arguments
msp
|
The current MIP solution pool.
|
||||||||
f_msghandler
|
The callback function which takes six arguments,
vXPRSObject,
vUserContext,
vSystemThreadId,
sMsg,
iMsgType and
iMsgCode. Use a NULL value to cancel a callback function.
|
||||||||
vXPRSObject
|
A generic pointer to the msp object sending the message.
|
||||||||
vUserContext
|
The user-defined object passed to the callback function.
|
||||||||
vSystemThreadId
|
The system id of the thread sending the message caste to a void *.
|
||||||||
sMsg
|
A null terminated character array (string) containing the message, which may simply be a new line. When the callback is called for the first time sMsg will be a NULL pointer.
|
||||||||
iMsgType
|
Indicates the type of output message:
A negative value means the callback is being called for the first time.
|
||||||||
iMsgCode
|
The code associated with the message. If the message is an error or a warning then you can look up the code in Chapter
9 of the Optimizer Reference Manual for advice on what it means and how to resolve the associated issue.
|
||||||||
p
|
A user-defined object to be passed to the callback function.
|
Further information
1. To send all messages to a log file the built in message handler
XPRSlogfilehandler can be used. This can be done with:
XPRS_msp_setcbmsghandler(msp, XPRSlogfilehandler, "log.txt");
2. The return value for this callback is ignored.
Related topics
None.