From adf6977ef169a2bb3fe654ccf2ca07e264b8a48d Mon Sep 17 00:00:00 2001 From: Andreas Noack Date: Fri, 7 Dec 2018 10:18:45 +0100 Subject: [PATCH] Create new sparse matrix for R factor in sparse least square solve (#30289) instead of using a view to avoid slow fallback in back substitution. Fixes #30288 (cherry picked from commit 87c5f36257c54cb4c9f026339d07e5d6ed62a329) --- stdlib/SuiteSparse/src/spqr.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/SuiteSparse/src/spqr.jl b/stdlib/SuiteSparse/src/spqr.jl index 01fdff14038d7..f851db416a714 100644 --- a/stdlib/SuiteSparse/src/spqr.jl +++ b/stdlib/SuiteSparse/src/spqr.jl @@ -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