|  | 
| 93 | 93 |     force_stop::Bool | 
| 94 | 94 |     force_reinit::Bool | 
| 95 | 95 |     kwargs | 
|  | 96 | + | 
|  | 97 | +    # Initialization | 
|  | 98 | +    initializealg | 
| 96 | 99 | end | 
| 97 | 100 | 
 | 
| 98 | 101 | function NonlinearSolveBase.get_abstol(cache::QuasiNewtonCache) | 
| @@ -137,7 +140,7 @@ function SciMLBase.__init( | 
| 137 | 140 |         stats = NLStats(0, 0, 0, 0, 0), alias_u0 = false, maxtime = nothing, | 
| 138 | 141 |         maxiters = 1000, abstol = nothing, reltol = nothing, | 
| 139 | 142 |         linsolve_kwargs = (;), termination_condition = nothing, | 
| 140 |  | -        internalnorm::F = L2_NORM, kwargs... | 
|  | 143 | +        internalnorm::F = L2_NORM, initializealg = NonlinearSolveBase.NonlinearSolveDefaultInit(), kwargs... | 
| 141 | 144 | ) where {F} | 
| 142 | 145 |     timer = get_timer_output() | 
| 143 | 146 |     @static_timeit timer "cache construction" begin | 
| @@ -211,15 +214,18 @@ function SciMLBase.__init( | 
| 211 | 214 |             uses_jacobian_inverse = inverted_jac, kwargs... | 
| 212 | 215 |         ) | 
| 213 | 216 | 
 | 
| 214 |  | -        return QuasiNewtonCache( | 
|  | 217 | +        cache = QuasiNewtonCache( | 
| 215 | 218 |             fu, u, u_cache, prob.p, du, J, alg, prob, globalization, | 
| 216 | 219 |             initialization_cache, descent_cache, linesearch_cache, | 
| 217 | 220 |             trustregion_cache, update_rule_cache, reinit_rule_cache, | 
| 218 | 221 |             inv_workspace, stats, 0, 0, alg.max_resets, maxiters, maxtime, | 
| 219 | 222 |             alg.max_shrink_times, 0, timer, 0.0, termination_cache, trace, | 
| 220 |  | -            ReturnCode.Default, false, false, kwargs | 
|  | 223 | +            ReturnCode.Default, false, false, kwargs, initializealg | 
| 221 | 224 |         ) | 
| 222 | 225 |     end | 
|  | 226 | + | 
|  | 227 | +    NonlinearSolveBase.initialize_cache!(cache) | 
|  | 228 | +    return cache | 
| 223 | 229 | end | 
| 224 | 230 | 
 | 
| 225 | 231 | function InternalAPI.step!( | 
|  | 
0 commit comments