help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] pick element from set?


From: Kevin Hunter
Subject: Re: [Help-glpk] pick element from set?
Date: Mon, 02 Jul 2012 05:34:38 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

At 1:42am -0400 Mon, 02 Jul 2012, Glpk Xypron wrote:
there is no function that will return an element of a set (except for
one-dimensional numeric sets).

You can create subsets.

set X, dimen 2 := {(5, 7), (1, 10), (23, -3), ("y", "x"), ("a", "abc")};
set S := setof{(i,j) in X : forall{(k,l) in X} i <=k && j <= l} (i,j);

It is so very helpful to be answered in context of my question. Thank you! I have been doing a variant of this, but again, your's is much cleaner. Thank you for the snippet.

Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]