Purpose
Create a one-dimensional array of variables.
Synopsis
XPRBarrvar XPRBnewarrvar(XPRBprob prob, int nbvar, int type,
const char *name, double bdl, double bdu);
Arguments
prob
|
Reference to a problem.
|
nbvar
|
Size of the array of variables.
|
type
|
Type of the variables, which may be one of:
XPRB_PL
|
|
XPRB_BV
|
|
XPRB_UI
|
|
XPRB_PI
|
|
XPRB_SC
|
|
XPRB_SI
|
|
|
name
|
The array name. May be NULL if not required.
|
bdl
|
Variable lower bound.
|
bdu
|
Variable upper bound.
|
Return value
Reference to the new array of variables if function executed successfully, NULL otherwise.
Example
The following defines an array of ten continuous variables between 0 and 500, with names beginning arry1 followed by a counter.
XPRBprob prob;
XPRBarrvar ty1;
...
ty1 = XPRBnewarrvar(prob, 10, XPRB_PL, "arry1", 0, 500);
Further information
1. This function creates a single-indexed array of variables. Individual bounds on variables may be changed afterwards using
XPRBsetlb and
XPRBsetub, and variable types by using
XPRBsetvartype. The function returns the BCL reference to the array of variables. If
name is defined, BCL generates names for the variables in the array by adding an index to the string. If no array name is given,
BCL generates a default name starting with
AV.
2. Either of the bounds XPRB_INFINITY or -XPRB_INFINITY for plus or minus infinity may be used for the arguments bdu and bdl.
Related topics
If you have any comments or suggestions about these pages,
please send mail to docs@dashoptimization.com.