#10534: Generation of subwords, subsets and set partitions
-----------------------------+----------------------------------------------
   Reporter:  vdelecroix     |       Owner:  vdelecroix                         
              
       Type:  enhancement    |      Status:  needs_review                       
              
   Priority:  major          |   Milestone:  sage-4.7                           
              
  Component:  combinatorics  |    Keywords:  generation, combinatorics, set, 
subset, partition
     Author:  vdelecroix     |    Upstream:  N/A                                
              
   Reviewer:                 |      Merged:                                     
              
Work_issues:                 |  
-----------------------------+----------------------------------------------
Changes (by vdelecroix):

  * status:  new => needs_review


Old description:

> This ticket stands for a faster method of exhaustive generation of
>
>  * subwords
>  * subsets
>  * set partitions
>
> Moreover we correct bugs and typos (see details in the patch) and create
> some random generation capabilities.
>
> Timings (on Intel(R) Core(TM)2 Duo CPU T8100  @ 2.10GHz)
>
> Old version
>
> {{{
> sage: S = SetPartitions(8,[3,3,2])
> sage: timeit('for p in S: pass')
> 5 loops, best of 3: 401 ms per loop
>
> sage: S = SetPartitions(9,[3,3,2,1])
> sage: timeit('for p in S: pass')
> 5 loops, best of 3: 4 s per loop
> }}}
> New version
>
> {{{
> sage: S = SetPartitions(8,[3,3,2])
> sage: timeit('for p in S: pass')
> 5 loops, best of 3: 130 ms per loop
> sage: timeit('for p in S._fast_iterator(): pass')
> 25 loops, best of 3: 10.4 ms per loop
>
> sage: S = SetPartitions(9,[3,3,2,1])
> sage: timeit('for p in S: pass')
> 5 loops, best of 3: 1.47 s per loop
> sage: timeit('for p in S._fast_iterator(): pass')
> 5 loops, best of 3: 94.1 ms per loop
> }}}

New description:

 This ticket stands for a faster method of exhaustive generation of

  * subwords
  * subsets
  * set partitions

 Moreover we correct bugs and typos (see details in the patch, doctest
 coverage is now 100%) and create some random generation capabilities.

 Timings (on Intel(R) Core(TM)2 Duo CPU T8100  @ 2.10GHz)

 Old version

 {{{
 sage: S = SetPartitions(8,[3,3,2])
 sage: timeit('for p in S: pass')
 5 loops, best of 3: 401 ms per loop

 sage: S = SetPartitions(9,[3,3,2,1])
 sage: timeit('for p in S: pass')
 5 loops, best of 3: 4 s per loop
 }}}
 New version

 {{{
 sage: S = SetPartitions(8,[3,3,2])
 sage: timeit('for p in S: pass')
 5 loops, best of 3: 130 ms per loop
 sage: timeit('for p in S._fast_iterator(): pass')
 25 loops, best of 3: 10.4 ms per loop

 sage: S = SetPartitions(9,[3,3,2,1])
 sage: timeit('for p in S: pass')
 5 loops, best of 3: 1.43 s per loop
 sage: timeit('for p in S._fast_iterator(): pass')
 5 loops, best of 3: 91.3 ms per loop
 }}}

--

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10534#comment:2>
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 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-trac?hl=en.

Reply via email to