#18290: enhanced sets and cartesian products
-------------------------+-------------------------------------------------
Reporter: | Owner:
vdelecroix | Status: needs_review
Type: | Milestone: sage-6.7
enhancement | Resolution:
Priority: major | Merged in:
Component: | Reviewers:
categories | Work issues:
Keywords: | Commit:
cartesian_product | 6389ff27cbcfcc1d51f2b6ad346c79ccd7eebbe3
Authors: | Stopgaps:
Vincent Delecroix |
Report Upstream: N/A |
Branch: |
public/18290 |
Dependencies: |
-------------------------+-------------------------------------------------
Comment (by vdelecroix):
Replying to [comment:36 ncohen]:
> > On the other hand, there is sometimes nothing else to do than going
through the list of elements to get the cardinality. And you know it:
`sage.graphs.independent_sets.IndependentSets`.
>
> The same goes for `is_empty`. Sometimes all you can do is run the
enumeration.
This is exactly what I did:
{{{
class EnumeratedSets:
class ParentMethods:
def is_empty(self):
try:
iter(self).next()
except StopIteration:
return False
else:
return True
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/18290#comment:37>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.