#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):

 This being said the combinat code is better to observe the speedups `:-D`

 {{{
 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.97 s, sys: 72 ms, total: 8.04 s
 Wall time: 7.96 s
 sage: %time  l2=list(subsets_with_hereditary_property(lambda S:not
 any(Set(S).intersection(x).cardinality()>2 for x in l),
 range(21),max_obstruction_size=3))
 CPU times: user 2.46 s, sys: 44 ms, total: 2.51 s
 Wall time: 2.43 s
 sage: l1==l2
 True
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/17042#comment:9>
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.

Reply via email to