|  | 
| 87 | 87 |     retcode::ReturnCode.T | 
| 88 | 88 |     force_stop::Bool | 
| 89 | 89 |     kwargs | 
|  | 90 | + | 
|  | 91 | +    initializealg | 
| 90 | 92 | end | 
| 91 | 93 | 
 | 
| 92 | 94 | function InternalAPI.reinit_self!( | 
| @@ -121,7 +123,7 @@ function SciMLBase.__init( | 
| 121 | 123 |         stats = NLStats(0, 0, 0, 0, 0), alias_u0 = false, maxiters = 1000, | 
| 122 | 124 |         abstol = nothing, reltol = nothing, maxtime = nothing, | 
| 123 | 125 |         termination_condition = nothing, internalnorm = L2_NORM, | 
| 124 |  | -        linsolve_kwargs = (;), kwargs... | 
|  | 126 | +        linsolve_kwargs = (;), initializealg = NonlinearSolveBase.NonlinearSolveDefaultInit(), kwargs... | 
| 125 | 127 | ) | 
| 126 | 128 |     @set! alg.autodiff = NonlinearSolveBase.select_jacobian_autodiff(prob, alg.autodiff) | 
| 127 | 129 |     provided_jvp_autodiff = alg.jvp_autodiff !== nothing | 
| @@ -206,13 +208,17 @@ function SciMLBase.__init( | 
| 206 | 208 |             prob, alg, u, fu, J, du; kwargs... | 
| 207 | 209 |         ) | 
| 208 | 210 | 
 | 
| 209 |  | -        return GeneralizedFirstOrderAlgorithmCache( | 
|  | 211 | +        cache = GeneralizedFirstOrderAlgorithmCache( | 
| 210 | 212 |             fu, u, u_cache, prob.p, du, J, alg, prob, globalization, | 
| 211 | 213 |             jac_cache, descent_cache, linesearch_cache, trustregion_cache, | 
| 212 | 214 |             stats, 0, maxiters, maxtime, alg.max_shrink_times, timer, | 
| 213 |  | -            0.0, true, termination_cache, trace, ReturnCode.Default, false, kwargs | 
|  | 215 | +            0.0, true, termination_cache, trace, ReturnCode.Default, false, kwargs, | 
|  | 216 | +            initializealg | 
| 214 | 217 |         ) | 
| 215 | 218 |     end | 
|  | 219 | + | 
|  | 220 | +    NonlinearSolveBase.initialize_cache!(cache) | 
|  | 221 | +    return cache | 
| 216 | 222 | end | 
| 217 | 223 | 
 | 
| 218 | 224 | function InternalAPI.step!( | 
|  | 
0 commit comments