Overview | Group | Tree | Graph | Deprecated | Index | Concepts |
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 not 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.
IloIntArray
inherits additional methods from the template
IloArray
:
See Also:
Method Summary | |
---|---|
public IloBool | contains(IloIntArray ax) const |
public IloBool | contains(IloInt value) const |
public void | discard(IloIntArray ax) |
public void | discard(IloInt value) |
public | IloIntArray(IloArrayI * i=0) |
public | IloIntArray(const IloEnv env, IloInt n=0) |
public | IloIntArray(const IloEnv env, IloInt n, IloInt v0, IloInt v1...) |
public IloIntExprArg | operator[](IloIntExprArg intExp) const |
public IloInt & | operator[](IloInt i) |
public const IloInt & | operator[](IloInt i) const |
public IloNumArray | toNumArray() const |
Method Detail |
---|
This constructor creates an array of integers from an implementation object.
This constructor creates an array of n
integers for use in a
model in the environment specified by env
. By default, its
elements are empty handles.
This constructor creates an array of n
integers; the
elements of the new array take the corresponding values: v0, v1, ...,
v(n-1)
.
This member function checks whether all the values of ax
are contained or not.
This member function checks whether the value is contained or not.
This member function removes elements from the invoking array. It
removes the array ax
.
This member function removes elements from the invoking array. It removes the element.
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 expression.
This operator returns a reference to the object
located in the invoking array at the position
specified by the index i
.
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;
This constructor creates an array of integers from an array of numeric values.