TRY NOW!
AMPL > >Displays and Results > >Why can’t I view an indexed collection of subsets by typing display {k in SS} POW[k]?

The display command does not currently recognize {k in SS} POW[k] where POW is an indexed (subscripted) set. For this elementary case, you can exhibit the whole indexed collection of subsets by giving just the name of the collection:

display POW;

You can also exhibit each of the indexed sets separately, by using the iterated form of the display command; it resembles the ordinary form, but with a colon after the index set:

display {k in SS}: POW[k];

This gives the same output as if you had typed a separate statement display POW[k] for each member k of SS. Any set expression (or list of expressions) may follow the colon.

Posted in: Displays and Results