Skip to content

Commit fb5a1cf

Browse files
committed
use one!
1 parent 7184550 commit fb5a1cf

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

‎src/implementations/exponential.jl‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,7 @@ function exponential!(A::AbstractMatrix, expA::AbstractMatrix, alg::MatrixFuncti
125125
scale = get(alg.kwargs, :balance, true) ? balance!(A)[2] : fill!(similar(A, R, size(A, 1)), one(R))
126126

127127
θ = LinearAlgebra.opnorm(A, 1)
128-
if iszero(θ)
129-
fill!(expA, zero(T))
130-
diagview(expA) .= one(T)
131-
return expA
132-
end
128+
iszero(θ) && return one!(expA)
133129

134130
order, squarings = taylor_order_and_squarings(θ, tol)
135131
squarings > 0 && rmul!(A, inv(convert(T, 2)^squarings))

0 commit comments

Comments
 (0)