On Jan 9, 2009, at 9:21 PM, John H Palmieri wrote: > > On Jan 9, 7:03 pm, "William Stein" <[email protected]> wrote: >> On Fri, Jan 9, 2009 at 6:42 PM, John H Palmieri >> <[email protected]> wrote: >> >>> Here's another question: what is the most efficient way of testing >>> whether one Set is a subset of another? I can do >> >>> S in list(T.subsets()) >> >>> -- and it's a bit frustrating that I can't do S in T.subsets() -- >>> and >>> I can also manipulate intersections, unions, differences, etc. I can >>> also convert to python sets and use <=. Is there a preferred way? >> >> There should be an is_subset method, but mysteriously there >> isn't. Implement >> it and send a patch. > > Okay, then back to my question: what's the most efficient way of > implement it?
Probably via python sets, or some other hashing mechanism. It also depends on the underlying implementation of Set. - Robert --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
