Skip to content

Commit

Permalink
Fix D instantiation
Browse files Browse the repository at this point in the history
  • Loading branch information
YingboMa committed Feb 19, 2024
1 parent b7f8b5c commit 0a90248
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/diff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ end
function (D::Differential)(x)
x = unwrap(x)
if isarraysymbolic(x)
wrap(array_term(D, x))
array_term(D, x)
else
wrap(term(D, x))
term(D, x)
end
end
(D::Differential)(x::Num) = Num(D(value(x)))
(D::Differential)(x::Union{Num, Arr}) = wrap(D(unwrap(x)))
(D::Differential)(x::Complex{Num}) = wrap(ComplexTerm{Real}(D(unwrap(real(x))), D(unwrap(imag(x)))))
SymbolicUtils.promote_symtype(::Differential, T) = T

Expand Down

0 comments on commit 0a90248

Please sign in to comment.