Skip to content

Commit

Permalink
Remove broadcast in MINRES-QLP (#929)
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison authored Nov 5, 2024
1 parent c5174fb commit 8851878
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/minres_qlp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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ₖ
Expand Down

0 comments on commit 8851878

Please sign in to comment.