XSLPsetcbprenode
PurposeSet a user callback to be called during MISLP after the set-up of the SLP problem to be solved at a node, but before SLP optimizationSynopsisint XPRS_CC XSLPsetcbprenode(XSLPprob Prob, int (XPRS_CC *UserFunc) (XSLPprob myProb, void *myObject, int *feas), void *Object);Arguments
Prob The current SLP problem. UserFunc The function to be called after the set-up of the SLP problem to be solved at a node. UserFunc returns an integer value. If the return value is nonzero, or if the feasibility flag is set nonzero, then further processing of the node will be terminated (it is declared infeasible). myProb The problem passed to the callback function. myObject The user-defined object passed as Object to XSLPsetcbprenode. feas Address of an integer containing the feasibility flag. If UserFunc sets the flag nonzero, the node is declared infeasible. Object Address of a user-defined object, which can be used for any purpose by the function. Object is passed to UserFunc as myObject.ExampleThe following example sets up a callback function to be executed at each node before the SLP optimization starts. The array IntList contains a list of integer variables, and the function prints the bounds on these variables.int *IntList; XSLPsetcbprenode(Prob, CBPreNode, IntList);A suitable callback function might resemble the following:int XPRS_CC CBPreNode(XSLPprob myProb, void *Obj, int *feas) { XPRSprob xprob; int i, *IntList; double LO, UP; IntList = (int *) Obj; XSLPgetptrattrib(myProb, XSLP_XPRSPROBLEM, &xprob); for (i=0; IntList[i]>=0; i++) { XPRSgetlb(xprob,&LO,IntList[i],IntList[i]); XPRSgetub(xprob,&UP,IntList[i],IntList[i]); if (LO > 0 || UP < XPRS_PLUSINFINITY) printf("\nCol %d: %lg <= %lg",LO,UP); } return 0; }Further informationIf a node can be identified as infeasible by the callback function, then the initial optimization at the current node is avoided, as well as further exploration of the node.
This callback must be used in place of XPRSsetcbprenode when optimizing with MISLP.
When used with VB, the callback function has the prototype:Public Function mycbfunc (ByVal prob As Long, ByVal object As Long) As LongRelated topics
If you have any comments or suggestions about these pages, please send mail to docs@dashoptimization.com.