-
-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IntegerVectors_nk.rank() specialization #15609
Comments
Attachment: integer_vector_ranking.patch.gz |
Branch: u/f.poloni/ticket/15609 |
Author: Federico Poloni |
Commit: |
comment:3
Committed using git and the dev-tools the code in the attached patch, after many difficulties setting up the environment as a first-time contributor. :( New commits:
|
comment:4
Hellooooooooooooooo Federico ! Well, I don't know what you went through, but the patch looks nice in the end It's a cool improvement, and it is well documented and tested. I have only one thing to add :
That's because you check manually whether the given vector belongs to The problem with this Could you fix that ? Also, could you replace This way it will all appear properly in the html documentation. Which you can obtain with Thanks ! Nathann |
comment:5
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 The implementation in the current patch returns the same result for any sequence type, however using
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. |
comment:6
Hellooooooooooooooo !!!
Hmmmmmmm....
Well, I think that it would make sense anyway to only return the rank of objects on which
I hate this code. This has to be FIXED. I will create a ticket for that and add you in Cc (it should only take a couple of seconds to review). What has to be known about this code is that it is inconsistent in many places, and that we should never feel forced to respect what is done elsewhere, for I learned it was mistakes most of the time I think rank should throw a
Well, I really feel that what should be called there is Please code it this way only if it makes sense to you. Otherwise let's talk about it. And I will write this quick patch for the other problem you found. Have fuuuuuuuuuuuuun ! Nathann |
comment:7
I asked a question on sage-combinat-devel about this .rank function that returns nothing. https://groups.google.com/forum/#!topic/sage-combinat-devel/YUEVBIUzOv4 Turns out it is a deliberate choice. Nathann |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:9
I agree with you on all respects (except maybe that I think that for most sequences the generic inherited As for the choice of sequences, also in my view it would be good not to force a specific one on the user, at least in methods that take them as inputs, but that's a different and broader issue. Anyway, I have applied your suggested changes (testing for membership with New commits:
|
comment:10
Okayyyyyyyyyyyyyyyyyyyy ! Then it can go. Thanks for that patch ! Nathann |
Reviewer: Nathann Cohen |
comment:13
Wow. From created to merged in 5 days. That was fast Nathann |
comment:14
See #15639 for a bug that was most likely introduced here. |
comment:15
Weird Nathann |
* develop: (59 commits) Updated Sage version to 6.1.beta4 trac sagemath#15572: DiGraph.is_directed_acyclic handles loops pretty well Fixed bug in uniform matroid. trac sagemath#15619: Pickling multigraphs with loops and labels Trac 15619: Review commit Trac 15603: More doctests, nicer error message No need to specify caller_name in verbose() Add comments, small cosmetic changes Make q monic before computing cubic resolvent Implement splitting fields for number fields trac sagemath#15619: bug in the former definition; exception to avoid it in the future trac 8723: fix one line in isogeny_small_degree Use "in" instead of PyDict_Contains() test for membership with `x in self`; minor doc formatting change trac sagemath#15619: Pickling of immutable graphs Rebased on sage-6.1.beta2 # User Thomas Feulner <thomas.feulner@uni-bayreuth.de> Implemented IntegerVectors_nk.rank(). Fixes sagemath#15609 Trac sagemath#5153: small change in documentation. Trac 7695: Variable name for all subfields where the name ends with a digit ...
Currently IntegerVectors_nk inherits the generic
rank()
implementation for its parent; it's a very generic method that generates all its members and checks for equality. I needed a faster implementation in my code, so I wrote a specialized version that uses an ad-hoc algorithm (nothing fancy, essentially it's just adding up a bunch of binomials).I plan to upload the code using git and the standard dev tools. I'm a new contributor, so it could take me a while to set everything up and commit code -- I am currently in the process of building a dev version for the first time.
CC: @nathanncohen
Component: combinatorics
Keywords: integervectors, rank
Author: Federico Poloni
Branch/Commit: u/f.poloni/ticket/15609 @
06856f6
Reviewer: Nathann Cohen
Issue created by migration from https://trac.sagemath.org/ticket/15609
The text was updated successfully, but these errors were encountered: