help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] pick element from set?


From: Kevin Hunter
Subject: [Help-glpk] pick element from set?
Date: Sun, 01 Jul 2012 03:11:00 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

Hello GLPK List,

Is there a method to pick an arbitrary single item from a set? I don't care which one, but I need to have a single element from a set such that I can uniquely and consistently identify it.

There is no order to the set, but /if/ there were an ordering to this set, I might reference this element as "nought". Put differently, say I have a set X:

set X, dimen 2 := {(5, 7), (1, 10), (23, -3), ("y", "x"), ("a", "abc")};

Is there functionality -- say a function called "pick()" -- to pick an arbitrary element from that set?

Put another way, /if/ I could put that set into a list:

list(X) == [(5, 7), (1, 10), (23, -3), ("y", "x"), ("a", "abc")]

then I could get an arbitrary element, perhaps like 'get(list(X), 0)'.

Is there a method to grab a single element from the set?

I'll point out that I have an ad-hoc method of this for a single-dimensional set (using a nested setof structure and a comparison operator), but can't do it for any higher-dimensionality sets.

Thanks,

Kevin



reply via email to

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