Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/problems/linear_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A utility struct stored inside `LinearProblem` to enable a symbolic interface.

$(TYPEDFIELDS)
"""
struct SymbolicLinearInterface{F1, F2, S, M}
struct SymbolicLinearInterface{F1, F2, S, O, M}
"""
A function which takes `A` and the parameter object `p` and updates `A` in-place.
"""
Expand All @@ -21,6 +21,11 @@ struct SymbolicLinearInterface{F1, F2, S, M}
"""
sys::S
"""
A function which when given a symbolic expression returns a function `(u, p)`
that computes the expression.
"""
observed::O
"""
Arbitrary metadata useful for the symbolic backend.
"""
metadata::M
Expand All @@ -31,6 +36,17 @@ has_sys(::SymbolicLinearInterface) = true

SymbolicIndexingInterface.symbolic_container(sli::SymbolicLinearInterface) = sli.sys

function SymbolicIndexingInterface.observed(fn::SymbolicLinearInterface, sym)
if fn.observed !== nothing
fn.observed(sym)
elseif fn.sys !== nothing
SymbolicIndexingInterface.observed(fn.sys, sym)
else
error("This `LinearProblem` does not support computing observed quantities.")
end
end


@doc doc"""

Defines a linear system problem.
Expand Down
Loading