Callbacks
It is good practice to set up at least a message callback, so that any messages produced by the system appear on the screen or in a file. The XSLPsetcbmessage function sets both the Xpress NonLinear and Xpress Optimizer callbacks, so that all messages appear in the same place.
XSLPsetcbmessage(sprob, XSLPMessage, NULL); |
void XPRS_CC XSLPMessage(XSLPprob my_prob, void *my_object, char *msg, int len, int msg_type) { switch (msg_type) { case 4: /* error */ case 3: /* warning */ case 2: /* dialogue */ case 1: /* information */ printf("%s\n", msg); break; default: /* exiting */ fflush(stdout); break; } }
This is a simple callback routine, which prints any message to standard output.