Initializing help system before first use

XPRBsetvartype

XPRBsetvartype


Purpose
Set the variable type.
Synopsis
int XPRBsetvartype(XPRBvar var, int type);
Arguments
var 
BCL reference to a variable.
type 
The variable type, which is one of:
XPRB_PL 
continuous;
XPRB_BV 
binary;
XPRB_UI 
general integer;
XPRB_PI 
partial integer;
XPRB_SC 
semi-continuous;
XPRB_SI 
semi-continuous integer.
Return value
0 if function executed successfully, 1 otherwise.
Example
The following code changes the type of variable x1 from integer to binary, and consequently reducing the upper bound to 1.
XPRBprob prob;
XPRBvar x1;
 ...
x1 = XPRBnewvar(prob, XPRB_UI, "abc3", 0, 100);
XPRBsetvartype(x1, XPRB_BV);
Further information
This function changes the type of a variable that has been created previously.
Related topics