-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fix tall qr multiplication #38002
Fix tall qr multiplication #38002
Conversation
stdlib/LinearAlgebra/src/qr.jl
Outdated
mB = size(B, 1) | ||
mC = size(C, 1) | ||
if mB < mC | ||
fill!(C, zero(T)) |
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.
This may be slightly wasteful, but I couldn't find how to elegantly fill only the complement of C[eachindex(IndexCartesian(), B)]
with zeros.
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 guess explicit loops could work, since the dimensionality is fixed. Alternatively:
C[CartesianIndices(B)] .= B
C[CartesianIndices((mB+1:mC, 1:size(C,2))] .= zero(T)
stdlib/LinearAlgebra/src/qr.jl
Outdated
mB = size(B, 1) | ||
mC = size(C, 1) | ||
if mB < mC | ||
fill!(C, zero(T)) |
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 guess explicit loops could work, since the dimensionality is fixed. Alternatively:
C[CartesianIndices(B)] .= B
C[CartesianIndices((mB+1:mC, 1:size(C,2))] .= zero(T)
Thanks for this @dkarrasch ; I had forgotten about this issue, and must somehow have missed your PR, despite being mentioned. |
I'm marking this for backport, since the |
(cherry picked from commit 24750c6)
(cherry picked from commit 24750c6) Co-authored-by: Daniel Karrasch <[email protected]>
Fixes JuliaLang/LinearAlgebra.jl#725. @Jutho