NO FRAMES

Class IloNumVarArray

Definition file: ilconcert/iloexpression.h
The array class of IloNumVar.

For each basic type, Concert Technology defines a corresponding array class. IloNumVarArray is the array class of the numeric variable class for a model.

Instances of IloNumVarArray are extensible. That is, you can add more elements to such an array. References to an array change whenever an element is added to or removed from the array.

Most member functions in this class contain assert statements. For an explanation of the macro NDEBUG (a way to turn on or turn off these assert statements), see the concept Assert and NDEBUG.

See Also:

Constructor Summary
public IloNumVarArray(IloDefaultArrayI * i=0)
public IloNumVarArray(const IloEnv env, IloInt n=0)
public IloNumVarArray(const IloEnv env, const IloNumArray lb, const IloNumArray ub, IloNumVar::Type type=ILOFLOAT)
public IloNumVarArray(const IloEnv env, IloNum lb, const IloNumArray ub, IloNumVar::Type type=ILOFLOAT)
public IloNumVarArray(const IloEnv env, const IloNumArray lb, IloNum ub, IloNumVar::Type type=ILOFLOAT)
public IloNumVarArray(const IloEnv env, IloInt n, IloNum lb, IloNum ub, IloNumVar::Type type=ILOFLOAT)
public IloNumVarArray(const IloEnv env, const IloNumColumnArray columnarray, IloNumVar::Type type=ILOFLOAT)
public IloNumVarArray(const IloEnv env, const IloNumColumnArray columnarray, const IloNumArray lb, const IloNumArray ub, IloNumVar::Type type=ILOFLOAT)
Method Summary
public voidadd(IloInt more, const IloNumVar x)
public voidadd(const IloNumVar x)
public voidadd(const IloNumVarArray array)
public voidendElements()
public IloNumExprArgoperator[](IloIntExprArg anIntegerExpr) const
public voidsetBounds(const IloNumArray lb, const IloNumArray ub)
public IloIntExprArraytoIntExprArray() const
public IloIntVarArraytoIntVarArray() const
public IloNumExprArraytoNumExprArray() const
Inherited Methods from IloNumExprArray
add, add, add, endElements, operator[]
Inherited Methods from IloExtractableArray
add, add, add, endElements, setNames
Constructor Detail

IloNumVarArray

public IloNumVarArray(IloDefaultArrayI * i=0)

This constructor creates an empty extensible array of numeric variables. You cannot create instances of the undocumented class IloDefaultArrayI. As an argument in this default constructor, it allows you to pass 0 (zero) optionally or to use 0 (zero) as a default value of an argument in a constructor.


IloNumVarArray

public IloNumVarArray(const IloEnv env, IloInt n=0)

This constructor creates an extensible array of n numeric variables in env. Initially, the n elements are empty handles.


IloNumVarArray

public IloNumVarArray(const IloEnv env, const IloNumArray lb, const IloNumArray ub, IloNumVar::Type type=ILOFLOAT)

This constructor creates an extensible array of numeric variables in env with lower and upper bounds and type as specified. The instances of IloNumVar to fill this array are constructed at the same time. The length of the array lb must be the same as the length of the array ub. In other words, lb.getSize == ub.getSize. This constructor will construct an array with the number of elements in the array ub.


IloNumVarArray

public IloNumVarArray(const IloEnv env, IloNum lb, const IloNumArray ub, IloNumVar::Type type=ILOFLOAT)

This constructor creates an extensible array of numeric variables in env with lower and upper bounds and type as specified. The instances of IloNumVar to fill this array are constructed at the same time. The length of the new array will be the same as the length of the array ub.


IloNumVarArray

public IloNumVarArray(const IloEnv env, const IloNumArray lb, IloNum ub, IloNumVar::Type type=ILOFLOAT)

This constructor creates an extensible array of numeric variables in env with lower and upper bounds and type as specified. The instances of IloNumVar to fill this array are constructed at the same time.


IloNumVarArray

public IloNumVarArray(const IloEnv env, IloInt n, IloNum lb, IloNum ub, IloNumVar::Type type=ILOFLOAT)

This constructor creates an extensible array of n numeric variables in env with lower and upper bounds and type as specified. The instances of IloNumVar to fill this array are constructed at the same time.


IloNumVarArray

public IloNumVarArray(const IloEnv env, const IloNumColumnArray columnarray, IloNumVar::Type type=ILOFLOAT)

This constructor creates an extensible array of numeric variables with type as specified. The instances of IloNumVar to fill this array are constructed at the same time.


IloNumVarArray

public IloNumVarArray(const IloEnv env, const IloNumColumnArray columnarray, const IloNumArray lb, const IloNumArray ub, IloNumVar::Type type=ILOFLOAT)

This constructor creates an extensible array of numeric variables with lower and upper bounds and type as specified. The instances of IloNumVar to fill this array are constructed at the same time.


Method Detail

add

public void add(IloInt more, const IloNumVar x)

This member function appends x to the invoking array multiple times. The argument more specifies how many times.


add

public void add(const IloNumVar x)

This member function appends x to the invoking array.


add

public void add(const IloNumVarArray array)

This member function appends the elements in array to the invoking array.


endElements

public void endElements()

This member function calls IloExtractable::end for each of the elements in the invoking array. This deletes all the extractables identified by the array, leaving the handles in the array intact. This member function is the recommended way to delete the elements of an array.


operator[]

public IloNumExprArg operator[](IloIntExprArg anIntegerExpr) const

This subscripting operator returns an expression argument for use in a constraint or expression. For clarity, let's call A the invoking array. When anIntegerExpr is bound to the value i, the domain of the expression is the domain of A[i]. More generally, the domain of the expression is the union of the domains of the expressions A[i] where the i are in the domain of anIntegerExpr.

This operator is also known as an element constraint.


setBounds

public void setBounds(const IloNumArray lb, const IloNumArray ub)

For each element in the invoking array, this member function sets lb as the lower bound and ub as the upper bound of the corresponding numeric variable in the invoking array.

Note
The member function setBounds notifies Concert Technology algorithms about this change of bounds in this array of numeric variables.

toIntExprArray

public IloIntExprArray toIntExprArray() const

This member function copies the invoking array to a new IloIntExprArray, checking the type of the variables during the copy.


toIntVarArray

public IloIntVarArray toIntVarArray() const

This member function copies the invoking array to a new IloIntVarArray, checking the type of the variables during the copy.


toNumExprArray

public IloNumExprArray toNumExprArray() const

This member function copies the invoking array to a new IloNumExprArray, checking the type of the variables during the copy.