Initializing help system before first use

XPRBsetvardir

XPRBsetvardir


Purpose
Set a branching directive for a variable.
Synopsis
int XPRBsetvardir(XPRBvar var, int type, double c);
Arguments
var 
BCL reference to a variable.
type 
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.
An argument dependent on the type of directive to be defined. Must be one of:
XPRB_PR 
priority value — an integer between 1 (highest) and 1000 (least priority), the default;
XPRB_UP 
no input required — set to any value, e.g. 0;
XPRB_DN 
no input required — set to any value, e.g. 0;
XPRB_PU 
value of the pseudo cost on branching upwards;
XPRB_PD 
value of the pseudo cost on branching downwards.
Return value
0 if function executed successfully, 1 otherwise.
Example
The following example gives a priority of 10 to variable x1 and sets the preferred branching direction to be upwards.
XPRBprob prob;
XPRBvar x1;
 ...
x1 = XPRBnewvar(prob, XPRB_UI, "abc3", 0, 100);
XPRBsetvardir(x1, XPRB_PR, 10);
XPRBsetvardir(x1, XPRB_UP, 0);
Further information
1. This function sets any type of branching directive available in Xpress. This may be a priority for branching on a variable (type XPRB_PR), the preferred branching direction (types XPRB_UP, XPRB_DN) or the estimated cost incurred when branching on a variable (types XPRB_PU, XPRB_PD). Several directives of different types may be set for a single variable.
2. Note that it is only possibly to set branching directives for discrete variables (including semi-continuous and partial integer variables). Function XPRBsetsosdir may be used to set a directive for a SOS.
Related topics