How to convert an array into a set in CPLEX?

170 Views Asked by At

Let's say that

int A=[1 2 3 4];

How to convert it into a Set?

{int} SetA =?
1

There are 1 best solutions below

0
On BEST ANSWER
 range r=1..4;
int A[r]=[1, 2 ,3 ,4];

{int} s={A[i] | i in r};

execute
{
  writeln(s);
}

gives

{1 2 3 4}