Skip to content

Commit 069aa79

Browse files
Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 9e4e9ff commit 069aa79

6 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/LMTR_alg.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ For advanced usage, first define a solver "LMSolver" to preallocate the memory u
146146
- `subsolver::S = R2Solver`: subsolver used to solve the subproblem that appears at each iteration.
147147
- `sub_kwargs::NamedTuple = NamedTuple()`: a named tuple containing the keyword arguments to be sent to the subsolver. The solver will fail if invalid keyword arguments are provided to the subsolver. For example, if the subsolver is `R2Solver`, you can pass `sub_kwargs = (max_iter = 100, σmin = 1e-6,)`.
148148
149-
The algorithm stops either when `√(ξₖ/νₖ) < atol + rtol*√(ξ₀/ν₀) ` or `ξₖ < 0` and `√(-ξₖ/νₖ) < neg_tol` where ξₖ := f(xₖ) + h(xₖ) - φ(sₖ; xₖ) - ψ(sₖ; xₖ), and √(ξₖ/νₖ) is a stationarity measure or when `‖sₖ₁‖/νₖ < atol_step + rtol_step*‖s₀‖/ν₀` where `sₖ₁` is the Cauchy step.
149+
The algorithm stops either when `√(ξₖ/νₖ) < atol_decr + rtol_decr*√(ξ₀/ν₀) ` or `ξₖ < 0` and `√(-ξₖ/νₖ) < neg_tol` where ξₖ := f(xₖ) + h(xₖ) - φ(sₖ; xₖ) - ψ(sₖ; xₖ), and √(ξₖ/νₖ) is a stationarity measure or when `‖sₖ₁‖/νₖ < atol_step + rtol_step*‖s₀‖/ν₀` where `sₖ₁` is the Cauchy step.
150150
151151
# Output
152152
The value returned is a `GenericExecutionStats`, see `SolverCore.jl`.
@@ -325,7 +325,7 @@ function SolverCore.solve!(
325325
atol_step += rtol_step * norm_s_cauchydν # make stopping test absolute and relative
326326

327327
solved = (ξ1 < 0 && sqrt_ξ1_νInv neg_tol) || (ξ1 0 && sqrt_ξ1_νInv atol_decr) || (norm_s_cauchydν atol_step)
328-
328+
329329
set_status!(
330330
stats,
331331
get_status(
@@ -478,7 +478,7 @@ function SolverCore.solve!(
478478

479479
norm_s_cauchy = norm(s)
480480
norm_s_cauchydν = norm_s_cauchy / ν
481-
481+
482482
solved = (ξ1 < 0 && sqrt_ξ1_νInv neg_tol) || (ξ1 0 && sqrt_ξ1_νInv atol_decr) || (norm_s_cauchydν atol_step)
483483

484484
set_status!(

src/LM_alg.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ For advanced usage, first define a solver "LMSolver" to preallocate the memory u
146146
- `subsolver = R2Solver`: the solver used to solve the subproblems.
147147
- `sub_kwargs::NamedTuple = NamedTuple()`: a named tuple containing the keyword arguments to be sent to the subsolver. The solver will fail if invalid keyword arguments are provided to the subsolver. For example, if the subsolver is `R2Solver`, you can pass `sub_kwargs = (max_iter = 100, σmin = 1e-6,)`.
148148
149-
The algorithm stops either when `√(ξₖ/νₖ) < atol + rtol*√(ξ₀/ν₀) ` or `ξₖ < 0` and `√(-ξₖ/νₖ) < neg_tol` where ξₖ := f(xₖ) + h(xₖ) - φ(sₖ; xₖ) - ψ(sₖ; xₖ), and √(ξₖ/νₖ) is a stationarity measure or when `‖sₖ₁‖/νₖ < atol_step + rtol_step*‖s₀₁‖/ν₀` where `sₖ₁` is the Cauchy step.
149+
The algorithm stops either when `√(ξₖ/νₖ) < atol_decr + rtol_decr*√(ξ₀/ν₀) ` or `ξₖ < 0` and `√(-ξₖ/νₖ) < neg_tol` where ξₖ := f(xₖ) + h(xₖ) - φ(sₖ; xₖ) - ψ(sₖ; xₖ), and √(ξₖ/νₖ) is a stationarity measure or when `‖sₖ₁‖/νₖ < atol_step + rtol_step*‖s₀₁‖/ν₀` where `sₖ₁` is the Cauchy step.
150150
151151
# Output
152152
The value returned is a `GenericExecutionStats`, see `SolverCore.jl`.

src/R2DH.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ function SolverCore.solve!(
354354
norm_s = norm(s)
355355
norm_sdν = norm_s / ν₁
356356
atol_step += rtol_step * norm_sdν # make stopping test absolute and relative
357-
357+
358358
solved =< 0 && sqrt_ξ_νInv neg_tol) || 0 && sqrt_ξ_νInv atol_decr) || (norm_sdν atol_step)
359359

360360
set_status!(
@@ -452,7 +452,7 @@ function SolverCore.solve!(
452452
sqrt_ξ_νInv = ξ 0 ? sqrt/ ν₁) : sqrt(-ξ / ν₁)
453453
< 0 && sqrt_ξ_νInv > neg_tol) &&
454454
error("R2DH: prox-gradient step should produce a decrease but ξ = $(ξ)")
455-
455+
456456
norm_s = norm(s)
457457
norm_sdν = norm_s / ν₁
458458

src/R2_alg.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ For advanced usage, first define a solver "R2Solver" to preallocate the memory u
160160
- `compute_obj::Bool = true`: (advanced) whether `f(x₀)` should be computed or not. If set to false, then the value is retrieved from `stats.solver_specific[:smooth_obj]`;
161161
- `compute_grad::Bool = true`: (advanced) whether `∇f(x₀)` should be computed or not. If set to false, then the value is retrieved from `solver.∇fk`;
162162
163-
The algorithm stops either when `√(ξₖ/νₖ) < atol + rtol*√(ξ₀/ν₀) ` or `ξₖ < 0` and `√(-ξₖ/νₖ) < neg_tol` where ξₖ := f(xₖ) + h(xₖ) - φ(sₖ; xₖ) - ψ(sₖ; xₖ), and √(ξₖ/νₖ) is a stationarity measure or when `‖sₖ‖/νₖ < atol_step + rtol_step*‖s₀‖/ν₀` where `sₖ` is the current step.
163+
The algorithm stops either when `√(ξₖ/νₖ) < atol_decr + rtol_decr*√(ξ₀/ν₀) ` or `ξₖ < 0` and `√(-ξₖ/νₖ) < neg_tol` where ξₖ := f(xₖ) + h(xₖ) - φ(sₖ; xₖ) - ψ(sₖ; xₖ), and √(ξₖ/νₖ) is a stationarity measure or when `‖sₖ‖/νₖ < atol_step + rtol_step*‖s₀‖/ν₀` where `sₖ` is the current step.
164164
165165
# Output
166166
The value returned is a `GenericExecutionStats`, see `SolverCore.jl`.
@@ -429,7 +429,7 @@ function SolverCore.solve!(
429429
atol_step += rtol_step * norm_sdν # make stopping test absolute and relative
430430

431431
solved =< 0 && sqrt_ξ_νInv neg_tol) || 0 && sqrt_ξ_νInv atol_decr) || (norm_sdν atol_step)
432-
432+
433433
set_status!(
434434
stats,
435435
get_status(
@@ -518,7 +518,7 @@ function SolverCore.solve!(
518518
norm_sdν = norm_s / ν
519519

520520
solved =< 0 && sqrt_ξ_νInv neg_tol) || 0 && sqrt_ξ_νInv atol_decr) || (norm_sdν atol_step)
521-
521+
522522
set_status!(
523523
stats,
524524
get_status(

src/TRDH_alg.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ function SolverCore.solve!(
405405
norm_sdν = norm_s / ν
406406
atol_step += rtol_step * norm_sdν # make stopping test absolute and relative
407407

408-
solved = (ξ1 < 0 && sqrt_ξ_νInv neg_tol) || (ξ1 0 && sqrt_ξ_νInv atol_decr) | (norm_sdν atol_step)
408+
solved = (ξ1 < 0 && sqrt_ξ_νInv neg_tol) || (ξ1 0 && sqrt_ξ_νInv atol_decr) || (norm_sdν atol_step)
409409
set_status!(
410410
stats,
411411
get_status(

src/TR_alg.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ function SolverCore.solve!(
355355
atol_step += rtol_step * norm_s_cauchydν # make stopping test absolute and relative
356356

357357
solved = (ξ1 < 0 && sqrt_ξ1_νInv neg_tol) || (ξ1 0 && sqrt_ξ1_νInv atol_decr) || (norm_s_cauchydν atol_step)
358-
358+
359359
set_status!(
360360
stats,
361361
get_status(

0 commit comments

Comments
 (0)