12.07.2015 Views

ILOG OPL Development Studio Language Reference Manual

ILOG OPL Development Studio Language Reference Manual

ILOG OPL Development Studio Language Reference Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

{forall(i in 1..8)forall(j in 1..8: i < j)a[i][j] >= 0;}the constraint a[i][j] >= 0 is modeled for all i and j such that 1 i < j 8.Several parameters can often be combined together to produce more compact statements. Forinstance, the declarationint s = sum(i,j in 1..n: i < j) i*j;is equivalent toint s = sum(i in 1..n) sum(j in 1..n: i < j) i*j;which is less readable.The declarationint s = sum(i in 1..n, j in 1..m) i*j;is equivalent toint s = sum(i in 1..n) sum(j in 1..m) i*j;These parameters can, of course, be subject to filtering conditions. The excerptforall(i,j in 1..n : i < j)a[i][j] >= 0;is equivalent toforall(i in 1..n, j in 1..n : i= 0;Here is an even more compact form:forall(ordered i,j in 1..n)a[i][j] >= 0;Indeed, in many applications one is interested, given a set S, in stating filters or conditionsover all pairs (i, j) of elements of S satisfying i < j in the ordering associated with S. In thisexcerptI L O G O P L D E V E L O P M E N T S T U D I O L A N G U A G ER E F E R E N C E M A N U A L135

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!