Skip to content

Commit

Permalink
Use rmul! instead of broadcast for kscal!
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison committed Nov 4, 2024
1 parent 9536ef7 commit 8cdcf6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/krylov_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ knorm(n :: Integer, x :: AbstractVector{T}) where T <: FloatOrComplex = norm(x)
knorm_elliptic(n :: Integer, x :: AbstractVector{T}, y :: AbstractVector{T}) where T <: FloatOrComplex = (x === y) ? knorm(n, x) : sqrt(kdotr(n, x, y))

kscal!(n :: Integer, s :: T, x :: Vector{T}) where T <: BLAS.BlasFloat = BLAS.scal!(n, s, x, 1)
kscal!(n :: Integer, s :: T, x :: AbstractVector{T}) where T <: FloatOrComplex = (x .*= s)
kscal!(n :: Integer, s :: T, x :: AbstractVector{T}) where T <: FloatOrComplex = rmul!(x, s)
kscal!(n :: Integer, s :: T, x :: AbstractVector{Complex{T}}) where T <: AbstractFloat = kscal!(n, Complex{T}(s), x)

kaxpy!(n :: Integer, s :: T, x :: Vector{T}, y :: Vector{T}) where T <: BLAS.BlasFloat = BLAS.axpy!(n, s, x, 1, y, 1)
Expand Down

0 comments on commit 8cdcf6c

Please sign in to comment.