Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/SciMLBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ $(TYPEDEF)

Base for types defining SciML functions.
"""
abstract type AbstractSciMLFunction{iip} <: Function end
abstract type AbstractSciMLFunction{iip} end

"""
$(TYPEDEF)
Expand Down Expand Up @@ -622,7 +622,7 @@ abstract type AbstractHistoryFunction end
"""
$(TYPEDEF)
"""
abstract type AbstractReactionNetwork <: Function end
abstract type AbstractReactionNetwork end

"""
$(TYPEDEF)
Expand Down
14 changes: 8 additions & 6 deletions src/function_wrappers.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
mutable struct TimeGradientWrapper{iip, fType, uType, P} <: AbstractSciMLFunction{iip}
abstract type AbstractWrappedFunction{iip} end
isinplace(f::AbstractWrappedFunction{iip}) where {iip} = iip
mutable struct TimeGradientWrapper{iip, fType, uType, P} <: AbstractWrappedFunction{iip}
f::fType
uprev::uType
p::P
Expand All @@ -18,7 +20,7 @@ end

(ff::TimeGradientWrapper{false})(t) = ff.f(ff.uprev, ff.p, t)

mutable struct UJacobianWrapper{iip, fType, tType, P} <: AbstractSciMLFunction{iip}
mutable struct UJacobianWrapper{iip, fType, tType, P} <: AbstractWrappedFunction{iip}
f::fType
t::tType
p::P
Expand All @@ -41,7 +43,7 @@ end
(ff::UJacobianWrapper{false})(uprev) = ff.f(uprev, ff.p, ff.t)
(ff::UJacobianWrapper{false})(uprev, p, t) = ff.f(uprev, p, t)

mutable struct TimeDerivativeWrapper{iip, F, uType, P} <: AbstractSciMLFunction{iip}
mutable struct TimeDerivativeWrapper{iip, F, uType, P} <: AbstractWrappedFunction{iip}
f::F
u::uType
p::P
Expand All @@ -58,7 +60,7 @@ end
(ff::TimeDerivativeWrapper{true})(du1, t) = ff.f(du1, ff.u, ff.p, t)
(ff::TimeDerivativeWrapper{true})(t) = (du1 = similar(ff.u); ff.f(du1, ff.u, ff.p, t); du1)

mutable struct UDerivativeWrapper{iip, F, tType, P} <: AbstractSciMLFunction{iip}
mutable struct UDerivativeWrapper{iip, F, tType, P} <: AbstractWrappedFunction{iip}
f::F
t::tType
p::P
Expand All @@ -73,7 +75,7 @@ UDerivativeWrapper(f::F, t, p) where {F} = UDerivativeWrapper{isinplace(f, 4)}(f
(ff::UDerivativeWrapper{true})(du1, u) = ff.f(du1, u, ff.p, ff.t)
(ff::UDerivativeWrapper{true})(u) = (du1 = similar(u); ff.f(du1, u, ff.p, ff.t); du1)

mutable struct ParamJacobianWrapper{iip, fType, tType, uType} <: AbstractSciMLFunction{iip}
mutable struct ParamJacobianWrapper{iip, fType, tType, uType} <: AbstractWrappedFunction{iip}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
mutable struct ParamJacobianWrapper{iip, fType, tType, uType} <: AbstractWrappedFunction{iip}
mutable struct ParamJacobianWrapper{iip, fType, tType, uType} <:
AbstractWrappedFunction{iip}

f::fType
t::tType
u::uType
Expand All @@ -95,7 +97,7 @@ function (ff::ParamJacobianWrapper{false})(du1, p)
du1 .= ff.f(ff.u, p, ff.t)
end

mutable struct JacobianWrapper{iip, fType, pType} <: AbstractSciMLFunction{iip}
mutable struct JacobianWrapper{iip, fType, pType} <: AbstractWrappedFunction{iip}
f::fType
p::pType
end
Expand Down
Loading