Initializing help system before first use

XPRBnewarrvar

XPRBnewarrvar


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 
continuous;
XPRB_BV 
binary;
XPRB_UI 
general integer;
XPRB_PI 
partial integer;
XPRB_SC 
semi-continuous;
XPRB_SI 
semi-continuous integer.
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. (The generation of unique names will only take place if the names dictionary is enabled, see XPRBsetdictionarysize.)
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