The OPTMODEL Procedure

SETOF Aggregation Expression

SETOF{ index-set } expression

The SETOF aggregation operator evaluates the expression expression for each member of the index set index-set. The result is the set that is formed by collecting the values returned by the operand expression. The operand can be a tuple expression. For example, the following code produces a set of tuples of numbers with their squared and cubed values:

    proc optmodel;
       put (setof{i in 1..3}<i, i*i, i**3>);
 

Output 6.31 shows the displayed output.

                                                                                
                                                                                 
                                                                                 
 {<1,1,1>,<2,4,8>,<3,9,27>}                                                      
 


Figure 6.31: SETOF Aggregation Expression Output

Previous Page | Next Page | Top of Page