[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Ordered sets in GMPL
From: |
xypron |
Subject: |
Re: [Help-glpk] Ordered sets in GMPL |
Date: |
Wed, 24 Dec 2008 06:41:20 -0800 (PST) |
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.