Skip to content

Commit

Permalink
a fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xtalax committed Aug 1, 2023
1 parent 03ac562 commit 69c1265
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/diff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -822,14 +822,13 @@ end

function LinearAlgebra.dot(D::ArrayDifferentialOperator, x::SymVec)
@assert length(D.vars) == length(x) "Vector must be same length as vars in Operator $(D.name)."
_call(d, x) = d(x)
sum(_call, zip(D.differentials, x))
end
LinearAlgebra.dot(D::ArrayDifferentialOperator, x::Arr) = Arr(D value(x))

function LinearAlgebra.dot(x::SymVec, D::ArrayDifferentialOperator)
@assert length(D.vars) == length(x) "Vector must be same length as vars in Operator $(D.name)."
(x) -> sum(D -> D(x), D.differentials)
(x) -> sum((X, D) -> X*D(x), zip(x, D.differentials))
end
LinearAlgebra.dot(x::Arr, D::ArrayDifferentialOperator) = value(x) D

Expand Down

0 comments on commit 69c1265

Please sign in to comment.