Skip to content

Commit

Permalink
Fix Halley
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed May 5, 2024
1 parent ffdc60c commit 2a1eadb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/nlsolve/halley.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,8 @@ function SciMLBase.__solve(prob::NonlinearProblem, alg::SimpleHalley, args...;
cᵢ = _restructure(cᵢ, cᵢ_)

if i == 1
if iszero(fx)
all(iszero(fx)) &&
return build_solution(prob, alg, x, fx; retcode = ReturnCode.Success)
end
else
# Termination Checks
tc_sol = check_termination(tc_cache, fx, x, xo, prob, alg)
Expand Down
2 changes: 1 addition & 1 deletion src/nlsolve/trustRegion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function SciMLBase.__solve(prob::NonlinearProblem, alg::SimpleTrustRegion, args.
termination_condition)

# Set default trust region radius if not specified by user.
Δₘₐₓ == 0 && (Δₘₐₓ = max(norm_fx, maximum(x) - minimum(x)))
Δₘₐₓ = ifelse(iszero(Δₘₐₓ), max(norm_fx, maximum(x) - minimum(x)), Δₘₐₓ)
if Δ == 0
if _unwrap_val(alg.nlsolve_update_rule)
norm_x = norm(x)
Expand Down

0 comments on commit 2a1eadb

Please sign in to comment.