Overview | Group | Tree | Graph | Deprecated | Index | Concepts |
An instance of this class is an array of extractable objects
(instances of the class
IloExtractable
or its subclasses).
Instances of IloExtractableArray
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.
IloExtractableArray
inherits additional methods from the template
IloArray
:
IloArray::add
IloArray::add
IloArray::add
IloArray::clear
IloArray::getEnv
IloArray::getSize
IloArray::remove
IloArray::operator[]
IloArray::operator[]
For information on arrays, see the concept Arrays
See Also:
IloArray, IloExtractable, operator<<
Method Summary | |
---|---|
public void | add(IloInt more, const IloExtractable x) |
public void | add(const IloExtractable x) |
public void | add(const IloExtractableArray x) |
public void | endElements() |
public | IloExtractableArray(IloDefaultArrayI * i=0) |
public | IloExtractableArray(const IloExtractableArray & r) |
public | IloExtractableArray(const IloEnv env, IloInt n=0) |
public void | removeFromAll() |
public void | setNames(const char * name) |
Method Detail |
---|
This constructor creates an empty array of elements.
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.
This copy constructor creates a handle
to the array of extractable objects specified
by r
.
This constructor creates an array of n
elements, each of which is an
empty handle.
This member function appends x
to the invoking array multiple times.
The argument more
specifies how many times.
This member function appends x
to the invoking array.
This member function appends the elements in the arrayx
to
the invoking array.
This member function calls IloExtractable::end
for
each of the elements in the invoking array. This deletes all the extractables
identified by the array.
It also calls IloArray::clear
.
The array must not contain any duplicates since that will result in
double deletions.
This member function is
the recommended way to delete the elements of an array.
This member function removes the
invoking array of extractable objects
from all other extractable objects where they are used. However,
unlike the member function end
, the member function
removeFromAll
does not destroy the invoking objects.
That is, the invoking extractable objects remain available for
later re-use in the model.
This member function sets the name of each element
of the invoking array.
Each name is created by suffixing name
with (n),
where n
is the index of the extractable in the array.
For example, if the array contains the three extractables
x
, y
, and z
, and the name specified
is var, x
is then named var(0),
y
is then named var(1),
and z
is named var(2).
All elements must be different. Otherwise, this method raises an error.
It is more efficient to set the names of all elements at once as an array, rather than in a loop setting each name one by one. Set the name of an extractable object before the extraction of that object.