Skip to content
This repository was archived by the owner on Jul 19, 2023. It is now read-only.

Commit e59ce97

Browse files
Merge branch 'expm'
2 parents 0d9401c + c3fa309 commit e59ce97

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/array_operator.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,15 @@ Base.issymmetric(L::DiffEqArrayOperator) = L._issymmetric
5252
Base.ishermitian(L::DiffEqArrayOperator) = L._ishermitian
5353
Base.isposdef(L::DiffEqArrayOperator) = L._isposdef
5454
DiffEqBase.is_constant(L::DiffEqArrayOperator) = L.update_func == DEFAULT_UPDATE_FUNC
55-
Base.expm(L::DiffEqArrayOperator) = expm(L.α.coeff*L.A)
55+
function Base.expm(L::DiffEqArrayOperator)
56+
tmp = full(L.A) # If not lazy then this is a no-op
57+
tmp .*= L.α.coeff
58+
out = expm(tmp)
59+
if tmp === L.A
60+
L.A ./= L.α.coeff # Undo change if not lazy
61+
end
62+
out
63+
end
5664
DiffEqBase.has_expm(L::DiffEqArrayOperator) = true
5765
Base.size(L::DiffEqArrayOperator) = size(L.A)
5866
DiffEqBase.update_coefficients!(L::DiffEqArrayOperator,t,u) = (L.update_func(L.A,t,u); L.α = L.α(t); nothing)

0 commit comments

Comments
 (0)