Purpose
Synopsis
int XPRBsetvartype(XPRBvar var, int type);
Arguments
var
|
BCL reference to a variable.
|
type
|
The variable type, which is one of:
XPRB_PL
|
|
XPRB_BV
|
|
XPRB_UI
|
|
XPRB_PI
|
|
XPRB_SC
|
|
XPRB_SI
|
|
|
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
If you have any comments or suggestions about these pages,
please send mail to docs@dashoptimization.com.