@@ -307,12 +307,13 @@ function FastShortcutNonlinearPolyalg(
307
307
# and thus are not included in the polyalgorithm
308
308
if SA
309
309
if __is_complex (T)
310
- algs = (SimpleBroyden (), Broyden (; init_jacobian = Val (:true_jacobian )),
310
+ algs = (SimpleBroyden (),
311
+ Broyden (; init_jacobian = Val (:true_jacobian ), autodiff),
311
312
SimpleKlement (),
312
313
NewtonRaphson (; concrete_jac, linsolve, precs, autodiff))
313
314
else
314
315
algs = (SimpleBroyden (),
315
- Broyden (; init_jacobian = Val (:true_jacobian )),
316
+ Broyden (; init_jacobian = Val (:true_jacobian ), autodiff ),
316
317
SimpleKlement (),
317
318
NewtonRaphson (; concrete_jac, linsolve, precs, autodiff),
318
319
NewtonRaphson (; concrete_jac, linsolve, precs,
@@ -322,13 +323,13 @@ function FastShortcutNonlinearPolyalg(
322
323
end
323
324
else
324
325
if __is_complex (T)
325
- algs = (Broyden (), Broyden (; init_jacobian = Val (:true_jacobian )),
326
- Klement (; linsolve, precs ),
326
+ algs = (Broyden (), Broyden (; init_jacobian = Val (:true_jacobian ), autodiff ),
327
+ Klement (; linsolve, prec, autodiff ),
327
328
NewtonRaphson (; concrete_jac, linsolve, precs, autodiff))
328
329
else
329
- algs = (Broyden (),
330
- Broyden (; init_jacobian = Val (:true_jacobian )),
331
- Klement (; linsolve, precs),
330
+ algs = (Broyden (; autodiff ),
331
+ Broyden (; init_jacobian = Val (:true_jacobian ), autodiff ),
332
+ Klement (; linsolve, precs, autodiff ),
332
333
NewtonRaphson (; concrete_jac, linsolve, precs, autodiff),
333
334
NewtonRaphson (; concrete_jac, linsolve, precs,
334
335
linesearch = LineSearchesJL (; method = BackTracking ()), autodiff),
343
344
344
345
"""
345
346
FastShortcutNLLSPolyalg(::Type{T} = Float64; concrete_jac = nothing, linsolve = nothing,
346
- precs = DEFAULT_PRECS, kwargs...)
347
+ precs = DEFAULT_PRECS, autodiff = nothing, kwargs...)
347
348
348
349
A polyalgorithm focused on balancing speed and robustness. It first tries less robust methods
349
350
for more performance and then tries more robust techniques if the faster ones fail.
@@ -353,21 +354,25 @@ for more performance and then tries more robust techniques if the faster ones fa
353
354
- `T`: The eltype of the initial guess. It is only used to check if some of the algorithms
354
355
are compatible with the problem type. Defaults to `Float64`.
355
356
"""
356
- function FastShortcutNLLSPolyalg (:: Type{T} = Float64; concrete_jac = nothing ,
357
- linsolve = nothing , precs = DEFAULT_PRECS, kwargs... ) where {T}
357
+ function FastShortcutNLLSPolyalg (
358
+ :: Type{T} = Float64; concrete_jac = nothing , linsolve = nothing ,
359
+ precs = DEFAULT_PRECS, autodiff = nothing , kwargs... ) where {T}
358
360
if __is_complex (T)
359
- algs = (GaussNewton (; concrete_jac, linsolve, precs, kwargs... ),
360
- LevenbergMarquardt (; linsolve, precs, disable_geodesic = Val (true ), kwargs... ),
361
- LevenbergMarquardt (; linsolve, precs, kwargs... ))
361
+ algs = (GaussNewton (; concrete_jac, linsolve, precs, autodiff, kwargs... ),
362
+ LevenbergMarquardt (;
363
+ linsolve, precs, autodiff, disable_geodesic = Val (true ), kwargs... ),
364
+ LevenbergMarquardt (; linsolve, precs, autodiff, kwargs... ))
362
365
else
363
- algs = (GaussNewton (; concrete_jac, linsolve, precs, kwargs... ),
364
- LevenbergMarquardt (; linsolve, precs, disable_geodesic = Val (true ), kwargs... ),
365
- TrustRegion (; concrete_jac, linsolve, precs, kwargs... ),
366
+ algs = (GaussNewton (; concrete_jac, linsolve, precs, autodiff, kwargs... ),
367
+ LevenbergMarquardt (;
368
+ linsolve, precs, disable_geodesic = Val (true ), autodiff, kwargs... ),
369
+ TrustRegion (; concrete_jac, linsolve, precs, autodiff, kwargs... ),
366
370
GaussNewton (; concrete_jac, linsolve, precs,
367
- linesearch = LineSearchesJL (; method = BackTracking ()), kwargs... ),
371
+ linesearch = LineSearchesJL (; method = BackTracking ()),
372
+ autodiff, kwargs... ),
368
373
TrustRegion (; concrete_jac, linsolve, precs,
369
- radius_update_scheme = RadiusUpdateSchemes. Bastin, kwargs... ),
370
- LevenbergMarquardt (; linsolve, precs, kwargs... ))
374
+ radius_update_scheme = RadiusUpdateSchemes. Bastin, autodiff, kwargs... ),
375
+ LevenbergMarquardt (; linsolve, precs, autodiff, kwargs... ))
371
376
end
372
377
return NonlinearSolvePolyAlgorithm (algs, Val (:NLLS ))
373
378
end
0 commit comments