@@ -1884,10 +1884,7 @@ For more details on this argument, see the ODEFunction documentation.
1884
1884
The fields of the NonlinearFunction type directly match the names of the inputs.
1885
1885
"""
1886
1886
struct NonlinearFunction{iip, specialize, F, TMM, Ta, Tt, TJ, JVP, VJP, JP, SP, TW, TWt,
1887
- TPJ,
1888
- S, S2, O, TCV,
1889
- SYS,
1890
- } <: AbstractNonlinearFunction{iip}
1887
+ TPJ, S, S2, O, TCV, SYS, RP} <: AbstractNonlinearFunction{iip}
1891
1888
f:: F
1892
1889
mass_matrix:: TMM
1893
1890
analytic:: Ta
@@ -1905,6 +1902,7 @@ struct NonlinearFunction{iip, specialize, F, TMM, Ta, Tt, TJ, JVP, VJP, JP, SP,
1905
1902
observed:: O
1906
1903
colorvec:: TCV
1907
1904
sys:: SYS
1905
+ resid_prototype:: RP
1908
1906
end
1909
1907
1910
1908
TruncatedStacktraces. @truncate_stacktrace NonlinearFunction 1 2
@@ -3648,7 +3646,8 @@ function NonlinearFunction{iip, specialize}(f;
3648
3646
DEFAULT_OBSERVED_NO_TIME,
3649
3647
colorvec = __has_colorvec (f) ? f. colorvec :
3650
3648
nothing ,
3651
- sys = __has_sys (f) ? f. sys : nothing ) where {
3649
+ sys = __has_sys (f) ? f. sys : nothing ,
3650
+ resid_prototype = __has_resid_prototype (f) ? f. resid_prototype : nothing ) where {
3652
3651
iip,
3653
3652
specialize,
3654
3653
}
@@ -3687,14 +3686,14 @@ function NonlinearFunction{iip, specialize}(f;
3687
3686
Any, Any, Any, Any, Any,
3688
3687
Any, Any, Any, Any, Any,
3689
3688
Any, Any, typeof (syms), typeof (paramsyms), Any,
3690
- typeof (_colorvec), Any}(f, mass_matrix,
3689
+ typeof (_colorvec), Any, Any }(f, mass_matrix,
3691
3690
analytic, tgrad, jac,
3692
3691
jvp, vjp,
3693
3692
jac_prototype,
3694
3693
sparsity, Wfact,
3695
3694
Wfact_t, paramjac,
3696
3695
syms, paramsyms, observed,
3697
- _colorvec, sys)
3696
+ _colorvec, sys, resid_prototype )
3698
3697
else
3699
3698
NonlinearFunction{iip, specialize,
3700
3699
typeof (f), typeof (mass_matrix), typeof (analytic), typeof (tgrad),
@@ -3703,13 +3702,13 @@ function NonlinearFunction{iip, specialize}(f;
3703
3702
typeof (Wfact_t), typeof (paramjac), typeof (syms),
3704
3703
typeof (paramsyms),
3705
3704
typeof (observed),
3706
- typeof (_colorvec), typeof (sys)}(f, mass_matrix, analytic, tgrad ,
3707
- jac,
3705
+ typeof (_colorvec), typeof (sys), typeof (resid_prototype) }(f, mass_matrix,
3706
+ analytic, tgrad, jac,
3708
3707
jvp, vjp, jac_prototype, sparsity,
3709
3708
Wfact,
3710
3709
Wfact_t, paramjac, syms,
3711
3710
paramsyms,
3712
- observed, _colorvec, sys)
3711
+ observed, _colorvec, sys, resid_prototype )
3713
3712
end
3714
3713
end
3715
3714
@@ -3978,6 +3977,7 @@ __has_analytic(f) = isdefined(f, :analytic)
3978
3977
__has_colorvec (f) = isdefined (f, :colorvec )
3979
3978
__has_sys (f) = isdefined (f, :sys )
3980
3979
__has_analytic_full (f) = isdefined (f, :analytic_full )
3980
+ __has_resid_prototype (f) = isdefined (f, :resid_prototype )
3981
3981
3982
3982
# compatibility
3983
3983
has_invW (f:: AbstractSciMLFunction ) = false
0 commit comments