XPRSsetcbgloballog


Purpose
Declares a global log callback function, called each time the global log is printed.
Synopsis
int XPRS_CC XPRSsetcbgloballog(XPRSprob prob, int (XPRS_CC *fugl)(XPRSprob my_prob, void *my_object), void *object);
Arguments
prob 
The current problem.
fugl 
The callback function which takes two arguments, my_prob and my_object, and has an integer return value. This function is called whenever the global log is printed as determined by the MIPLOG control.
my_prob 
The problem passed to the callback function, fugl.
my_object 
The user-defined object passed as object when setting up the callback with XPRSsetcbgloballog.
object 
A user-defined object to be passed to the callback function, fugl.
Related Controls
Integer
Global print flag.

Example
The following example prints at each node of the global search the node number and its depth:
XPRSsetintcontrol(prob, XPRS_MIPLOG, 3);
XPRSsetcbgloballog(prob, globalLog, NULL);
XPRSminim(prob,"g");
The callback function may resemble:
XPRS_CC int globalLog(XPRSprob prob, void *data)
{
  int nodes, nodedepth;

  XPRSgetintattrib(prob, XPRS_NODEDEPTH, &nodedepth);
  XPRSgetintattrib(prob, XPRS_NODES, &nodes);
  printf("Node %d with depth %d has just been processed\n", 
         nodes, nodedepth);

  return 0;
}
See the example depthfirst.c on the Xpress‑MP CD-ROM.
Further information
If the callback function returns a nonzero value, the global search will be interrupted.
Related topics
XPRSsetcbbarlog, XPRSsetcblplog, XPRSsetcbmessage.


If you have any comments or suggestions about these pages, please send mail to docs@dashoptimization.com.