XPRSaddcbchgbranchobject
XPRSaddcbchgbranchobject |
Purpose
Declares a callback function that will be called after the selection of a global entity to branch on. This callback allows the user to inspect and replace the Optimizer's choice of how to branch the current node. This callback will also be called in the case when there are no candidates to branch on, that is, when all global entities are already satisfied. This callback function will be called in addition to any callbacks already added by XPRSaddcbchgbranchobject.
Synopsis
int XPRS_CC XPRSaddcbchgbranchobject(XPRSprob prob, void (XPRS_CC *f_chgbranchobject)(XPRSprob my_prob, void* my_object, XPRSbranchobject obranch, XPRSbranchobject* p_newobject), void* object, int priority);
Arguments
prob
|
The current problem.
|
f_chgbranchobject
|
The callback function, which takes four arguments:
my_prob,
my_object,
obranch and
p_newobject. This function is called every time the Optimizer has selected a candidate entity for branching.
|
my_prob
|
The problem passed to the callback function,
f_chgbranchobject.
|
my_object
|
The user defined object passed as
object when setting up the callback with
XPRSaddcbchgbranchobject.
|
obranch
|
The candidate branching object selected by the Optimizer. Will be
NULL if no candidates exist.
|
p_newobject
|
Optional new branching object to replace the Optimizer's selection. If
obranch or
NULL is passed back, no change will be applied.
|
object
|
A user-defined object to be passed to the callback function,
f_chgbranchobject.
|
priority
|
An integer that determines the order in which multiple callbacks of this type will be invoked. The callback added with a higher priority will be called before a callback with a lower priority. Set to 0 if not required.
|
Further information
1. The branching object given by the Optimizer provides a linear description of how the Optimizer intends to branch on the selected candidate. This will often be one of standard global entities of the current problem, but can also be e.g. a split disjunction or a structural branch, if those features are turned on.
2. The functions
XPRS_bo_getbranches,
XPRS_bo_getbounds and
XPRS_bo_getrows can be used to inspect the given branching object.
3. Refer to
XPRS_bo_create on how to create a new branching object to replace the Optimizer's selection. Note that the new branching object should be created with a priority value no higher than the current object to guarantee it will be used for branching.
Related topics