Finding Length of Set

123 views
Skip to first unread message

Crystal

unread,
May 25, 2012, 3:24:15 AM5/25/12
to gamsworld
How do I find length of a set?
For example:

Set
itemList 'Elements in the set' /n5 * n23/

Parameter
tot 'Total elements in the list'


tot = card(itemList)


What's wrong with this statement? Is there another command to find the
length of a set? Does anyone who a link to list of GAMS common
commands?

thanks.

Renger van Nieuwkoop

unread,
May 25, 2012, 3:36:14 AM5/25/12
to gams...@googlegroups.com
Hi Crystal
Nothing is wrong, except that you have forgotten semicolons at the end of the statements
Renger

Set
itemList 'Elements in the set' /n5 * n23/;

Parameter
tot 'Total elements in the list';

tot = card(itemList);
display tot;
--
You received this message because you are subscribed to the Google Groups "gamsworld" group.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Reply all
Reply to author
Forward
0 new messages