@@ -948,7 +948,8 @@ dt: the time step
948
948
949
949
```julia
950
950
ImplicitDiscreteFunction{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)
952
953
```
953
954
954
955
Note that only the function `f` itself is required. This function should
@@ -3065,6 +3066,9 @@ function ImplicitDiscreteFunction{iip, specialize}(f;
3065
3066
observed = __has_observed (f) ?
3066
3067
f. observed :
3067
3068
DEFAULT_OBSERVED,
3069
+ resid_prototype = __has_resid_prototype (f) ?
3070
+ f. resid_prototype :
3071
+ nothing ,
3068
3072
sys = __has_sys (f) ? f. sys : nothing ,
3069
3073
initialization_data = __has_initialization_data (f) ? f. initialization_data :
3070
3074
nothing ) where {
@@ -3075,16 +3079,17 @@ function ImplicitDiscreteFunction{iip, specialize}(f;
3075
3079
sys = sys_or_symbolcache (sys, syms, paramsyms, indepsym)
3076
3080
3077
3081
if specialize === NoSpecialize
3078
- ImplicitDiscreteFunction {iip, specialize, Any, Any, Any, Any, Any} (_f,
3082
+ ImplicitDiscreteFunction {iip, specialize, Any, Any, Any, Any, Any, Any } (_f,
3079
3083
analytic,
3080
3084
observed,
3081
3085
sys,
3086
+ resid_prototype,
3082
3087
initialization_data)
3083
3088
else
3084
3089
ImplicitDiscreteFunction{
3085
- iip, specialize, typeof (_f), typeof (analytic), typeof (observed), typeof (sys),
3090
+ iip, specialize, typeof (_f), typeof (analytic), typeof (observed), typeof (sys), typeof (resid_prototype ),
3086
3091
typeof (initialization_data)}(
3087
- _f, analytic, observed, sys, initialization_data)
3092
+ _f, analytic, observed, sys, resid_prototype, initialization_data)
3088
3093
end
3089
3094
end
3090
3095
@@ -3101,12 +3106,12 @@ function unwrapped_f(f::ImplicitDiscreteFunction, newf = unwrapped_f(f.f))
3101
3106
specialize = specialization (f)
3102
3107
3103
3108
if specialize === NoSpecialize
3104
- ImplicitDiscreteFunction{isinplace (f, 6 ), specialize, Any, Any,
3109
+ ImplicitDiscreteFunction{isinplace (f, 5 ), specialize, Any , Any, Any,
3105
3110
Any, Any, Any}(newf, f. analytic, f. observed, f. sys, f. resid_prototype, f. initialization_data)
3106
3111
else
3107
- ImplicitDiscreteFunction{isinplace (f, 6 ), specialize, typeof (newf),
3112
+ ImplicitDiscreteFunction{isinplace (f, 5 ), specialize, typeof (newf),
3108
3113
typeof (f. analytic),
3109
- typeof (f. observed), typeof (f. sys), typeof (f. initialization_data)}(newf,
3114
+ typeof (f. observed), typeof (f. sys), typeof (resid_prototype), typeof ( f. initialization_data)}(newf,
3110
3115
f. analytic, f. observed, f. sys, f. resid_prototype, f. initialization_data)
3111
3116
end
3112
3117
end
0 commit comments