XPRBsetvartype
XPRBsetvartype |
Purpose
Synopsis
int XPRBsetvartype(XPRBvar var, int type);
Arguments
var
|
BCL reference to a variable.
|
||||||||||||
type
|
The variable type, which is one of:
|
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