#6484: sage.combinat.ranker improvements
-------------------------------------+-------------------------------------
Reporter: nthiery | Owner: nthiery
Type: enhancement | Status: needs_info
Priority: major | Milestone: sage-6.4
Component: combinatorics | Resolution:
Keywords: rank, unrank | Merged in:
Authors: Nicolas M. ThiƩry | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/nthiery/sage_combinat_ranker_improvements|
5adb28949227305b4ace3a15675549554f237a4b
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by vdelecroix):
* status: needs_review => needs_info
Comment:
Hello,
The final picture looks good. One good thing would be to clean the git
history.
The fastest way to create a dictionary from a list is
{{{
cdef dict d = {x:i for i,x in enumerate(l)}
}}}
I guess it avoids the creation of the pair `(i,x)`.
The documentation can be more precise
{{{
No error is issued in case of duplicate value in ``l``. Instead,
the rank function returns the position of some of the duplicates::
}}}
The rank of the '''last value''' is returned not just '''some'''. It would
possible to use `PyDict_MergeFromSeq2` to return the first though. But it
is not clear to me that it is what we want.
Sided note: I am pretty sure that with #18330 that something better can be
done so that `__call__` becomes as fast as `__getitem__` (up to a C
function call). But not for this ticket.
Vincent
--
Ticket URL: <http://trac.sagemath.org/ticket/6484#comment:22>
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.