From 87302527a9c28ce7ebd77a0494ec12f5178fdece Mon Sep 17 00:00:00 2001 From: Alexis Montoison <35051714+amontoison@users.noreply.github.com> Date: Tue, 5 Nov 2024 16:16:45 -0600 Subject: [PATCH] Remove broadcast in MINRES-QLP --- src/minres_qlp.jl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/minres_qlp.jl b/src/minres_qlp.jl index 2538a1802..5c70ddcc9 100644 --- a/src/minres_qlp.jl +++ b/src/minres_qlp.jl @@ -353,8 +353,11 @@ kwargs_minres_qlp = (:M, :ldiv, :λ, :atol, :rtol, :Artol, :itmax, :timemax, :ve # [w̅ₖ₋₁ vₖ] [cpₖ spₖ] = [ẘₖ₋₁ w̅ₖ] ⟷ ẘₖ₋₁ = cpₖ * w̅ₖ₋₁ + spₖ * vₖ # [spₖ -cpₖ] ⟷ w̅ₖ = spₖ * w̅ₖ₋₁ - cpₖ * vₖ @kswap!(wₖ₋₁, wₖ) - wₖ .= spₖ .* wₖ₋₁ .- cpₖ .* vₖ - kaxpby!(n, spₖ, vₖ, cpₖ, wₖ₋₁) + # Compute w̅ₖ + kcopy!(n, wₖ, wₖ₋₁) + kaxpby!(n, spₖ, vₖ, cpₖ, wₖ) + # Compute ẘₖ₋₁ + kaxpby!(n, -cpₖ, vₖ, spₖ, wₖ₋₁) else # [ẘₖ₋₂ w̄ₖ₋₁ vₖ] [cpₖ 0 spₖ] [1 0 0 ] = [wₖ₋₂ ẘₖ₋₁ w̄ₖ] ⟷ wₖ₋₂ = cpₖ * ẘₖ₋₂ + spₖ * vₖ # [ 0 1 0 ] [0 cdₖ sdₖ] ⟷ ẘₖ₋₁ = cdₖ * w̄ₖ₋₁ + sdₖ * (spₖ * ẘₖ₋₂ - cpₖ * vₖ)