NO FRAMES

Class IloIntArray

Definition file: ilconcert/iloenv.h

IloIntArray is the array class of the basic integer class for a model. It is a handle class. The implementation class for IloIntArray is the undocumented class IloIntArrayI.

Instances of IloIntArray are extensible. (They differ from instances of IlcIntArray in this respect.) References to an array change whenever an element is added to or removed from the array.

For each basic type, Concert Technology defines a corresponding array class. That array class is a handle class. In other words, an object of that class contains a pointer to another object allocated in a Concert Technology environment associated with a model. Exploiting handles in this way greatly simplifies the programming interface since the handle can then be an automatic object: as a developer using handles, you do not have to worry about memory allocation.

As handles, these objects should be passed by value, and they should be created as automatic objects, where “automatic” has the usual C++ meaning.

Member functions of a handle class correspond to member functions of the same name in the implementation class.

Assert and NDEBUG

Most member functions of the class IloIntArray are inline functions that contain an assert statement. This statement checks that the handle pointer is non-null. These statements can be suppressed by the macro NDEBUG. This option usually reduces execution time. The price you pay for this choice is that attempts to access through null pointers are not trapped and usually result in memory faults.

See Also:

Constructor Summary
public IloIntArray(IloArrayI *)
public IloIntArray(const IloEnv, IloInt)
public IloIntArray(const IloEnv, IloInt, IloInt, IloInt v1...)
Method Summary
public IloNumArraytoNumArray()
Constructor Detail

IloIntArray

public IloIntArray(IloArrayI * i)

This constructor creates an array of integers from an implementation object.


IloIntArray

public IloIntArray(const IloEnv env, IloInt n)

This constructor creates an array of n integers for use in a model in the environment indicated by env. By default, its elements are empty handles.


IloIntArray

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

This constructor creates an array of n integers; the elements of the new array take the corresponding values: v0, v1, ..., v(n-1).


Method Detail

toNumArray

public IloNumArray toNumArray()

This constructor creates an array of integers from an array of numeric values.