Skip to content

Commit 8ab7e09

Browse files
authored
Merge pull request #1132 from JuliaLang/jishnub/qr_ldiv_R_cache
Cache and reuse `R` in adjoint `QR` `ldiv!`
2 parents 85919e6 + 195e678 commit 8ab7e09

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/qr.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,8 @@ function ldiv!(Fadj::AdjointFactorization{<:Any,<:Union{QR,QRCompactWY,QRPivoted
725725

726726
# For underdetermined system, the triangular solve should only be applied to the top
727727
# part of B that contains the rhs. For square problems, the view corresponds to B itself
728-
ldiv!(LowerTriangular(adjoint(F.R)), view(B, 1:size(F.R, 2), :))
728+
R = F.R
729+
ldiv!(LowerTriangular(adjoint(R)), view(B, axes(R, 2), :))
729730
lmul!(F.Q, B)
730731

731732
return B

0 commit comments

Comments
 (0)