NO FRAMES

Class IloAnyVarArray

Definition file: ilconcert/iloany.h
A class to represent an array of enumerated variables.

For each basic type, Concert Technology defines a corresponding array class. IloAnyVarArray is the array class of the enumerated variable class (IloAnyVar) for a model. The parent class for IloAnyVarArray is the class IloExtractableArray.

Instances of IloAnyVarArray are extensible. That is, you can add more elements to such an array. References to an array change whenever an element is added 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 IloAnyVarArray(IloDefaultArrayI *)
public IloAnyVarArray(const IloEnv, IloInt)
public IloAnyVarArray(const IloEnv, IloInt, const IloAnyVar, const IloAnyVar v1...)
Method Summary
public voidadd(IloInt, const IloAnyVar)
public voidadd(const IloAnyVar)
public voidadd(const IloAnyVarArray)
public IloAnyVaroperator[](IloInt)
public IloAnyVar &operator[](IloInt)
Inherited Methods from IloExtractableArray
add, add, add, endElements
Constructor Detail

IloAnyVarArray

public IloAnyVarArray(IloDefaultArrayI * i)

This constructor creates an empty extensible array of enumerated variables. You cannot create instances of the undocumented class IloDefaultArrayI. As a parameter in this default constructor, it allows you to pass 0 (zero) as a value to an optional parameter in functions and member functions that accept an array as a parameter.


IloAnyVarArray

public IloAnyVarArray(const IloEnv env, IloInt n)

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


IloAnyVarArray

public IloAnyVarArray(const IloEnv env, IloInt n, const IloAnyVar v0, const IloAnyVar v1... )

This constructor creates an extensible array of n enumerated variables, as indicated by v0, v1, etc.


Method Detail

add

public void add(IloInt more, const IloAnyVar x)

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


add

public void add(const IloAnyVar x)

This member function appends x to the invoking array.


add

public void add(const IloAnyVarArray array)

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


operator[]

public IloAnyVar operator[](IloInt i)

This operator returns a reference to the object located in the invoking array at the position indicated by the index i. Concert Technology uses the const operator

IloAnyVar operator[] (IloInt i) const;

on const arrays.


operator[]

public IloAnyVar & operator[](IloInt i)

This operator returns a reference to the object located in the invoking array at the position indicated by the index i.