#15609: IntegerVectors_nk.rank() specialization
-------------------------------------+-------------------------------------
       Reporter:  f.poloni           |        Owner:
           Type:  enhancement        |       Status:  needs_work
       Priority:  trivial            |    Milestone:  sage-6.1
      Component:  combinatorics      |   Resolution:
       Keywords:  integervectors,    |    Merged in:
  rank                               |    Reviewers:
        Authors:  Federico Poloni    |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  f616301fefa44762f90fe7cc54aab3d78d842b9e
  u/f.poloni/ticket/15609            |     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by f.poloni):

 Thanks for taking a look at the patch. You are correct about the negative
 entries, good catch; I'll fix it.

 Actually there is another point I was considering. The members of
 `IntegerVectors` are lists; what should we do when another sequence type
 such a tuple is passed to `rank()`?

 The implementation in the current patch returns the same result for any
 sequence type, however using `__contains__` would require them to be lists
 or else it would throw an error.

 `Combinations.rank()` throws `TypeError` when passed a tuple;
 `Derangements.rank()` returns nothing (no error thrown).

 This is an issue of strict type correctness vs. user convenience. For
 instance, you inadvertently used a tuple in your example in the previous
 comment. `:)`
 It is ultimately a developer decision; please let me know what I should
 return in case a tuple is entered and I shall code it.

--
Ticket URL: <http://trac.sagemath.org/ticket/15609#comment:5>
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