Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
xtalax committed Mar 21, 2023
1 parent 92d307a commit 59dd393
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/solutions/solution_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ end

idxs_initialized(idxs) = isempty(idxs) || !isnothing(first(idxs))

# When you add symbolic save_idxs to a problem, give its solution type a dep_idxs
# field that is a Ref{Union{Vector{Nothing}, Vector{Int}}}. Then, when you call get_dep_idxs, it will
# check if the dep_idxs field is initialized. If it is, it will return the value. If it is not,
# it will call _get_dep_idxs to get the value, set the field, and return the value.
# You will also need to remove `dense_output = true` from the `build_explicit_observed_function`
# call in ModelingToolkit in its source system.
function get_dep_idxs(A::AbstractSciMLSolution)
if hasfield(typeof(A), :dep_idxs)
if idxs_initialized(A.dep_idxs[])
Expand Down

0 comments on commit 59dd393

Please sign in to comment.