From 31d13925aa99c46cc8015d25e71aae183dce403e Mon Sep 17 00:00:00 2001 From: Andreas Noack Date: Thu, 6 Dec 2018 11:24:10 +0100 Subject: [PATCH] Create new sparse matrix for R factor in sparse least square solve instead of using a view to avoid slow fallback in back substitution. Fixes #30288 --- 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 67104f4b63870..d9ca5364e906b 100644 --- a/stdlib/SuiteSparse/src/spqr.jl +++ b/stdlib/SuiteSparse/src/spqr.jl @@ -394,7 +394,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