NO FRAMES

Class IloNumArray

Definition file: ilconcert/iloenv.h
IloNumArray is the array class of the basic floating-point class.

For each basic type, Concert Technology defines a corresponding array class. IloNumArray is the array class of the basic floating-point class (IloNum) for a model.

Instances of IloNumArray 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.

IloNumArray inherits additional methods from the template IloArray:

See Also:

Constructor Summary
public IloNumArray(IloArrayI * i=0)
public IloNumArray(const IloNumArray & cpy)
public IloNumArray(const IloEnv env, IloInt n=0)
public IloNumArray(const IloEnv env, IloInt n, IloNum f0, IloNum f1, ...)
Method Summary
public IloBoolcontains(IloNum value) const
public IloNum &operator[](IloInt i)
public const IloNum &operator[](IloInt i) const
public IloNumExprArgoperator[](IloIntExprArg intExp) const
public IloIntArraytoIntArray() const
Constructor Detail

IloNumArray

public IloNumArray(IloArrayI * i=0)

This constructor creates an empty array of floating-point numbers for use in a model. You cannot create instances of the undocumented class IloDefaultArrayI. As an argument in this default constructor, it allows you to pass 0 (zero) as a value to an optional argument in functions and member functions that accept an array as an argument.


IloNumArray

public IloNumArray(const IloNumArray & cpy)

This copy constructor creates a handle to the array of floating-point objects specified by cpy.


IloNumArray

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

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


IloNumArray

public IloNumArray(const IloEnv env, IloInt n, IloNum f0, IloNum f1, ...)

This constructor creates an array of n floating-point objects for use in a model.


Method Detail

contains

public IloBool contains(IloNum value) const

This member function checks whether the value is contained or not.


operator[]

public IloNum & operator[](IloInt i)

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


operator[]

public const IloNum & operator[](IloInt i) const

This operator returns a reference to the object located in the invoking array at the position specified by the index i. On const arrays, Concert Technology uses the const operator:

 IloArray operator[] (IloInt i) const;
 

operator[]

public IloNumExprArg operator[](IloIntExprArg intExp) const

This subscripting operator returns an expression node for use in a constraint or expression. For clarity, let's call A the invoking array. When intExp is bound to the value i, then 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 intExp.

This operator is also known as an element constraint.


toIntArray

public IloIntArray toIntArray() const

This member function copies the invoking numeric array to a new instance of IloIntArray, checking the type of the values during the copy.