Skip to content

Commit

Permalink
lose some unnecessary inlines
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Nov 16, 2018
1 parent 99f5283 commit ac6c3b2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
21 changes: 8 additions & 13 deletions src/integrators/integrator_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,20 @@ function set_proposed_dt!(integrator::ODEIntegrator,integrator2::ODEIntegrator)
integrator.dtacc = integrator2.dtacc
end

@inline function DiffEqBase.get_du(integrator::ODEIntegrator)
integrator.fsallast
end

@inline function DiffEqBase.get_du!(out,integrator::ODEIntegrator)
out .= integrator.fsallast
end
DiffEqBase.get_du(integrator::ODEIntegrator) = integrator.fsallast
DiffEqBase.get_du!(out,integrator::ODEIntegrator) = (out .= integrator.fsallast)

#TODO: Bigger caches for most algorithms
@inline DiffEqBase.get_tmp_cache(integrator::ODEIntegrator) =
DiffEqBase.get_tmp_cache(integrator::ODEIntegrator) =
get_tmp_cache(integrator::ODEIntegrator,integrator.alg,integrator.cache)
# avoid method ambiguity
for typ in (OrdinaryDiffEqAlgorithm,OrdinaryDiffEqNewtonAdaptiveAlgorithm,OrdinaryDiffEqRosenbrockAdaptiveAlgorithm)
@eval @inline DiffEqBase.get_tmp_cache(integrator,alg::$typ,cache::OrdinaryDiffEqConstantCache) = nothing
@eval DiffEqBase.get_tmp_cache(integrator,alg::$typ,cache::OrdinaryDiffEqConstantCache) = nothing
end
@inline DiffEqBase.get_tmp_cache(integrator,alg::OrdinaryDiffEqAlgorithm,cache) = (cache.tmp,)
@inline DiffEqBase.get_tmp_cache(integrator,alg::OrdinaryDiffEqNewtonAdaptiveAlgorithm,cache) = (cache.tmp,cache.atmp)
@inline DiffEqBase.get_tmp_cache(integrator,alg::OrdinaryDiffEqRosenbrockAdaptiveAlgorithm,cache) = (cache.tmp,cache.linsolve_tmp)
@inline DiffEqBase.get_tmp_cache(integrator,alg::CompositeAlgorithm, cache) = get_tmp_cache(integrator, integrator.alg.algs[1], cache.caches[1])
DiffEqBase.get_tmp_cache(integrator,alg::OrdinaryDiffEqAlgorithm,cache) = (cache.tmp,)
DiffEqBase.get_tmp_cache(integrator,alg::OrdinaryDiffEqNewtonAdaptiveAlgorithm,cache) = (cache.tmp,cache.atmp)
DiffEqBase.get_tmp_cache(integrator,alg::OrdinaryDiffEqRosenbrockAdaptiveAlgorithm,cache) = (cache.tmp,cache.linsolve_tmp)
DiffEqBase.get_tmp_cache(integrator,alg::CompositeAlgorithm, cache) = get_tmp_cache(integrator, integrator.alg.algs[1], cache.caches[1])

full_cache(integrator::ODEIntegrator) = full_cache(integrator.cache)

Expand Down
2 changes: 1 addition & 1 deletion src/iterator_interface.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@inline function step!(integrator::ODEIntegrator)
function step!(integrator::ODEIntegrator)
if integrator.opts.advance_to_tstop
@inbounds while integrator.tdir*integrator.t < integrator.tdir*top(integrator.opts.tstops)
loopheader!(integrator)
Expand Down
2 changes: 1 addition & 1 deletion src/tableaus/verner_tableaus.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3243,6 +3243,6 @@ end

const Vern9CCFloat64 = Vern9ConstantCache(Float64,Float64)

function Vern9ConstantCache(::Type{Float64},::Type{Float64})
Base.@pure function Vern9ConstantCache(::Type{Float64},::Type{Float64})
Vern9CCFloat64
end

0 comments on commit ac6c3b2

Please sign in to comment.