-
-
Notifications
You must be signed in to change notification settings - Fork 528
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
the generic linear_combination_of_rows and linear_combination_of_columns functions for matrices are very stupidly slotch #5974
Comments
comment:1
While making sure all doctests pass for this, I uncovered the following serious bug:
We're getting a sparse matrix with DENSE parent out of echelon form for some reason. This totally breaks my new much better implementation of linear_combination_of_rows, and would of course break all kinds of other code in random and surprising ways eventually. The above is all present in the default sage-3.4.2.rc0. |
This comment has been minimized.
This comment has been minimized.
comment:2
Attachment: trac_5974.patch.gz I ran a fulldoctest cycle with this patch applied and found yet another serious bug in matrix multiplication (not caused by this patch, but uncovered by it). E.g., in vanilla released 3.4.1, some multiplies of cyclotomic matrices just go boom!
|
Attachment: trac_5974-part2.patch.gz Attachment: trac_5974-part3.patch.gz |
comment:4
In trac_5974.patch, I like the new code better than the old and I see the speed up (not quite 10 times on my machine, but close). However, should you raise an error if the length of v is longer than the number of rows of the matrix, the way the old code did? With the new code, I get an error about sizes of matrices being wrong, which is a little opaque:
Also, this is a little silly, but if A is a matrix with 0 rows, then Otherwise, looks good. All tests pass on sage.math. |
comment:5
Attachment: trac_5974-part4.patch.gz |
comment:6
Looks good. |
comment:7
This patch causes two doctest failures for me:
They seems to be not reproducible at the moment, but I am paranoid enough to wait and see post 4.0.a0 so I can valgrind this. Cheers, Michael |
comment:8
Merged in Sage 4.0.alpha0. I reran long doctests eight times and did not see any more issues. Should something lurk in here (or expose some other problem) we will catch it post 4.0.a.0. Cheers, Michael |
Behold. By replacing about 40 confusing lines by 2 trivial lines, I get a speedup by more than a factor of 10!
We also uncover several bugs in matrix multiply, which this patch also fixes.
CC: @rbeezer
Component: linear algebra
Issue created by migration from https://trac.sagemath.org/ticket/5974
The text was updated successfully, but these errors were encountered: