Skip to content

Commit

Permalink
Merge pull request #945 from prbzrg/have-algext
Browse files Browse the repository at this point in the history
Simplify `:alg` extraction
  • Loading branch information
ChrisRackauckas authored Oct 19, 2023
2 parents 301dd29 + 319fd62 commit d9c3e74
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 117 deletions.
12 changes: 6 additions & 6 deletions ext/DiffEqBaseReverseDiffExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,23 +76,23 @@ end
end

# `ReverseDiff.TrackedArray`
function DiffEqBase.solve_up(prob::DiffEqBase.DEProblem,
function DiffEqBase.solve_up(prob::DiffEqBase.AbstractDEProblem,
sensealg::Union{
SciMLBase.AbstractOverloadingSensitivityAlgorithm,
Nothing}, u0::ReverseDiff.TrackedArray,
p::ReverseDiff.TrackedArray, args...; kwargs...)
ReverseDiff.track(DiffEqBase.solve_up, prob, sensealg, u0, p, args...; kwargs...)
end

function DiffEqBase.solve_up(prob::DiffEqBase.DEProblem,
function DiffEqBase.solve_up(prob::DiffEqBase.AbstractDEProblem,
sensealg::Union{
SciMLBase.AbstractOverloadingSensitivityAlgorithm,
Nothing}, u0, p::ReverseDiff.TrackedArray,
args...; kwargs...)
ReverseDiff.track(DiffEqBase.solve_up, prob, sensealg, u0, p, args...; kwargs...)
end

function DiffEqBase.solve_up(prob::DiffEqBase.DEProblem,
function DiffEqBase.solve_up(prob::DiffEqBase.AbstractDEProblem,
sensealg::Union{
SciMLBase.AbstractOverloadingSensitivityAlgorithm,
Nothing}, u0::ReverseDiff.TrackedArray, p,
Expand All @@ -101,7 +101,7 @@ function DiffEqBase.solve_up(prob::DiffEqBase.DEProblem,
end

# `AbstractArray{<:ReverseDiff.TrackedReal}`
function DiffEqBase.solve_up(prob::DiffEqBase.DEProblem,
function DiffEqBase.solve_up(prob::DiffEqBase.AbstractDEProblem,
sensealg::Union{
SciMLBase.AbstractOverloadingSensitivityAlgorithm,
Nothing},
Expand All @@ -112,7 +112,7 @@ function DiffEqBase.solve_up(prob::DiffEqBase.DEProblem,
kwargs...)
end

function DiffEqBase.solve_up(prob::DiffEqBase.DEProblem,
function DiffEqBase.solve_up(prob::DiffEqBase.AbstractDEProblem,
sensealg::Union{
SciMLBase.AbstractOverloadingSensitivityAlgorithm,
Nothing}, u0,
Expand All @@ -121,7 +121,7 @@ function DiffEqBase.solve_up(prob::DiffEqBase.DEProblem,
DiffEqBase.solve_up(prob, sensealg, u0, reduce(vcat, p), args...; kwargs...)
end

function DiffEqBase.solve_up(prob::DiffEqBase.DEProblem,
function DiffEqBase.solve_up(prob::DiffEqBase.AbstractDEProblem,
sensealg::Union{
SciMLBase.AbstractOverloadingSensitivityAlgorithm,
Nothing}, u0::ReverseDiff.TrackedArray,
Expand Down
6 changes: 3 additions & 3 deletions ext/DiffEqBaseTrackerExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,23 @@ end
end
@inline DiffEqBase.ODE_DEFAULT_NORM(u::Tracker.TrackedReal, t::Tracker.TrackedReal) = abs(u)

function DiffEqBase.solve_up(prob::DiffEqBase.DEProblem,
function DiffEqBase.solve_up(prob::DiffEqBase.AbstractDEProblem,
sensealg::Union{
SciMLBase.AbstractOverloadingSensitivityAlgorithm,
Nothing}, u0::Tracker.TrackedArray,
p::Tracker.TrackedArray, args...; kwargs...)
Tracker.track(DiffEqBase.solve_up, prob, sensealg, u0, p, args...; kwargs...)
end

function DiffEqBase.solve_up(prob::DiffEqBase.DEProblem,
function DiffEqBase.solve_up(prob::DiffEqBase.AbstractDEProblem,
sensealg::Union{
SciMLBase.AbstractOverloadingSensitivityAlgorithm,
Nothing}, u0::Tracker.TrackedArray, p, args...;
kwargs...)
Tracker.track(DiffEqBase.solve_up, prob, sensealg, u0, p, args...; kwargs...)
end

function DiffEqBase.solve_up(prob::DiffEqBase.DEProblem,
function DiffEqBase.solve_up(prob::DiffEqBase.AbstractDEProblem,
sensealg::Union{
SciMLBase.AbstractOverloadingSensitivityAlgorithm,
Nothing}, u0, p::Tracker.TrackedArray, args...;
Expand Down
6 changes: 3 additions & 3 deletions src/DiffEqBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ PrecompileTools.@recompile_invalidations begin
import PreallocationTools

import FunctionWrappersWrappers

using SciMLBase

using SciMLOperators: AbstractSciMLOperator, AbstractSciMLScalarOperator

using SciMLBase: @def, DEIntegrator, DEProblem,
using SciMLBase: @def, DEIntegrator, AbstractDEProblem,
AbstractDiffEqInterpolation,
DECallback, AbstractDEOptions, DECache, AbstractContinuousCallback,
AbstractDiscreteCallback, AbstractLinearProblem, AbstractNonlinearProblem,
AbstractOptimizationProblem, AbstractSteadyStateProblem,
AbstractJumpProblem,
AbstractNoiseProblem, AbstractEnsembleProblem, AbstractDynamicalODEProblem,
DEAlgorithm, StandardODEProblem, AbstractIntegralProblem,
AbstractDEAlgorithm, StandardODEProblem, AbstractIntegralProblem,
AbstractSensitivityAlgorithm, AbstractODEAlgorithm,
AbstractSDEAlgorithm, AbstractDDEAlgorithm, AbstractDAEAlgorithm,
AbstractSDDEAlgorithm, AbstractRODEAlgorithm, DAEInitializationAlgorithm,
Expand Down
Loading

0 comments on commit d9c3e74

Please sign in to comment.