Hello Andrew,

>> >> I would appreciate if a function to sort sets could be provided in
>> GMPL.
>> I have implemented the possibility to sort sets in GLPK.
>> The syntax I have chosen is to add a keyword "sorted" to domains:
>> set B, dimen 2 := setof{sorted (i,j) in A} (i,j);

It would be better if not only the indexing set of a domain operation could
be sorted but also the result set:
set B := setof{(i,j) in A} sorted (x[i],x[j]);

Both sorting orders (by index, by resultset) are useful.

I just implemented this as a further value "sortresult" in struct DOMAIN,
which I evaluate for O_SETOF in function eval_elemset(). A call to newly
introduced sort_elemset() does the job.

Best regards

Xypron
-- 
View this message in context: 
http://www.nabble.com/Ordered-sets-in-GMPL-tp21102805p21156865.html
Sent from the Gnu - GLPK - Help mailing list archive at Nabble.com.



_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to