Skip to content

Commit 67b0cc3

Browse files
author
oscarddssmith
committed
simplify
1 parent 9112637 commit 67b0cc3

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/problems/ode_problems.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ function ODEProblem(f, u0, tspan, p = NullParameters(); kwargs...)
200200
_tspan = promote_tspan(tspan)
201201
_f = if iip
202202
out = copy(u0) # TODO: do this properly
203-
ODEFunction{iip, FullSpecialize}(DUMB_WRAPPER(out, u0, p, first(_tspan), ODE_F_WRAPPER(f)))
203+
ODEFunction{iip, FullSpecialize}(DUMB_WRAPPER(p, first(_tspan), ODE_F_WRAPPER(f)))
204204
else
205205
_f = ODEFunction{iip, DEFAULT_SPECIALIZATION}(f)
206206
end

src/scimlfunctions.jl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2419,23 +2419,19 @@ end
24192419
mutable struct ODE_F_WRAPPER{F}
24202420
const f::F
24212421
end
2422-
mutable struct DUMB_WRAPPER{OUT, U, P, T}
2423-
out::OUT
2424-
u::U
2422+
mutable struct DUMB_WRAPPER{P, T}
24252423
p::P
24262424
t::T
24272425
f::ODE_F_WRAPPER
24282426
end
2429-
function (w::ODE_F_WRAPPER)(d::DUMB_WRAPPER)
2430-
w.f(d.out, d.u, d.p, d.t)
2427+
function (w::ODE_F_WRAPPER)(out, u, d::DUMB_WRAPPER)
2428+
w.f(out, u, d.p, d.t)
24312429
return nothing
24322430
end
24332431
function (w::DUMB_WRAPPER)(out, u, p, t)
2434-
w.out = out
2435-
w.u = u
24362432
w.p = p
24372433
w.t = t
2438-
w.f(w)
2434+
w.f(out, u, w)
24392435
return nothing
24402436
end
24412437

0 commit comments

Comments
 (0)