@@ -948,7 +948,8 @@ dt: the time step
948948
949949```julia
950950ImplicitDiscreteFunction{iip,specialize}(f;
951- analytic = __has_analytic(f) ? f.analytic : nothing)
951+ analytic = __has_analytic(f) ? f.analytic : nothing,
952+ resid_prototype = __has_resid_prototype(f) ? f.resid_prototype : nothing)
952953```
953954
954955Note that only the function `f` itself is required. This function should
@@ -973,12 +974,13 @@ For more details on this argument, see the ODEFunction documentation.
973974
974975The fields of the ImplicitDiscreteFunction type directly match the names of the inputs.
975976"""
976- struct ImplicitDiscreteFunction{iip, specialize, F, Ta, O, SYS, ID} < :
977+ struct ImplicitDiscreteFunction{iip, specialize, F, Ta, O, SYS, RP, ID} < :
977978 AbstractDiscreteFunction{iip}
978979 f:: F
979980 analytic:: Ta
980981 observed:: O
981982 sys:: SYS
983+ resid_prototype:: RP
982984 initialization_data:: ID
983985end
984986
@@ -3064,6 +3066,9 @@ function ImplicitDiscreteFunction{iip, specialize}(f;
30643066 observed = __has_observed (f) ?
30653067 f. observed :
30663068 DEFAULT_OBSERVED,
3069+ resid_prototype = __has_resid_prototype (f) ?
3070+ f. resid_prototype :
3071+ nothing ,
30673072 sys = __has_sys (f) ? f. sys : nothing ,
30683073 initialization_data = __has_initialization_data (f) ? f. initialization_data :
30693074 nothing ) where {
@@ -3074,39 +3079,40 @@ function ImplicitDiscreteFunction{iip, specialize}(f;
30743079 sys = sys_or_symbolcache (sys, syms, paramsyms, indepsym)
30753080
30763081 if specialize === NoSpecialize
3077- ImplicitDiscreteFunction {iip, specialize, Any, Any, Any, Any, Any} (_f,
3082+ ImplicitDiscreteFunction {iip, specialize, Any, Any, Any, Any, Any, Any } (_f,
30783083 analytic,
30793084 observed,
30803085 sys,
3086+ resid_prototype,
30813087 initialization_data)
30823088 else
30833089 ImplicitDiscreteFunction{
3084- iip, specialize, typeof (_f), typeof (analytic), typeof (observed), typeof (sys),
3090+ iip, specialize, typeof (_f), typeof (analytic), typeof (observed), typeof (sys), typeof (resid_prototype ),
30853091 typeof (initialization_data)}(
3086- _f, analytic, observed, sys, initialization_data)
3092+ _f, analytic, observed, sys, resid_prototype, initialization_data)
30873093 end
30883094end
30893095
30903096function ImplicitDiscreteFunction {iip} (f; kwargs... ) where {iip}
30913097 ImplicitDiscreteFunction {iip, FullSpecialize} (f; kwargs... )
30923098end
30933099ImplicitDiscreteFunction {iip} (f:: ImplicitDiscreteFunction ; kwargs... ) where {iip} = f
3094- function ImplicitDiscreteFunction (f; kwargs... )
3095- ImplicitDiscreteFunction {isinplace(f, 5), FullSpecialize} (f; kwargs... )
3100+ function ImplicitDiscreteFunction (f; resid_prototype = __has_resid_prototype (f) ? f . resid_prototype : nothing , kwargs... )
3101+ ImplicitDiscreteFunction {isinplace(f, 5), FullSpecialize} (f; resid_prototype, kwargs... )
30963102end
30973103ImplicitDiscreteFunction (f:: ImplicitDiscreteFunction ; kwargs... ) = f
30983104
30993105function unwrapped_f (f:: ImplicitDiscreteFunction , newf = unwrapped_f (f. f))
31003106 specialize = specialization (f)
31013107
31023108 if specialize === NoSpecialize
3103- ImplicitDiscreteFunction{isinplace (f, 6 ), specialize, Any, Any,
3104- Any, Any, Any}(newf, f. analytic, f. observed, f. sys, f. initialization_data)
3109+ ImplicitDiscreteFunction{isinplace (f, 5 ), specialize, Any , Any, Any,
3110+ Any, Any, Any}(newf, f. analytic, f. observed, f. sys, f. resid_prototype, f . initialization_data)
31053111 else
3106- ImplicitDiscreteFunction{isinplace (f, 6 ), specialize, typeof (newf),
3112+ ImplicitDiscreteFunction{isinplace (f, 5 ), specialize, typeof (newf),
31073113 typeof (f. analytic),
3108- typeof (f. observed), typeof (f. sys), typeof (f. initialization_data)}(newf,
3109- f. analytic, f. observed, f. sys, f. initialization_data)
3114+ typeof (f. observed), typeof (f. sys), typeof (resid_prototype), typeof ( f. initialization_data)}(newf,
3115+ f. analytic, f. observed, f. sys, f. resid_prototype, f . initialization_data)
31103116 end
31113117end
31123118
0 commit comments