5656 retcode:: ReturnCode.T
5757 force_stop:: Bool
5858 maxiters:: Int
59+ internalnorm
5960end
6061
6162function Base. show (
8081for (probType, pType) in ((:NonlinearProblem , :NLS ), (:NonlinearLeastSquaresProblem , :NLLS ))
8182 algType = NonlinearSolvePolyAlgorithm{pType}
8283 @eval begin
83- function SciMLBase. __init (prob:: $probType , alg:: $algType{N} , args... ;
84- maxtime = nothing , maxiters = 1000 , kwargs... ) where {N}
84+ function SciMLBase. __init (
85+ prob:: $probType , alg:: $algType{N} , args... ; maxtime = nothing ,
86+ maxiters = 1000 , internalnorm = DEFAULT_NORM, kwargs... ) where {N}
8587 return NonlinearSolvePolyAlgorithmCache {isinplace(prob), N, maxtime !== nothing} (
86- map (solver -> SciMLBase. __init (prob, solver, args... ; maxtime, kwargs... ),
88+ map (
89+ solver -> SciMLBase. __init (
90+ prob, solver, args... ; maxtime, internalnorm, kwargs... ),
8791 alg. algs),
8892 alg,
8993 - 1 ,
@@ -93,7 +97,8 @@ for (probType, pType) in ((:NonlinearProblem, :NLS), (:NonlinearLeastSquaresProb
9397 maxtime,
9498 ReturnCode. Default,
9599 false ,
96- maxiters)
100+ maxiters,
101+ internalnorm)
97102 end
98103 end
99104end
134139 push! (calls,
135140 quote
136141 fus = tuple ($ (Tuple (resids)... ))
137- minfu, idx = __findmin (cache. caches[ 1 ] . internalnorm, fus)
138- stats = cache. caches[idx]. stats
142+ minfu, idx = __findmin (cache. internalnorm, fus)
143+ stats = __compile_stats ( cache. caches[idx])
139144 u = get_u (cache. caches[idx])
140145 retcode = cache. caches[idx]. retcode
141146
@@ -171,16 +176,15 @@ end
171176 end )
172177 end
173178
174- push! (calls,
175- quote
176- if ! (1 ≤ cache. current ≤ length (cache. caches))
177- minfu, idx = __findmin (first (cache. caches). internalnorm, cache. caches)
178- cache. best = idx
179- cache. retcode = cache. caches[cache. best]. retcode
180- cache. force_stop = true
181- return
182- end
183- end )
179+ push! (calls, quote
180+ if ! (1 ≤ cache. current ≤ length (cache. caches))
181+ minfu, idx = __findmin (cache. internalnorm, cache. caches)
182+ cache. best = idx
183+ cache. retcode = cache. caches[cache. best]. retcode
184+ cache. force_stop = true
185+ return
186+ end
187+ end )
184188
185189 return Expr (:block , calls... )
186190end
@@ -353,9 +357,11 @@ function FastShortcutNLLSPolyalg(::Type{T} = Float64; concrete_jac = nothing,
353357 linsolve = nothing , precs = DEFAULT_PRECS, kwargs... ) where {T}
354358 if __is_complex (T)
355359 algs = (GaussNewton (; concrete_jac, linsolve, precs, kwargs... ),
360+ LevenbergMarquardt (; linsolve, precs, disable_geodesic = Val (true ), kwargs... ),
356361 LevenbergMarquardt (; linsolve, precs, kwargs... ))
357362 else
358363 algs = (GaussNewton (; concrete_jac, linsolve, precs, kwargs... ),
364+ LevenbergMarquardt (; linsolve, precs, disable_geodesic = Val (true ), kwargs... ),
359365 TrustRegion (; concrete_jac, linsolve, precs, kwargs... ),
360366 GaussNewton (; concrete_jac, linsolve, precs,
361367 linesearch = LineSearchesJL (; method = BackTracking ()), kwargs... ),
0 commit comments