-
-
Notifications
You must be signed in to change notification settings - Fork 652
Row rank profile / row pivots: direct extraction from echelon form over prime fields #40579
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
base: develop
Are you sure you want to change the base?
Row rank profile / row pivots: direct extraction from echelon form over prime fields #40579
Conversation
…y in parallel version
Documentation preview for this PR (built with commit 0dfb949; changes) is ready! 🎉 |
…s and pivot_rows when either of them is asked for
The previous version was not working correctly due to the row rank profile not being preserved by the used Gaussian elimination. The latest commits switched to the PLUQ method for which FFPACK guarantees to preserve both rank profiles. The class also overrides It seems that the echelonization methods could be simplified and could also easily provide access to the transformation, but this is another issue. |
I've manually tested all m x n matrices over GF(3), with m, n <= 4. All calls to
|
Thanks for the feedback! Apparently I cannot ask you to be a reviewer on github; I think you need to ask to join the sagemath github organization for that (or maybe the triage team). I also added @xcaruso as a reviewer in case he wishes to review the changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not know very much about linbox but the PR looks good to me, expect the two comments below.
Also, I underline that the documentation of the function |
Do you want to update the doctests or not? |
Doing it, should be ready in a few minutes. |
I added/fixed documentation for |
Looks very nice! Btw, what does |
Echelon Form Domain. This name is not used much in LinBox anymore, it probably was at the time where this was integrated. Also, the description of the two variants
and particularly the more detailed comment
seem contradictory (and probably outdated with respect to the current ReducedRowEchelonForm in FFLAS-FFPACK). I'm not sure having the two variants makes sense anymore, however we should definitely incorporate FFPACK's mechanism to efficiently recover the transformation (related to #37480 ). I keep this in mind for a future enhancement... I did not want to include too much in this PR to avoid breaking things that work. |
Everything looks good to me and failures do not seem related to this PR. I give a positive review. |
sagemathgh-40579: Row rank profile / row pivots: direct extraction from echelon form over prime fields Fixes sagemath#40572 - ensure the use of the LUdivine / LQUP strategy with the flag FfpackSlabRecursive - extract row rank profile using FFPACK's `RankProfileFromLU` Concerning the first point, this strategy was already the one used in the single threaded case, since it is the default method in the FFPACK implementation. However it was not the default in the multi threaded case, which means there was actually a bug in Sage when calling `_echelonize_linbox(efd=False)` with 2 or more threads: ``` sage: mat = matrix(GF(3), [[1,0,1,0],[1,0,0,0],[1,0,0,0],[0,1,0,0]]) sage: mat.echelon_form() [1 0 0 0] [0 1 0 0] [0 0 1 0] [0 0 0 0] sage: Parallelism().set("linbox", nproc=2) sage: mat = matrix(GF(3), [[1,0,1,0],[1,0,0,0],[1,0,0,0],[0,1,0,0]]) sage: mat.echelon_form() [1 0 0 0] [0 0 1 0] [0 1 0 0] [0 0 0 0] ``` (the latter does not meet Sage's requirements of the reduced row echelon form) Some more complete tests concerning the row rank profile are to be done before merging. URL: sagemath#40579 Reported by: Vincent Neiger Reviewer(s): Vincent Neiger, Xavier Caruso
Fixes #40572
RankProfileFromLU
Concerning the first point, this strategy was already the one used in the single threaded case, since it is the default method in the FFPACK implementation. However it was not the default in the multi threaded case, which means there was actually a bug in Sage when calling
_echelonize_linbox(efd=False)
with 2 or more threads:(the latter does not meet Sage's requirements of the reduced row echelon form)
Some more complete tests concerning the row rank profile are to be done before merging.