@@ -4,8 +4,8 @@ using ADTypes, FastClosures, NonlinearSolve, NLSolvers, SciMLBase, LinearAlgebra
44using FiniteDiff, ForwardDiff
55
66function SciMLBase. __solve (prob:: NonlinearProblem , alg:: NLSolversJL , args... ;
7- abstol = nothing , reltol = nothing , maxiters = 1000 , alias_u0 :: Bool = false ,
8- termination_condition = nothing , kwargs... )
7+ abstol = nothing , reltol = nothing , maxiters = 1000 ,
8+ alias_u0 :: Bool = false , termination_condition = nothing , kwargs... )
99 NonlinearSolve. __test_termination_condition (termination_condition, :NLSolversJL )
1010
1111 abstol = NonlinearSolve. DEFAULT_TOLERANCE (abstol, eltype (prob. u0))
@@ -50,12 +50,13 @@ function SciMLBase.__solve(prob::NonlinearProblem, alg::NLSolversJL, args...;
5050 prob_nlsolver = NEqProblem (prob_obj; inplace = false )
5151 res = NLSolvers. solve (prob_nlsolver, prob. u0, alg. method, options)
5252
53- retcode = ifelse (norm (res. info. best_residual, Inf ) ≤ abstol, ReturnCode . Success,
54- ReturnCode. MaxIters)
53+ retcode = ifelse (norm (res. info. best_residual, Inf ) ≤ abstol,
54+ ReturnCode. Success, ReturnCode . MaxIters)
5555 stats = SciMLBase. NLStats (- 1 , - 1 , - 1 , - 1 , res. info. iter)
5656
57- return SciMLBase. build_solution (prob, alg, res. info. solution,
58- res. info. best_residual; retcode, original = res, stats)
57+ return SciMLBase. build_solution (
58+ prob, alg, res. info. solution, res. info. best_residual;
59+ retcode, original = res, stats)
5960 end
6061
6162 f!, u0, resid = NonlinearSolve. __construct_extension_f (prob; alias_u0)
@@ -73,12 +74,12 @@ function SciMLBase.__solve(prob::NonlinearProblem, alg::NLSolversJL, args...;
7374
7475 res = NLSolvers. solve (prob_nlsolver, u0, alg. method, options)
7576
76- retcode = ifelse (norm (res . info . best_residual, Inf ) ≤ abstol, ReturnCode . Success,
77- ReturnCode. MaxIters)
77+ retcode = ifelse (
78+ norm (res . info . best_residual, Inf ) ≤ abstol, ReturnCode . Success, ReturnCode. MaxIters)
7879 stats = SciMLBase. NLStats (- 1 , - 1 , - 1 , - 1 , res. info. iter)
7980
80- return SciMLBase. build_solution (prob, alg, res. info. solution,
81- res . info . best_residual; retcode, original = res, stats)
81+ return SciMLBase. build_solution (prob, alg, res. info. solution, res . info . best_residual;
82+ retcode, original = res, stats)
8283end
8384
8485end
0 commit comments