Skip to content

Commit

Permalink
feat: add is_split_function and split_function_f_wrapper traits
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Dec 12, 2024
1 parent 9040908 commit 51d8f76
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/scimlfunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4601,6 +4601,20 @@ has_Wfact_t(f::JacobianWrapper) = has_Wfact_t(f.f)
has_paramjac(f::JacobianWrapper) = has_paramjac(f.f)
has_colorvec(f::JacobianWrapper) = has_colorvec(f.f)

is_split_function(x) = is_split_function(typeof(x))
is_split_function(::Type) = false
function is_split_function(::Type{T}) where {T <: Union{
SplitFunction, SplitSDEFunction, DynamicalODEFunction,
DynamicalDDEFunction, DynamicalSDEFunction}}
true
end

split_function_f_wrapper(::Type{<:SplitFunction}) = ODEFunction
split_function_f_wrapper(::Type{<:SplitSDEFunction}) = SDEFunction
split_function_f_wrapper(::Type{<:DynamicalODEFunction}) = ODEFunction
split_function_f_wrapper(::Type{<:DynamicalDDEFunction}) = DDEFunction
split_function_f_wrapper(::Type{<:DynamicalSDEFunction}) = DDEFunction

######### Additional traits

islinear(::AbstractDiffEqFunction) = false
Expand Down

0 comments on commit 51d8f76

Please sign in to comment.