Difference: SetsInAMPL (11 vs. 12)

Revision 122009-10-09 - MichaelOSullivan

Line: 1 to 1
 
META TOPICPARENT name="AMPLSyntax"
<-- Ready to Review - done - Lauren-->

Sets in AMPL

Line: 152 to 152
 set MONTHS ordered;
Changed:
<
<
AMPL will puts the elements in this set in the order they appear in the data file (or let statement). AMPL also understands the following operations for ordered sets:
>
>
AMPL will put the elements in this set in the order they appear in the data file (or let statement). AMPL also understands the following operations for ordered sets:
 
ord(e, ORD_SET)   # The position of e in ORD_SET

Line: 194 to 194
 

Set Membership and Subsets

Changed:
<
<
We have seen how loop over a set using the in keyword. This keyword also provides a logical check if an element is in a set, e.g., (m, n) in ARCS is true if the pair (m, n) is in the set ARCS and false otherwise. We may restrict a set to be a subset of an existing set by using the keyword {\tt within}, e. g.,
>
>
We have seen how to loop over a set using the in keyword. This keyword also provides a logical check if an element is in a set, e.g., (m, n) in ARCS is true if the pair (m, n) is in the set ARCS and false otherwise. We may restrict a set to be a subset of an existing set by using the keyword within, e. g.,
 
set ARCS within NODES cross NODES;
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback