#15428: Partitions to posets
-------------------------------------------------+-------------------------
Reporter: darij | Owner:
Type: enhancement | Status:
Priority: major | needs_work
Component: combinatorics | Milestone: sage-5.13
Keywords: sage-combinat, partition, | Resolution:
poset | Merged in:
Authors: Darij Grinberg | Reviewers: Travis
Report Upstream: N/A | Scrimshaw
Branch: | Work issues:
Dependencies: #15350 | Commit:
| Stopgaps:
-------------------------------------------------+-------------------------
Comment (by nthiery):
Hi Darij,
Replying to [comment:18 darij]:
> Hmm. TBH I still don't understand you. How do you get anything from
> reversal? I'm building up a dictionary, not a list of cover
> relations. The (arguably toy) timing I have done shows the
> dictionary to be faster:
>
> {{{
> sage: %timeit Poset({1: [2,3], 2: [4,5], 5: [6,7,8]})
> 1000 loops, best of 3: 1.31 ms per loop
> sage: %timeit Poset([[1,2],[1,3],[2,4],[2,5],[5,6],[5,7],[5,8]])
> 100 loops, best of 3: 1.9 ms per loop
> }}}
I'd say: too early of an optimization. Especially since the above
timing is actually pretty ridiculous: wtf, 1 ms to build a trivial
poset? I very much hope this will be improved a lot in the future; but
that's a different story. Btw: %timeit is does not measure things well
for objects with unique representation, or in general whenever there
is a cache involved.
At this point, just focus on expressive and duplication free code. Use
covers if it's easier. I know you can find a solution :-)
> > For consistency, I would tend to favor non boolean options like
> > horiz="left" / "right" (we have a bunch of them e.g. in the Coxeter
> > code). But I don't have great suggestions for the option names
> > themselves.
>
> Hmm. I thought you wanted to get rid of strings as arguments. I'm not
really convinced of replacing a 2-letter string by 2 multiletter strings
:/
I agree. My point was more about separation of concerns (up/down,
left/right). In any cases, there is no clear cut solution and I just
meant to hint at possible directions. I let you take the final
judgment call!
Cheers,
Nicolas
--
Ticket URL: <http://trac.sagemath.org/ticket/15428#comment:19>
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.