Skip to content

Commit

Permalink
Merge pull request #761 from jClugstor/solution_stripping
Browse files Browse the repository at this point in the history
Lazy interpolation trait, stripping interpolation
  • Loading branch information
ChrisRackauckas authored Aug 8, 2024
2 parents 56ba881 + 072e352 commit a14ebec
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/alg_traits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ Defaults to false.
"""
isdiscrete(alg::AbstractDEAlgorithm) = false

"""
has_lazy_interpolation(alg::AbstractDEAlgorithm)
Trait declaration for whether an algorithm computes the solution interpolation lazily.
Defaults to false.
"""
has_lazy_interpolation(alg::AbstractDEAlgorithm) = false
"""
allowsbounds(opt)
Expand Down
11 changes: 11 additions & 0 deletions src/interpolation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -608,3 +608,14 @@ Constant Interpolation
@. out = 0
end
end

"""
strip_interpolation(id::AbstractDiffEqInterpolation)
Returns a copy of the interpolation stripped of its function, to accommodate serialization.
If the interpolation object has no function, returns the interpolation object as is.
"""
strip_interpolation(id::AbstractDiffEqInterpolation) = id
strip_interpolation(id::HermiteInterpolation) = id
strip_interpolation(id::LinearInterpolation) = id
strip_interpolation(id::ConstantInterpolation) = id
1 change: 1 addition & 0 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -537,3 +537,4 @@ the arity of a function is computed with `numargs`
See also: `prepare_initial_state`.
"""
prepare_function(f) = f

0 comments on commit a14ebec

Please sign in to comment.