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 *)
public IloNumVarArray(const IloEnv, IloInt)
public IloNumVarArray(const IloEnv, const IloNumArray, const IloNumArray, IloNumVar::Type)
public IloNumVarArray(const IloEnv, IloNum, const IloNumArray, IloNumVar::Type)
public IloNumVarArray(const IloEnv, const IloNumArray, IloNum, IloNumVar::Type)
public IloNumVarArray(const IloEnv, IloInt, IloNum, IloNum, IloNumVar::Type)
public IloNumVarArray(const IloEnv, const IloNumColumnArray, IloNumVar::Type)
public IloNumVarArray(const IloEnv, const IloNumColumnArray, const IloNumArray, const IloNumArray, IloNumVar::Type)
Method Summary
public voidadd(IloInt, const IloNumVar)
public voidadd(const IloNumVar)
public voidadd(const IloNumVarArray)
public IloNumExprArgoperator()(IloNumExprArg)
public voidsetBounds(const IloNumArray, const IloNumArray)
public IloIntExprArraytoIntExprArray()
public IloIntVarArraytoIntVarArray()
public IloNumExprArraytoNumExprArray()
Inherited Methods from IloNumExprArray
add, add, add, operator()
Inherited Methods from IloExtractableArray
add, add, add, endElements
Constructor Detail

IloNumVarArray

public IloNumVarArray(IloDefaultArrayI * i)

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


IloNumVarArray

public IloNumVarArray(const IloEnv env, IloInt n)

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)

This constructor creates an extensible array of numeric variables in env with lower and upper bounds and type as indicated. 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)

This constructor creates an extensible array of numeric variables in env with lower and upper bounds and type as indicated. 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)

This constructor creates an extensible array of numeric variables in env with lower and upper bounds and type as indicated. 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)

This constructor creates an extensible array of n numeric variables in env with lower and upper bounds and type as indicated. 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)

This constructor creates an extensible array of numeric variables with type as indicated. 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)

This constructor creates an extensible array of numeric variables with lower and upper bounds and type as indicated. 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 parameter more indicates 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.


operator()

public IloNumExprArg operator()(IloNumExprArg anIntegerVariable)

This subscripting operator returns an expression argument for use in a constraint or expression. For clarity, let's call A the invoking array. When anIntegerVariable 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 anIntegerVariable.


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()

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


toIntVarArray

public IloIntVarArray toIntVarArray()

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


toNumExprArray

public IloNumExprArray toNumExprArray()

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