Skip to content

Commit 5085cfa

Browse files
committed
use one!
1 parent c83fc9c commit 5085cfa

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
@@ -118,11 +118,7 @@ function exponential!(A::AbstractMatrix, expA::AbstractMatrix, alg::MatrixFuncti
118118
scale = get(alg.kwargs, :balance, true) ? balance!(A)[2] : fill!(similar(A, R, size(A, 1)), one(R))
119119

120120
θ = LinearAlgebra.opnorm(A, 1)
121-
if iszero(θ)
122-
fill!(expA, zero(T))
123-
diagview(expA) .= one(T)
124-
return expA
125-
end
121+
iszero(θ) && return one!(expA)
126122

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

0 commit comments

Comments
 (0)