Skip to content

Commit

Permalink
Improve computation
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison committed Sep 12, 2023
1 parent f2f8bd7 commit d89c432
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/block_krylov_processes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function gs(A::AbstractMatrix{FC}) where FC <: FloatOrComplex
@kaxpy!(n, -R[i,j], qᵢ, qⱼ) # qⱼ = qⱼ - rᵢⱼqᵢ
end
R[j,j] = @knrm2(n, qⱼ) # rⱼⱼ = ‖qⱼ‖
qⱼ .= qⱼ ./ R[j,j] # qⱼ = qⱼ / rⱼⱼ
qⱼ ./= R[j,j] # qⱼ = qⱼ / rⱼⱼ
end
return Q, R
end
Expand All @@ -44,7 +44,7 @@ function mgs(A::AbstractMatrix{FC}) where FC <: FloatOrComplex
for i = 1:k
qᵢ = view(Q,:,i)
R[i,i] = @knrm2(n, qᵢ) # rᵢᵢ = ‖qᵢ‖
qᵢ .= qᵢ ./ R[i,i] # qᵢ = qᵢ / rᵢᵢ
qᵢ ./= R[i,i] # qᵢ = qᵢ / rᵢᵢ
for j = i+1:k
qⱼ = view(Q,:,j)
R[i,j] = @kdot(n, qᵢ, qⱼ) # rᵢⱼ = ⟨qᵢ , qⱼ⟩
Expand Down

0 comments on commit d89c432

Please sign in to comment.