forked from sagemath/sage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sagemathgh-37375: Speed up square matrix times vector over GF(2)
When doing a matrix-times-vector multiplication over F_2, there is some inefficiency caused by calling `VectorSpace` to create a parent for the result. This becomes noticeable when repeatedly multiplying small matrices. When the dimensions are all the same, this can be improved by using the parent of the vector also as the parent for the result. Before: ``` sage: A = random_matrix(GF(2),10^2,10^2) sage: v0 = vector(random_matrix(GF(2),10^2,1)) sage: %timeit A*v0 2.78 µs ± 128 ns per loop (mean ± std. dev. of 7 runs, 100,000 loops each) ``` After: ``` sage: A = random_matrix(GF(2),10,10) sage: v0 = vector(random_matrix(GF(2),10,1)) sage: %timeit A*v0 995 ns ± 22.9 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each) ``` URL: sagemath#37375 Reported by: kedlaya Reviewer(s): Lorenz Panny
- Loading branch information
Showing
3 changed files
with
23 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
tarball=configure-VERSION.tar.gz | ||
sha1=0c93ffbc40ee55c429b82c6070817c0133a05013 | ||
md5=96e8d0c3aa48cab18b60499c4d303a73 | ||
cksum=2523075193 | ||
sha1=916d899be471df2370fc359c35a08ee524ad5676 | ||
md5=7088925f8d8c9d4954c44c72b0201031 | ||
cksum=877876854 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
81a374dc4dacba71cf071f981d496ff63b2b2acb | ||
d54fa043a6118f6220b0a7071ee465c14599b3d0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters