Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use the macro @. #864

Merged
merged 4 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/bilq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -329,19 +329,19 @@ kwargs_bilq = (:c, :transfer_to_bicg, :M, :N, :ldiv, :atol, :rtol, :itmax, :time
# Compute d̅ₖ.
if iter == 1
# d̅₁ = v₁
@. d̅ = vₖ
@kcopy!(n, vₖ, d̅) # d̅ ← vₖ
else
# d̅ₖ = s̄ₖ * d̅ₖ₋₁ - cₖ * vₖ
@kaxpby!(n, -cₖ, vₖ, conj(sₖ), d̅)
end

# Compute vₖ₊₁ and uₖ₊₁.
@. vₖ₋₁ = vₖ # vₖ₋₁ ← vₖ
@. uₖ₋₁ = uₖ # uₖ₋₁ ← uₖ
@kcopy!(n, vₖ, vₖ₋₁) # vₖ₋₁ ← vₖ
@kcopy!(n, uₖ, uₖ₋₁) # uₖ₋₁ ← uₖ

if pᴴq ≠ 0
@. vₖ = q / βₖ₊₁ # βₖ₊₁vₖ₊₁ = q
@. uₖ = p / conj(γₖ₊₁) # γ̄ₖ₊₁uₖ₊₁ = p
vₖ .= q ./ βₖ₊₁ # βₖ₊₁vₖ₊₁ = q
uₖ .= p ./ conj(γₖ₊₁) # γ̄ₖ₊₁uₖ₊₁ = p
end

# Compute ⟨vₖ,vₖ₊₁⟩ and ‖vₖ₊₁‖
Expand Down
16 changes: 8 additions & 8 deletions src/bilqr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ kwargs_bilqr = (:transfer_to_bicg, :atol, :rtol, :itmax, :timemax, :verbose, :hi
# Compute d̅ₖ.
if iter == 1
# d̅₁ = v₁
@. d̅ = vₖ
@kcopy!(n, vₖ, d̅) # d̅ ← vₖ
else
# d̅ₖ = s̄ₖ * d̅ₖ₋₁ - cₖ * vₖ
@kaxpby!(n, -cₖ, vₖ, conj(sₖ), d̅)
Expand Down Expand Up @@ -375,22 +375,22 @@ kwargs_bilqr = (:transfer_to_bicg, :atol, :rtol, :itmax, :timemax, :verbose, :hi
if iter == 2
wₖ₋₁ = wₖ₋₂
@kaxpy!(n, one(FC), uₖ₋₁, wₖ₋₁)
@. wₖ₋₁ = uₖ₋₁ / conj(δₖ₋₁)
wₖ₋₁ .= uₖ₋₁ ./ conj(δₖ₋₁)
end
# w₂ = (u₂ - λ̄₁w₁) / δ̄₂
if iter == 3
wₖ₋₁ = wₖ₋₃
@kaxpy!(n, one(FC), uₖ₋₁, wₖ₋₁)
@kaxpy!(n, -conj(λₖ₋₂), wₖ₋₂, wₖ₋₁)
@. wₖ₋₁ = wₖ₋₁ / conj(δₖ₋₁)
wₖ₋₁ .= wₖ₋₁ ./ conj(δₖ₋₁)
end
# wₖ₋₁ = (uₖ₋₁ - λ̄ₖ₋₂wₖ₋₂ - ϵ̄ₖ₋₃wₖ₋₃) / δ̄ₖ₋₁
if iter ≥ 4
@kscal!(n, -conj(ϵₖ₋₃), wₖ₋₃)
wₖ₋₁ = wₖ₋₃
@kaxpy!(n, one(FC), uₖ₋₁, wₖ₋₁)
@kaxpy!(n, -conj(λₖ₋₂), wₖ₋₂, wₖ₋₁)
@. wₖ₋₁ = wₖ₋₁ / conj(δₖ₋₁)
wₖ₋₁ .= wₖ₋₁ ./ conj(δₖ₋₁)
end

if iter ≥ 3
Expand Down Expand Up @@ -421,12 +421,12 @@ kwargs_bilqr = (:transfer_to_bicg, :atol, :rtol, :itmax, :timemax, :verbose, :hi
end

# Compute vₖ₊₁ and uₖ₊₁.
@. vₖ₋₁ = vₖ # vₖ₋₁ ← vₖ
@. uₖ₋₁ = uₖ # uₖ₋₁ ← uₖ
@kcopy!(n, vₖ, vₖ₋₁) # vₖ₋₁ ← vₖ
@kcopy!(n, uₖ, uₖ₋₁) # uₖ₋₁ ← uₖ

if pᴴq ≠ zero(FC)
@. vₖ = q / βₖ₊₁ # βₖ₊₁vₖ₊₁ = q
@. uₖ = p / conj(γₖ₊₁) # γ̄ₖ₊₁uₖ₊₁ = p
vₖ .= q ./ βₖ₊₁ # βₖ₊₁vₖ₊₁ = q
uₖ .= p ./ conj(γₖ₊₁) # γ̄ₖ₊₁uₖ₊₁ = p
end

# Update ϵₖ₋₃, λₖ₋₂, δbarₖ₋₁, cₖ₋₁, sₖ₋₁, γₖ and βₖ.
Expand Down
4 changes: 2 additions & 2 deletions src/cg_lanczos.jl
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ kwargs_cg_lanczos = (:M, :ldiv, :check_curvature, :atol, :rtol, :itmax, :timemax
@kaxpy!(n, -δ, Mv, Mv_next) # Mvₖ₊₁ ← Mvₖ₊₁ - δₖMvₖ
if iter > 0
@kaxpy!(n, -β, Mv_prev, Mv_next) # Mvₖ₊₁ ← Mvₖ₊₁ - βₖMvₖ₋₁
@. Mv_prev = Mv # Mvₖ₋₁ ← Mvₖ
@kcopy!(n, Mv, Mv_prev) # Mvₖ₋₁ ← Mvₖ
end
@. Mv = Mv_next # Mvₖ ← Mvₖ₊₁
@kcopy!(n, Mv_next, Mv) # Mvₖ ← Mvₖ₊₁
MisI || mulorldiv!(v, M, Mv, ldiv) # vₖ₊₁ = M⁻¹ * Mvₖ₊₁
β = sqrt(@kdotr(n, v, Mv)) # βₖ₊₁ = vₖ₊₁ᴴ M vₖ₊₁
@kscal!(n, one(FC) / β, v) # vₖ₊₁ ← vₖ₊₁ / βₖ₊₁
Expand Down
4 changes: 2 additions & 2 deletions src/cg_lanczos_shift.jl
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ kwargs_cg_lanczos_shift = (:M, :ldiv, :check_curvature, :atol, :rtol, :itmax, :t
@kaxpy!(n, -δ, Mv, Mv_next) # Mvₖ₊₁ ← Mvₖ₊₁ - δₖMvₖ
if iter > 0
@kaxpy!(n, -β, Mv_prev, Mv_next) # Mvₖ₊₁ ← Mvₖ₊₁ - βₖMvₖ₋₁
@. Mv_prev = Mv # Mvₖ₋₁ ← Mvₖ
@kcopy!(n, Mv, Mv_prev) # Mvₖ₋₁ ← Mvₖ
end
@. Mv = Mv_next # Mvₖ ← Mvₖ₊₁
@kcopy!(n, Mv_next, Mv) # Mvₖ ← Mvₖ₊₁
MisI || mulorldiv!(v, M, Mv, ldiv) # vₖ₊₁ = M⁻¹ * Mvₖ₊₁
β = sqrt(@kdotr(n, v, Mv)) # βₖ₊₁ = vₖ₊₁ᴴ M vₖ₊₁
@kscal!(n, one(FC) / β, v) # vₖ₊₁ ← vₖ₊₁ / βₖ₊₁
Expand Down
4 changes: 2 additions & 2 deletions src/fgmres.jl
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ kwargs_fgmres = (:M, :N, :ldiv, :restart, :reorthogonalization, :atol, :rtol, :i
# Initial ζ₁ and V₁
β = @knrm2(n, r₀)
z[1] = β
@. V[1] = r₀ / rNorm
V[1] .= r₀ ./ rNorm

npass = npass + 1
solver.inner_iter = 0
Expand Down Expand Up @@ -332,7 +332,7 @@ kwargs_fgmres = (:M, :N, :ldiv, :restart, :reorthogonalization, :atol, :rtol, :i
push!(V, S(undef, n))
push!(z, zero(FC))
end
@. V[inner_iter+1] = q / Hbis # hₖ₊₁.ₖvₖ₊₁ = q
V[inner_iter+1] .= q ./ Hbis # hₖ₊₁.ₖvₖ₊₁ = q
z[inner_iter+1] = ζₖ₊₁
end
end
Expand Down
4 changes: 2 additions & 2 deletions src/fom.jl
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ kwargs_fom = (:M, :N, :ldiv, :restart, :reorthogonalization, :atol, :rtol, :itma
# Initial ζ₁ and V₁
β = @knrm2(n, r₀)
z[1] = β
@. V[1] = r₀ / rNorm
V[1] .= r₀ ./ rNorm

npass = npass + 1
inner_iter = 0
Expand Down Expand Up @@ -314,7 +314,7 @@ kwargs_fom = (:M, :N, :ldiv, :restart, :reorthogonalization, :atol, :rtol, :itma
if !restart && (inner_iter ≥ mem)
push!(V, S(undef, n))
end
@. V[inner_iter+1] = q / Hbis # hₖ₊₁.ₖvₖ₊₁ = q
V[inner_iter+1] .= q ./ Hbis # hₖ₊₁.ₖvₖ₊₁ = q
end
end

Expand Down
4 changes: 2 additions & 2 deletions src/gmres.jl
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ kwargs_gmres = (:M, :N, :ldiv, :restart, :reorthogonalization, :atol, :rtol, :it
# Initial ζ₁ and V₁
β = @knrm2(n, r₀)
z[1] = β
@. V[1] = r₀ / rNorm
V[1] .= r₀ ./ rNorm

npass = npass + 1
solver.inner_iter = 0
Expand Down Expand Up @@ -325,7 +325,7 @@ kwargs_gmres = (:M, :N, :ldiv, :restart, :reorthogonalization, :atol, :rtol, :it
push!(V, S(undef, n))
push!(z, zero(FC))
end
@. V[inner_iter+1] = q / Hbis # hₖ₊₁.ₖvₖ₊₁ = q
V[inner_iter+1] .= q ./ Hbis # hₖ₊₁.ₖvₖ₊₁ = q
z[inner_iter+1] = ζₖ₊₁
end
end
Expand Down
8 changes: 4 additions & 4 deletions src/gpmr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,12 @@ kwargs_gpmr = (:C, :D, :E, :F, :ldiv, :gsp, :λ, :μ, :reorthogonalization, :ato
# βv₁ = Cb
β = @knrm2(m, b₀)
β ≠ 0 || error("b must be nonzero")
@. V[1] = b₀ / β
V[1] .= b₀ ./ β

# γu₁ = Dc
γ = @knrm2(n, c₀)
γ ≠ 0 || error("c must be nonzero")
@. U[1] = c₀ / γ
U[1] .= c₀ ./ γ

# Compute ‖r₀‖² = γ² + β²
rNorm = sqrt(γ^2 + β^2)
Expand Down Expand Up @@ -479,15 +479,15 @@ kwargs_gpmr = (:C, :D, :E, :F, :ldiv, :gsp, :λ, :μ, :reorthogonalization, :ato

# hₖ₊₁.ₖ ≠ 0
if Haux > btol
@. V[k+1] = q / Haux # hₖ₊₁.ₖvₖ₊₁ = q
V[k+1] .= q ./ Haux # hₖ₊₁.ₖvₖ₊₁ = q
else
# Breakdown -- hₖ₊₁.ₖ = ‖q‖₂ = 0 and Auₖ ∈ Span{v₁, ..., vₖ}
V[k+1] .= zero(FC) # vₖ₊₁ = 0 such that vₖ₊₁ ⊥ Span{v₁, ..., vₖ}
end

# fₖ₊₁.ₖ ≠ 0
if Faux > btol
@. U[k+1] = p / Faux # fₖ₊₁.ₖuₖ₊₁ = p
U[k+1] .= p ./ Faux # fₖ₊₁.ₖuₖ₊₁ = p
else
# Breakdown -- fₖ₊₁.ₖ = ‖p‖₂ = 0 and Bvₖ ∈ Span{u₁, ..., uₖ}
U[k+1] .= zero(FC) # uₖ₊₁ = 0 such that uₖ₊₁ ⊥ Span{u₁, ..., uₖ}
Expand Down
4 changes: 2 additions & 2 deletions src/minres.jl
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ kwargs_minres = (:M, :ldiv, :λ, :atol, :rtol, :etol, :conlim, :itmax, :timemax,
end
@kaxpy!(n, one(FC) / β, v, w)

@. r1 = r2
@. r2 = y
@kcopy!(n, r2, r1) # r1 ← r2
@kcopy!(n, y, r2) # r2 ← y
MisI || mulorldiv!(v, M, r2, ldiv)
oldβ = β
β = @kdotr(n, r2, v)
Expand Down
4 changes: 2 additions & 2 deletions src/minres_qlp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,12 @@ kwargs_minres_qlp = (:M, :ldiv, :λ, :atol, :rtol, :Artol, :itmax, :timemax, :ve
# Compute directions wₖ₋₂, ẘₖ₋₁ and w̄ₖ, last columns of Wₖ = Vₖ(Pₖ)ᴴ
if iter == 1
# w̅₁ = v₁
@. wₖ = vₖ
@kcopy!(n, vₖ, wₖ)
elseif iter == 2
# [w̅ₖ₋₁ vₖ] [cpₖ spₖ] = [ẘₖ₋₁ w̅ₖ] ⟷ ẘₖ₋₁ = cpₖ * w̅ₖ₋₁ + spₖ * vₖ
# [spₖ -cpₖ] ⟷ w̅ₖ = spₖ * w̅ₖ₋₁ - cpₖ * vₖ
@kswap(wₖ₋₁, wₖ)
@. wₖ = spₖ * wₖ₋₁ - cpₖ * vₖ
wₖ .= spₖ .* wₖ₋₁ .- cpₖ .* vₖ
@kaxpby!(n, spₖ, vₖ, cpₖ, wₖ₋₁)
else
# [ẘₖ₋₂ w̄ₖ₋₁ vₖ] [cpₖ 0 spₖ] [1 0 0 ] = [wₖ₋₂ ẘₖ₋₁ w̄ₖ] ⟷ wₖ₋₂ = cpₖ * ẘₖ₋₂ + spₖ * vₖ
Expand Down
14 changes: 7 additions & 7 deletions src/qmr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -326,35 +326,35 @@ kwargs_qmr = (:c, :M, :N, :ldiv, :atol, :rtol, :itmax, :timemax, :verbose, :hist
if iter == 1
wₖ = wₖ₋₁
@kaxpy!(n, one(FC), vₖ, wₖ)
@. wₖ = wₖ / δₖ
wₖ .= wₖ ./ δₖ
end
# w₂ = (v₂ - λ₁w₁) / δ₂
if iter == 2
wₖ = wₖ₋₂
@kaxpy!(n, -λₖ₋₁, wₖ₋₁, wₖ)
@kaxpy!(n, one(FC), vₖ, wₖ)
@. wₖ = wₖ / δₖ
wₖ .= wₖ ./ δₖ
end
# wₖ = (vₖ - λₖ₋₁wₖ₋₁ - ϵₖ₋₂wₖ₋₂) / δₖ
if iter ≥ 3
@kscal!(n, -ϵₖ₋₂, wₖ₋₂)
wₖ = wₖ₋₂
@kaxpy!(n, -λₖ₋₁, wₖ₋₁, wₖ)
@kaxpy!(n, one(FC), vₖ, wₖ)
@. wₖ = wₖ / δₖ
wₖ .= wₖ ./ δₖ
end

# Compute solution xₖ.
# xₖ ← xₖ₋₁ + ζₖ * wₖ
@kaxpy!(n, ζₖ, wₖ, x)

# Compute vₖ₊₁ and uₖ₊₁.
@. vₖ₋₁ = vₖ # vₖ₋₁ ← vₖ
@. uₖ₋₁ = uₖ # uₖ₋₁ ← uₖ
@kcopy!(n, vₖ, vₖ₋₁) # vₖ₋₁ ← vₖ
@kcopy!(n, uₖ, uₖ₋₁) # uₖ₋₁ ← uₖ

if pᴴq ≠ zero(FC)
@. vₖ = q / βₖ₊₁ # βₖ₊₁vₖ₊₁ = q
@. uₖ = p / conj(γₖ₊₁) # γ̄ₖ₊₁uₖ₊₁ = p
vₖ .= q ./ βₖ₊₁ # βₖ₊₁vₖ₊₁ = q
uₖ .= p ./ conj(γₖ₊₁) # γ̄ₖ₊₁uₖ₊₁ = p
end

# Compute τₖ₊₁ = τₖ + ‖vₖ₊₁‖²
Expand Down
4 changes: 2 additions & 2 deletions src/symmlq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,9 @@ kwargs_symmlq = (:M, :ldiv, :transfer_to_cg, :λ, :λest, :atol, :rtol, :etol, :
mul!(Mv_next, A, v)
α = @kdotr(m, v, Mv_next) + λ
@kaxpy!(m, -oldβ, Mvold, Mv_next)
@. Mvold = Mv
@kcopy!(m, Mv, Mvold) # Mvold ← Mv
@kaxpy!(m, -α, Mv, Mv_next)
@. Mv = Mv_next
@kcopy!(m, Mv_next, Mv) # Mv ← Mv_next
MisI || mulorldiv!(v, M, Mv, ldiv)
β = @kdotr(m, v, Mv)
β < 0 && error("Preconditioner is not positive definite")
Expand Down
18 changes: 9 additions & 9 deletions src/tricg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -369,22 +369,22 @@ kwargs_tricg = (:M, :N, :ldiv, :spd, :snd, :flip, :τ, :ν, :atol, :rtol, :itmax
if iter == 1
# [ 1 0 ] [ gx₁ gy₁ ] = [ v₁ 0 ]
# [ δ̄₁ 1 ] [ gx₂ gy₂ ] [ 0 u₁ ]
@. gx₂ₖ₋₁ = vₖ
@. gx₂ₖ = - conj(δₖ) * gx₂ₖ₋₁
@. gy₂ₖ = uₖ
@kcopy!(m, vₖ, gx₂ₖ₋₁) # gx₂ₖ₋₁ ← vₖ
gx₂ₖ .= -conj(δₖ) .* gx₂ₖ₋₁
@kcopy!(n, uₖ, gy₂ₖ) # gy₂ₖ ← uₖ
else
# [ 0 σ̄ₖ 1 0 ] [ gx₂ₖ₋₃ gy₂ₖ₋₃ ] = [ vₖ 0 ]
# [ η̄ₖ λ̄ₖ δ̄ₖ 1 ] [ gx₂ₖ₋₂ gy₂ₖ₋₂ ] [ 0 uₖ ]
# [ gx₂ₖ₋₁ gy₂ₖ₋₁ ]
# [ gx₂ₖ gy₂ₖ ]
@. gx₂ₖ₋₁ = conj(ηₖ) * gx₂ₖ₋₁ + conj(λₖ) * gx₂ₖ
@. gy₂ₖ₋₁ = conj(ηₖ) * gy₂ₖ₋₁ + conj(λₖ) * gy₂ₖ
gx₂ₖ₋₁ .= conj(ηₖ) .* gx₂ₖ₋₁ .+ conj(λₖ) .* gx₂ₖ
gy₂ₖ₋₁ .= conj(ηₖ) .* gy₂ₖ₋₁ .+ conj(λₖ) .* gy₂ₖ

@. gx₂ₖ = vₖ - conj(σₖ) * gx₂ₖ
@. gy₂ₖ = - conj(σₖ) * gy₂ₖ
gx₂ₖ .= vₖ .- conj(σₖ) .* gx₂ₖ
gy₂ₖ .= .- conj(σₖ) .* gy₂ₖ

@. gx₂ₖ₋₁ = - gx₂ₖ₋₁ - conj(δₖ) * gx₂ₖ
@. gy₂ₖ₋₁ = uₖ - gy₂ₖ₋₁ - conj(δₖ) * gy₂ₖ
gx₂ₖ₋₁ .= .- gx₂ₖ₋₁ .- conj(δₖ) .* gx₂ₖ
gy₂ₖ₋₁ .= uₖ .- gy₂ₖ₋₁ .- conj(δₖ) .* gy₂ₖ

# g₂ₖ₋₃ == g₂ₖ and g₂ₖ₋₂ == g₂ₖ₋₁
@kswap(gx₂ₖ₋₁, gx₂ₖ)
Expand Down
16 changes: 8 additions & 8 deletions src/trilqr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ kwargs_trilqr = (:transfer_to_usymcg, :atol, :rtol, :itmax, :timemax, :verbose,
# Compute d̅ₖ.
if iter == 1
# d̅₁ = u₁
@. d̅ = uₖ
@kcopy!(n, uₖ, d̅) # d̅ ← uₖ
else
# d̅ₖ = s̄ₖ * d̅ₖ₋₁ - cₖ * uₖ
@kaxpby!(n, -cₖ, uₖ, conj(sₖ), d̅)
Expand Down Expand Up @@ -351,22 +351,22 @@ kwargs_trilqr = (:transfer_to_usymcg, :atol, :rtol, :itmax, :timemax, :verbose,
if iter == 2
wₖ₋₁ = wₖ₋₂
@kaxpy!(m, one(FC), vₖ₋₁, wₖ₋₁)
@. wₖ₋₁ = vₖ₋₁ / conj(δₖ₋₁)
wₖ₋₁ .= vₖ₋₁ ./ conj(δₖ₋₁)
end
# w₂ = (v₂ - λ̄₁w₁) / δ̄₂
if iter == 3
wₖ₋₁ = wₖ₋₃
@kaxpy!(m, one(FC), vₖ₋₁, wₖ₋₁)
@kaxpy!(m, -conj(λₖ₋₂), wₖ₋₂, wₖ₋₁)
@. wₖ₋₁ = wₖ₋₁ / conj(δₖ₋₁)
wₖ₋₁ .= wₖ₋₁ ./ conj(δₖ₋₁)
end
# wₖ₋₁ = (vₖ₋₁ - λ̄ₖ₋₂wₖ₋₂ - ϵ̄ₖ₋₃wₖ₋₃) / δ̄ₖ₋₁
if iter ≥ 4
@kscal!(m, -conj(ϵₖ₋₃), wₖ₋₃)
wₖ₋₁ = wₖ₋₃
@kaxpy!(m, one(FC), vₖ₋₁, wₖ₋₁)
@kaxpy!(m, -conj(λₖ₋₂), wₖ₋₂, wₖ₋₁)
@. wₖ₋₁ = wₖ₋₁ / conj(δₖ₋₁)
wₖ₋₁ .= wₖ₋₁ ./ conj(δₖ₋₁)
end

if iter ≥ 3
Expand Down Expand Up @@ -399,14 +399,14 @@ kwargs_trilqr = (:transfer_to_usymcg, :atol, :rtol, :itmax, :timemax, :verbose,
end

# Compute uₖ₊₁ and uₖ₊₁.
@. vₖ₋₁ = vₖ # vₖ₋₁ ← vₖ
@. uₖ₋₁ = uₖ # uₖ₋₁ ← uₖ
@kcopy!(m, vₖ, vₖ₋₁) # vₖ₋₁ ← vₖ
@kcopy!(n, uₖ, uₖ₋₁) # uₖ₋₁ ← uₖ

if βₖ₊₁ ≠ zero(T)
@. vₖ = q / βₖ₊₁ # βₖ₊₁vₖ₊₁ = q
vₖ .= q ./ βₖ₊₁ # βₖ₊₁vₖ₊₁ = q
end
if γₖ₊₁ ≠ zero(T)
@. uₖ = p / γₖ₊₁ # γₖ₊₁uₖ₊₁ = p
uₖ .= p ./ γₖ₊₁ # γₖ₊₁uₖ₊₁ = p
end

# Update ϵₖ₋₃, λₖ₋₂, δbarₖ₋₁, cₖ₋₁, sₖ₋₁, γₖ and βₖ.
Expand Down
Loading
Loading