Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.
Originally posted by: mikeab
Hi,
I'm trying to have a 2D array inside a tuple as below:
tuple m1{
int index ;
int m2[1..4][1..5];
}
It dosent let me to define the m2 inside the tuple. How can I do this ?
Thanks
Mike
indeed in documentation
IDE and OPL > Optimization Programming Language (OPL) > Language Reference Manual > OPL, the modeling language > Data types > Data structures
Data types not allowed in tuples Sets of tuples (instances of IloTupleSet) Arrays of strings, tuples, and tuple sets Multidimensional arrays
Data types not allowed in tuples
Sets of tuples (instances of IloTupleSet)
Arrays of strings, tuples, and tuple sets
Multidimensional arrays
So as a workaround you could try to turn your 2D array into 1D
regards
another workaround is to use a 2D array indexed by the tuple set, so it gets a 3D array:
tuple m1{ int index ; } {m1} s={<1>,<2>}; int m2[s][1..4][1..5];
int index ; }
{m1} s={<1>,<2>};
int m2[s][1..4][1..5];