Initializing help system before first use

XPRBsetsosdir

XPRBsetsosdir


Purpose
Set a branching directive for a SOS.
Synopsis
int XPRBsetsosdir(XPRBsos sos, int type, double val);
Arguments
sos 
Reference to a previously created SOS.
type 
The directive type, which must be one of:
XPRB_PR 
priority;
XPRB_UP 
first branch upwards;
XPRB_DN 
first branch downwards;
XPRB_PU 
pseudo cost on branching upwards;
XPRB_PD 
pseudo cost on branching downwards.
val 
An argument dependent on the type of the directive being defined. If type is:
XPRB_PR 
val will be the priority value, an integer between 1 (highest) and 1000 (lowest), the default;
XPRB_UP 
no input is required — choose any value, e.g. 0;
XPRB_DN 
no input is required — choose any value, e.g. 0;
XPRB_PU 
val will be the value of the pseudo cost for the upward branch;
XPRB_PD 
val will be the value of the pseudo cost for the downward branch.
Return value
0 if function executed successfully, 1 otherwise.
Example
XPRBprob prob;
XPRBsos set1;
   ...
set1 = XPRBnewsos(prob, "sos1", XPRB_S1);
XPRBsetsosdir(set1, 5);
XPRBsetsosdir(set1, XPRB_DN, 0);
This gives a priority of 5 to the SOS set1 and sets branching downwards as the preferred direction for set1.
Further information
This function sets any type of branching directive available in Xpress. This may be a priority for branching on a SOS (type XPRB_PR), the preferred branching direction (types XPRB_UP, XPRB_DN) or the estimated cost incurred when branching on a SOS (types XPRB_PU, XPRB_PD). Several directives of different types may be set for a single set. Function XPRBsetvardir may be used to set a directive for a variable.
Related topics