#15143: Improvements to SetPartitions
------------------------------------+-----------------------------
Reporter: tscrim | Owner: sage-combinat
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-5.12
Component: combinatorics | Resolution:
Keywords: | Merged in:
Authors: Travis Scrimshaw | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: #14234 | Stopgaps:
------------------------------------+-----------------------------
Comment (by darij):
Thanks for the fixes. In other news, I am now sufficiently convinced of
the superiority of {{{__mul__}}} that I'm replacing {{{inf}}} by an alias
to {{{__mul__}}}:
{{{
sage: %timeit
SetPartition([[1,3],[2,6,5]]).__mul__(SetPartition([[1,2],[3],[6]]))
1000 loops, best of 3: 1.61 ms per loop
sage: %timeit
SetPartition([[1,3],[2,6,5]]).inf(SetPartition([[1,2],[3],[6]]))
100 loops, best of 3: 1.96 ms per loop
sage: %timeit SetPartition([[1],[2,3]]).__mul__(SetPartition([[1,2],[3]]))
1000 loops, best of 3: 1.3 ms per loop
sage: %timeit SetPartition([[1],[2,3]]).inf(SetPartition([[1,2],[3]]))
1000 loops, best of 3: 1.52 ms per loop
sage: %timeit
SetPartition([[1],[2],[3]]).__mul__(SetPartition([[1],[2],[3]]))
1000 loops, best of 3: 1.92 ms per loop
sage: %timeit SetPartition([[1],[2],[3]]).inf(SetPartition([[1],[2],[3]]))
100 loops, best of 3: 2.37 ms per loop
sage: %timeit
SetPartition([[1],[2],[3],[4],[5],[6],[7]]).__mul__(SetPartition([[1],[2],[4],[5],[8],[9],[3]]))
100 loops, best of 3: 5.61 ms per loop
sage: %timeit
SetPartition([[1],[2],[3],[4],[5],[6],[7]]).inf(SetPartition([[1],[2],[4],[5],[8],[9],[3]]))
100 loops, best of 3: 9.28 ms per loop
sage: %timeit SetPartition([[1,3,37]]).__mul__(SetPartition([[13,3,7]]))
1000 loops, best of 3: 662 us per loop
sage: %timeit SetPartition([[1,3,37]]).inf(SetPartition([[13,3,7]]))
1000 loops, best of 3: 744 us per loop
}}}
I think the {{{check}}} variable does nothing when one generates a set
partition. I'd be happy if you could see if there is something gained by
omitting the check, and if so, making the variable work. But I must admit
you have sped up the generation of a set partition by a factor of about 2
(compared to pre-#15143) already, so the net effect is a positive one even
if the check is left in.
I still don't understand the doc of {{{ordered_set_partition_action}}}.
What is unclear to me is this:
{{{
`A_{ \{ i_1, i_2, \ldots, i_k \} }` denote the sub-partition
`\{A_{i_1}, A_{i_2}, \ldots, A_{i_k}\}`.
}}}
Other than this method, I'll call this review done. Unfortunately, I'm out
of leeway now as far as free time is concerned, and someone else will
likely have to review the NCSym patch.
--
Ticket URL: <http://trac.sagemath.org/ticket/15143#comment:10>
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.