Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/SimpleNonlinearSolve/src/trust_region.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ scalar and static array problems.
- `step_threshold`: the threshold for taking a step. In every iteration, the threshold is
compared with a value `r`, which is the actual reduction in the objective function
divided by the predicted reduction. If `step_threshold > r` the model is not a good
approximation, and the step is rejected. Defaults to `0.1`. For more details, see
approximation, and the step is rejected. Defaults to `0.0001`. For more details, see
[Rahpeymaii, F.](https://link.springer.com/article/10.1007/s40096-020-00339-4)
- `shrink_threshold`: the threshold for shrinking the trust region radius. In every
iteration, the threshold is compared with a value `r` which is the actual reduction in
Expand Down Expand Up @@ -128,6 +128,11 @@ function SciMLBase.__solve(
@bb Hδ = copy(x)
dogleg_cache = (; δsd, δN_δsd, δN)

solved, retcode, fx_sol, x_sol = Utils.check_termination(
tc_cache, fx, x, xo, prob
)
solved && return SciMLBase.build_solution(prob, alg, x_sol, fx_sol; retcode)

for _ in 1:maxiters
# Solve the trust region subproblem.
δ = dogleg_method!!(dogleg_cache, J, fx, g, Δ)
Expand Down
Loading