Skip to content

Commit

Permalink
Create new sparse matrix for R factor in sparse least square solve (#…
Browse files Browse the repository at this point in the history
…30289)

instead of using a view to avoid slow fallback in back substitution.

Fixes #30288

(cherry picked from commit 87c5f36)
  • Loading branch information
andreasnoack authored and KristofferC committed Feb 20, 2020
1 parent 33f02ce commit c8887c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stdlib/SuiteSparse/src/spqr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ function _ldiv_basic(F::QRSparse, B::StridedVecOrMat)
X[rnk + 1:end, :] .= 0

# Solve R*X = B
LinearAlgebra.ldiv!(UpperTriangular(view(F.R, Base.OneTo(rnk), Base.OneTo(rnk))),
LinearAlgebra.ldiv!(UpperTriangular(F.R[Base.OneTo(rnk), Base.OneTo(rnk)]),
view(X0, Base.OneTo(rnk), :))

# Apply right permutation and extract solution from X
Expand Down

0 comments on commit c8887c4

Please sign in to comment.