From e530e1a933a3fac79e59897f936846b4e21e5214 Mon Sep 17 00:00:00 2001 From: droodman Date: Sun, 24 Dec 2023 00:40:28 -0500 Subject: [PATCH] tweak in cholldiv --- src/utilities.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utilities.jl b/src/utilities.jl index 151363a..889f0b2 100644 --- a/src/utilities.jl +++ b/src/utilities.jl @@ -350,11 +350,12 @@ function cholldiv!(ch::CholeskyPivoted{T}, Y::AbstractVecOrMat{T}) where T # ad if rnk == len ldiv!(ch, Y) else + invpiv = invperm(ch.piv) for v ∈ eachcol(Y) permute!(v, ch.piv) v[rnk+1:len] .= zero(T) LAPACK.potrs!(ch.uplo, view(ch.factors, 1:rnk, 1:rnk), view(v, 1:rnk, :)) - invpermute!(v, ch.piv) + permute!(v, invpiv) end end end