@@ -86,8 +86,8 @@ function add_node_non_user_cache!(integrator::DiffEqBase.AbstractODEIntegrator,
86
86
i = length (integrator. u)
87
87
cache. J = similar (cache. J, i, i)
88
88
cache. W = similar (cache. W, i, i)
89
- add_node_jac_config ! (cache, cache . jac_config, i, x )
90
- add_node_grad_config ! (cache, cache . grad_config, i, x )
89
+ OrdinaryDiffEqDifferentiation . resize_jac_config ! (cache, integrator )
90
+ OrdinaryDiffEqDifferentiation . resize_grad_config ! (cache, integrator )
91
91
nothing
92
92
end
93
93
@@ -97,8 +97,8 @@ function add_node_non_user_cache!(integrator::DiffEqBase.AbstractODEIntegrator,
97
97
i = length (integrator. u)
98
98
cache. J = similar (cache. J, i, i)
99
99
cache. W = similar (cache. W, i, i)
100
- add_node_jac_config ! (cache, cache . jac_config, i, x, node ... )
101
- add_node_grad_config ! (cache, cache . grad_config, i, x, node ... )
100
+ OrdinaryDiffEqDifferentiation . resize_jac_config ! (cache, integrator )
101
+ OrdinaryDiffEqDifferentiation . resize_grad_config ! (cache, integrator )
102
102
nothing
103
103
end
104
104
@@ -108,11 +108,12 @@ function remove_node_non_user_cache!(integrator::DiffEqBase.AbstractODEIntegrato
108
108
i = length (integrator. u)
109
109
cache. J = similar (cache. J, i, i)
110
110
cache. W = similar (cache. W, i, i)
111
- remove_node_jac_config ! (cache, cache . jac_config, i, node ... )
112
- remove_node_grad_config ! (cache, cache . grad_config, i, node ... )
111
+ OrdinaryDiffEqDifferentiation . resize_jac_config ! (cache, integrator )
112
+ OrdinaryDiffEqDifferentiation . resize_grad_config ! (cache, integrator )
113
113
nothing
114
114
end
115
115
116
+ # Specific implementation for FiniteDiff.JacobianCache (keeps backward compatibility)
116
117
function add_node_jac_config! (cache, config:: FiniteDiff.JacobianCache , i, x)
117
118
# add_node!(cache.x1, fill!(similar(x, eltype(cache.x1)),0))
118
119
add_node! (config. fx, recursivecopy (x))
@@ -137,6 +138,8 @@ function remove_node_jac_config!(cache, config::FiniteDiff.JacobianCache, i, I..
137
138
nothing
138
139
end
139
140
141
+
142
+ # Specific implementation for ForwardDiff.DerivativeConfig (keeps backward compatibility)
140
143
function add_node_grad_config! (cache, grad_config:: ForwardDiff.DerivativeConfig , i, x)
141
144
cache. grad_config = ForwardDiff. DerivativeConfig (cache. tf, cache. du1, cache. uf. t)
142
145
nothing
0 commit comments