#14862: Compositions accept any input
-------------------------------------+-------------------------------------
       Reporter:  stumpc5            |        Owner:  sage-combinat
           Type:  defect             |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-5.13
      Component:  combinatorics      |   Resolution:
       Keywords:  composition,       |    Merged in:
  FindStat                           |    Reviewers:
        Authors:                     |  Work issues:  provide a test in the
Report Upstream:  N/A                |  constructor
         Branch:                     |       Commit:
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by darij):

 Hmm; what exactly fails if you disallow 0? It looks like just requiring >=
 0 kicks the can down the road, and that with a speed penalty that might
 become problematic in NSym/QSym-related code:

 {{{
 %timeit Composition([3,2,1])
 %timeit a = Composition([2,1,6,2,2,6,1,3,2,2,3,5,2])
 %timeit Composition([])

 before

 sage: %timeit Composition([3,2,1])
 100000 loops, best of 3: 13.9 us per loop
 sage: %timeit a = Composition([2,1,6,2,2,6,1,3,2,2,3,5,2])
 100000 loops, best of 3: 15.8 us per loop
 sage: %timeit Composition([])
 100000 loops, best of 3: 12.1 us per loop

 after

 sage: %timeit Composition([3,2,1])
 100000 loops, best of 3: 16 us per loop
 sage: %timeit a = Composition([2,1,6,2,2,6,1,3,2,2,3,5,2])
 10000 loops, best of 3: 21.4 us per loop
 sage: %timeit Composition([])
 100000 loops, best of 3: 12.8 us per loop
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/14862#comment:23>
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/groups/opt_out.

Reply via email to