Skip to content

Commit

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

0 comments on commit 8730252

Please sign in to comment.