Skip to content

Commit 341bce8

Browse files
feat: add constructorof for DDEProblem
1 parent 4f3745b commit 341bce8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/problems/dde_problems.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,17 @@ struct DDEProblem{uType, tType, lType, lType2, isinplace, P, F, H, K, PT} <:
253253
end
254254
end
255255

256+
function ConstructionBase.constructorof(::Type{P}) where {P <: DDEProblem}
257+
function ctor(f, u0, h, tspan, p, constant_lags, dependent_lags, kw, neutral, order_discontinuity_t0, problem_type)
258+
if f isa AbstractDDEFunction
259+
iip = isinplace(f)
260+
else
261+
iip = isinplace(f, 5)
262+
end
263+
return DDEProblem{iip}(f, u0, h, tspan, p; kw..., constant_lags, dependent_lags, neutral, order_discontinuity_t0, problem_type)
264+
end
265+
end
266+
256267
DDEProblem(f, args...; kwargs...) = DDEProblem(DDEFunction(f), args...; kwargs...)
257268

258269
function DDEProblem(f::AbstractDDEFunction, args...; kwargs...)

0 commit comments

Comments
 (0)