Hello Kasper, > but if it's just the set containing the kth member of S, couldn't you > just say S[k] then instead of making a new set? unfortunately not, S cannot be accessed by an index.
Furthermore there is no function to return a single element of a set. If you look at the definition of ELEMSET in src/glpmpl.h you will see that elemental sets are stored as linked list. Hence access via a numeric index would cost O(n) time which is not efficient. In the follwing thread I suggested to provide a syntax extension http://lists.gnu.org/archive/html/help-glpk/2008-12/msg00109.html Best regards Xypron -------- Original-Nachricht -------- > Datum: Tue, 18 Oct 2011 11:08:59 +0200 > Betreff: Re: [Help-glpk] Subset > Hi Xypron > Thanks for the reply, it looks like something I can use. > I have a question though. I don't understand the set L (Set containing the > kth member of S), maybe it's because I don't understand the setof > operation, > but if it's just the set containing the kth member of S, couldn't you just > say S[k] then instead of making a new set? > I understand it like if I were to say L[2] I would get 'B' in the example > you sent. > > Regards, > Kasper -- Follow me at http://twitter.com/#!/xypron Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de _______________________________________________ Help-glpk mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-glpk
