You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Specialize on deriv type and Rosenbrock tableau types for trim compatibility
Applies the type-inference portions of #3326 (which targets master/v7):
- Specialize ode_interpolant, default_ode_interpolant, composite_ode_interpolant,
and interp_at_saveat on ::Type{deriv} to force compiler specialization
- Specialize Rosenbrock tableau constructors on ::Type{T}/::Type{T2} (in both
OrdinaryDiffEqRosenbrock and OrdinaryDiffEqRosenbrockTableaus) so Julia
propagates the concrete element type through the tableau builders
The initdt changes from #3326 are already obsoleted on master/v6-backport:
both branches now compute _tType = eltype(t) inside the function body instead
of passing _tType as a positional argument.
These changes close dynamic-dispatch paths that cause --trim=safe (JuliaC AOT)
to fail, by adding type parameters that let the compiler statically resolve
method calls.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
A W-method variant of Rodas3P, providing 2nd order solutions with 5 stages.
186
186
Reference: Steinebach, G. (2024). Rosenbrock methods within OrdinaryDiffEq.jl - Overview, recent developments and applications. Proceedings of the JuliaCon Conferences.
187
187
"""
188
-
functionRodas23WRodasTableau(T, T2)
188
+
functionRodas23WRodasTableau(::Type{T}, ::Type{T2}) where {T, T2}
189
189
gamma =convert(T2, 1//3)
190
190
a21 =convert(T, 4.0/3.0)
191
191
a41 =convert(T, 2.90625)
@@ -239,7 +239,7 @@ end
239
239
# Essential W-method tableaus (best for Jacobian reuse, see PR #3075)
functionROS3PRodasTableau(::Type{T}, ::Type{T2}) where {T, T2}
206
206
gamma =convert(T2, 1/2+sqrt(3) /6)
207
207
igamma =inv(gamma)
208
208
a21 =convert(T, igamma)
@@ -250,7 +250,7 @@ end
250
250
A 3rd order Rosenbrock method with 4 stages.
251
251
Reference: Sandu, A., et al. (1997). Benchmarking stiff ode solvers for atmospheric chemistry problems-I. implicit vs explicit. Atmospheric Environment, 31(19), 3151-3166.
252
252
"""
253
-
functionRodas3RodasTableau(T, T2)
253
+
functionRodas3RodasTableau(::Type{T}, ::Type{T2}) where {T, T2}
254
254
A =zeros(T, 4, 4)
255
255
A[2, 1] =convert(T, 0)
256
256
A[3, 1] =convert(T, 2)
@@ -285,7 +285,7 @@ end
285
285
A 3rd order Rosenbrock method with 5 stages, including a dense output matrix H.
286
286
Reference: Steinebach, G. (2024). Rosenbrock methods within OrdinaryDiffEq.jl - Overview, recent developments and applications. Proceedings of the JuliaCon Conferences.
287
287
"""
288
-
functionRodas3PRodasTableau(T, T2)
288
+
functionRodas3PRodasTableau(::Type{T}, ::Type{T2}) where {T, T2}
289
289
gamma =convert(T2, 1//3)
290
290
a21 =convert(T, 4.0/3.0)
291
291
a41 =convert(T, 2.90625)
@@ -337,7 +337,7 @@ function Rodas3PRodasTableau(T, T2)
0 commit comments