Skip to content

Commit

Permalink
feat: include pretty printing of derivative operators
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Dec 8, 2024
1 parent 74d2d33 commit 73584d3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/ComposableExpression.jl
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,20 @@ struct OperatorDerivative{F,degree,arg} <: Function
return new{F,degree,arg}(op)
end
end
function Base.show(io::IO, g::OperatorDerivative{F,degree,arg}) where {F,degree,arg}
print(io, "")
if degree == 2
if arg == 1
print(io, "")
elseif arg == 2
print(io, "")
end
end
print(io, g.op)
return nothing
end
Base.show(io::IO, ::MIME"text/plain", g::OperatorDerivative) = show(io, g)

function (d::OperatorDerivative{F,1,1})(x) where {F}
return ForwardDiff.derivative(d.op, x)
end
Expand Down

0 comments on commit 73584d3

Please sign in to comment.