Skip to main content
PREV CLASS NEXT CLASS FRAMES NO FRAMES

 

Class IloMap

IloMap
Example:
int a[i in 1..5]=i;

dvar int x[2..6];

subject to
{
 forall(i in 2..6) ct:x[i]==a[i-1];
}

execute {
  writeln(a);
  a[2]=10;
  writeln(a);
  for(var i in a) write(i);
  writeln();
  writeln("constraint");
  for(i in ct) write(i);
  writeln();
}
Output:
[1 2 3 4 5]
[1 10 3 4 5]
12345
constraint
23456
Iterating properties:
Iterates on the items of its indexer.
Index resolution:
Returns the item with the given index. For multidimensional arrays, the returned item is itself an array.
OPL type:
int A[]
float A[]
string A[]
T A[], where T is a declared tuple type
{int} A[]
{float} A[]
{string} A[]
{T} A[], where T is a declared tuple type
dvar int A[]
dvar int+ A[]
dvar float A[]
dvar float+ A[]
dvar boolean A[]
constraint A[]
And corresponding multidimensional arrays, having items of array type.

Property Summary
Field Attributes Field Name and Description
all
Gets the indexer collection of the array.
all
Gets the size of the array, which is the size of its indexer collection.
postprocessing
For an array of decision variables, returns the array of values in the current solution.
Method Summary
Method Attributes Method Name and Description
all
end()
Releases the memory used by this object.
Property Detail
indexer
{IloDiscreteDataCollection} indexer
Gets the indexer collection of the array. If the array is multidimensional, indexer returns only the first dimension part.
Available for:
all

size
{int} size
Gets the size of the array, which is the size of its indexer collection. If the array is multidimensional, size returns only the first dimension part.
Available for:
all

solutionValue
{IloMap} solutionValue
For an array of decision variables, returns the array of values in the current solution.
Available for:
postprocessing
Method Detail
end
end()
Releases the memory used by this object. The object then becomes unavailable for further usage.
Available for:
all

©Copyright IBM Corp. 1987-2011.