From 885187818f3b92f69573cdc82e7cb623c856885b Mon Sep 17 00:00:00 2001 From: Alexis Montoison <35051714+amontoison@users.noreply.github.com> Date: Tue, 5 Nov 2024 16:46:58 -0600 Subject: [PATCH] Remove broadcast in MINRES-QLP (#929) --- src/minres_qlp.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/minres_qlp.jl b/src/minres_qlp.jl index 2538a1802..cd0dc20c2 100644 --- a/src/minres_qlp.jl +++ b/src/minres_qlp.jl @@ -353,7 +353,10 @@ 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ₖ + # Compute w̅ₖ + kcopy!(n, wₖ, wₖ₋₁) + kaxpby!(n, -cpₖ, vₖ, spₖ, wₖ) + # Compute ẘₖ₋₁ kaxpby!(n, spₖ, vₖ, cpₖ, wₖ₋₁) else # [ẘₖ₋₂ w̄ₖ₋₁ vₖ] [cpₖ 0 spₖ] [1 0 0 ] = [wₖ₋₂ ẘₖ₋₁ w̄ₖ] ⟷ wₖ₋₂ = cpₖ * ẘₖ₋₂ + spₖ * vₖ