#17042: Improvement to subsets_with_hereditary_property
-------------------------+-------------------------------------------------
Reporter: | Owner:
ncohen | Status: needs_work
Type: | Milestone: sage-6.4
enhancement | Resolution:
Priority: major | Merged in:
Component: | Reviewers:
combinatorics | Work issues:
Keywords: | Commit:
Authors: | 381cfeff4c3661aa71d46514f231f6926d0b7d40
Nathann Cohen | Stopgaps:
Report Upstream: N/A |
Branch: |
u/ncohen/17042 |
Dependencies: |
#16994 |
-------------------------+-------------------------------------------------
Comment (by ncohen):
By the way
{{{
sage: %time l1=list(subsets_with_hereditary_property(lambda S:not
any(Set(S).intersection(x).cardinality()>2 for x in l), range(21)))
CPU times: user 7.98 s, sys: 36 ms, total: 8.02 s
Wall time: 7.96 s
sage: %time l2=list(subsets_with_hereditary_property(lambda S:not
any(len(set(S).intersection(x))>2 for x in l), range(21)))
CPU times: user 436 ms, sys: 60 ms, total: 496 ms
Wall time: 426 ms
sage: l1==l2
True
}}}
`Set->set`. never use combinat code if you can avoid it.
Nathann
--
Ticket URL: <http://trac.sagemath.org/ticket/17042#comment:8>
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.