Skip to content

Commit f900c01

Browse files
feat: add constructorof for DDEProblem
1 parent 5850b64 commit f900c01

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/problems/dde_problems.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,19 @@ 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,
258+
kw, neutral, order_discontinuity_t0, problem_type)
259+
if f isa AbstractDDEFunction
260+
iip = isinplace(f)
261+
else
262+
iip = isinplace(f, 5)
263+
end
264+
return DDEProblem{iip}(f, u0, h, tspan, p; kw..., constant_lags, dependent_lags,
265+
neutral, order_discontinuity_t0, problem_type)
266+
end
267+
end
268+
256269
DDEProblem(f, args...; kwargs...) = DDEProblem(DDEFunction(f), args...; kwargs...)
257270

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

0 commit comments

Comments
 (0)