Skip to content

Commit 7f5c4a2

Browse files
Move norecompile of ODEFunction to DiffEqBase
1 parent bfc028d commit 7f5c4a2

File tree

2 files changed

+2
-45
lines changed

2 files changed

+2
-45
lines changed

src/problems/ode_problems.jl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,9 @@ struct ODEProblem{uType,tType,isinplace,P,F,K,PT} <:
5252

5353
@add_kwonly function ODEProblem{iip,recompile}(f,u0,tspan,p=NullParameters();kwargs...) where {iip,recompile}
5454
if !recompile
55-
if iip
56-
ODEProblem{iip}(wrapfun_iip(f,(u0,u0,p,tspan[1])),u0,tspan,p;kwargs...)
57-
else
58-
ODEProblem{iip}(wrapfun_oop(f,(u0,p,tspan[1])),u0,tspan,p;kwargs...)
59-
end
55+
ODEProblem{iip}(ODEFunction{iip,recompile}(f), u0, tspan, p; kwargs...)
6056
else
61-
ODEProblem{iip}(f,u0,tspan,p;kwargs...)
57+
ODEProblem{iip}(f, u0, tspan, p; kwargs...)
6258
end
6359
end
6460
end

src/scimlfunctions.jl

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -475,45 +475,6 @@ function ODEFunction{iip,true}(f;
475475
jvp, vjp, jac_prototype, sparsity, Wfact,
476476
Wfact_t, paramjac, syms, indepsym, observed, _colorvec)
477477
end
478-
function ODEFunction{iip,false}(f;
479-
mass_matrix=I,
480-
analytic=nothing,
481-
tgrad=nothing,
482-
jac=nothing,
483-
jvp=nothing,
484-
vjp=nothing,
485-
jac_prototype=nothing,
486-
sparsity=jac_prototype,
487-
Wfact=nothing,
488-
Wfact_t=nothing,
489-
paramjac = nothing,
490-
syms = nothing,
491-
indepsym = nothing,
492-
observed = DEFAULT_OBSERVED,
493-
colorvec = nothing) where iip
494-
495-
if jac === nothing && isa(jac_prototype, AbstractDiffEqLinearOperator)
496-
if iip
497-
jac = update_coefficients! #(J,u,p,t)
498-
else
499-
jac = (u,p,t) -> update_coefficients!(deepcopy(jac_prototype),u,p,t)
500-
end
501-
end
502-
503-
if jac_prototype !== nothing && colorvec === nothing && ArrayInterface.fast_matrix_colors(jac_prototype)
504-
_colorvec = ArrayInterface.matrix_colors(jac_prototype)
505-
else
506-
_colorvec = colorvec
507-
end
508-
509-
ODEFunction{iip,
510-
Any, Any, Any, Any, Any,
511-
Any, Any, Any, Any, Any,
512-
Any, Any, typeof(syms), typeof(indepsym), Any, typeof(_colorvec)}(
513-
f, mass_matrix, analytic, tgrad, jac,
514-
jvp, vjp, jac_prototype, sparsity, Wfact,
515-
Wfact_t, paramjac, syms, indepsym, observed, _colorvec)
516-
end
517478
ODEFunction{iip}(f; kwargs...) where iip = ODEFunction{iip,RECOMPILE_BY_DEFAULT}(f; kwargs...)
518479
ODEFunction{iip}(f::ODEFunction; kwargs...) where iip = f
519480
ODEFunction(f; kwargs...) = ODEFunction{isinplace(f, 4),RECOMPILE_BY_DEFAULT}(f; kwargs...)

0 commit comments

Comments
 (0)