-
Notifications
You must be signed in to change notification settings - Fork 58
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
Make vector times matrix faster #1937
base: master
Are you sure you want to change the base?
Conversation
It has to be 8*I as it not c..
+I*sizeof,,,()
…On Thu, 31 Oct 2024, 23:17 Tommy Hofmann, ***@***.***> wrote:
@fieker <https://github.com/fieker> I is working well for vector *
matrix, but I am having trouble in the other case. I guess he does not like
my
bb.rows = reinterpret(Ptr{Ptr{ZZRingElem}}, pointer([pointer(be) + i for i in 0:length(b) - 1]))
but I am not sure what I am doing wrong.
julia> A = matrix(ZZ, 2, 2, [1, 2, 3, 4]); b = ZZRingElem[10, 0];
julia> A * b
2-element Vector{ZZRingElem}:
7690
0
------------------------------
You can view, comment on, or merge this pull request online at:
#1937
Commit Summary
- 04f5903
<04f5903>
bla
File Changes
(1 file <https://github.com/Nemocas/Nemo.jl/pull/1937/files>)
- *M* src/flint/fmpz_mat.jl
<https://github.com/Nemocas/Nemo.jl/pull/1937/files#diff-40f464b6a6e7233fe4abb2db0f0386afa9e46a52ea4e0fd1053e7d54855af5e3>
(77)
Patch Links:
- https://github.com/Nemocas/Nemo.jl/pull/1937.patch
- https://github.com/Nemocas/Nemo.jl/pull/1937.diff
—
Reply to this email directly, view it on GitHub
<#1937>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA36CV62ZEU27Q2VBX6HIE3Z6KT6HAVCNFSM6AAAAABQ7HEVTGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGYZDOOJSGQYTGMY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
ah right, thanks |
I am surprised that this is faster than just calling flint in these cases. Can you (once it works) post some benchmarks here? |
It is still calling flint, but eventually |
Timings for
Here is the same for new versions
Here the same for
So we might have to do some tuning for small dimensions. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1937 +/- ##
==========================================
- Coverage 87.51% 87.47% -0.04%
==========================================
Files 97 97
Lines 35537 35574 +37
==========================================
+ Hits 31101 31120 +19
- Misses 4436 4454 +18 ☔ View full report in Codecov by Sentry. |
@@ -1784,13 +1784,69 @@ end | |||
addmul!(z::ZZMatrixOrPtr, a::ZZMatrixOrPtr, b::Integer) = addmul!(z, a, flintify(b)) | |||
addmul!(z::ZZMatrixOrPtr, a::IntegerUnionOrPtr, b::ZZMatrixOrPtr) = addmul!(z, b, a) | |||
|
|||
function _very_unsafe_convert(::Type{ZZMatrix}, a::Vector{ZZRingElem}, row = true) |
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.
function _very_unsafe_convert(::Type{ZZMatrix}, a::Vector{ZZRingElem}, row = true) | |
function _very_unsafe_convert(::Type{ZZMatrix}, a::Vector{ZZRingElem}, Val{row} = Val(true)) where {row} |
this should push performance ever so slightly further as it eliminates a jump in if row
@fieker I is working well for vector * matrix, but I am having trouble in the other case. I guess he does not like my
but I am not sure what I am doing wrong.