| Overview | Group | Tree | Graph | Deprecated | Index | Concepts |

IlcIntArray is the array class for the basic integer class.
It is a handle class.
See Also:
IlcIntExp, IlcIntSet, operator<<
| Method Summary | |
|---|---|
public IlcIntArrayI * | getImpl() const |
public IlcInt | getSize() const |
public | IlcIntArray(IlcInt * impl=0) |
public | IlcIntArray(IlcCPEngine solver, IlcInt size, IlcInt * values) |
public | IlcIntArray(IlcCPEngine solver, IlcInt size, IlcInt prototype=0) |
public | IlcIntArray(IlcCPEngine solver, IlcInt size, IlcInt exp0, IlcInt exp...) |
public IlcIntExp | operator[](const IlcIntExp rank) const |
public IlcInt & | operator[](IlcInt i) const |
| Method Detail |
|---|
This constructor creates a handle object from a pointer to an implementation object. If an implementation pointer is not given, an empty handle is created.
This constructor creates an array of integers containing the values in the array values. The
argument size must be the length of the array values; it must also be strictly
greater than 0 (zero). CP Optimizer does not keep a pointer to the array values.
Here is one way to create an array containing the integers 1, 3, 2.
IlcInt values [3]; values[0] = 1; values[1] = 3; values[2] = 2; IlcIntArray array1 (cp, 3, values);
This constructor creates an array of size elements. The
argument size must be strictly greater than 0 (zero). The
elements of this array are initialized to the value of
prototype.
This constructor accepts a variable number of arguments. Its second argument, size, indicates the length of the
array that this constructor will create; size must be the number of arguments minus one; it must also be
strictly greater than 0 (zero). The constructor creates an array of the values indicated by the other arguments.
Here is another way to create an array containing the integers 1,3,2.
IlcIntArray array2 (solver, 3, 1, 3, 2);
This member function returns a pointer to the implementation object of the invoking handle.
This member function returns the number of elements in the array.
This subscripting operator returns a constrained integer expression. For clarity, let's call A the
invoking array. When rank is fixed to the value i, the value of the expression is A[i].
More generally, the domain of the expression is the set of values A[i] where the i are in
the domain of rank.
This operator returns a reference to the element at rank i. This operator can be used for accessing (that is, simply
reading) the element or for modifying (that is, writing) it.
Here is still another way to create an array containing the integers 1, 3, 2.
IlcIntArray array5 (cp, 3); array5[0] = 1; array5[1] = 3; array5[2] = 2;