Skip to content

Commit 449ddde

Browse files
add improper check and return in R2N & R2DH
1 parent f957460 commit 449ddde

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/R2DH.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ For advanced usage, first define a solver "R2DHSolver" to preallocate the memory
115115
- `η2::T = T(0.9)`: successful iteration threshold;
116116
- `ν::T = eps(T)^(1 / 5)`: inverse of the initial regularization parameter: ν = 1/σ;
117117
- `γ::T = T(3)`: regularization parameter multiplier, σ := σ/γ when the iteration is very successful and σ := σγ when the iteration is unsuccessful.
118-
- `θ::T = eps(T)^(1/5)`: is the model decrease fraction with respect to the decrease of the Cauchy model.
118+
- `θ::T = 1/(1 + eps(T)^(1 / 5))`: is the model decrease fraction with respect to the decrease of the Cauchy model.
119119
- `m_monotone::Int = 6`: monotoneness parameter. By default, R2DH is non-monotone but the monotone variant can be used with `m_monotone = 1`
120120
121121
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.
@@ -245,6 +245,8 @@ function SolverCore.solve!(
245245
verbose > 0 && @debug "R2DH: found point where h has value" hk
246246
end
247247
improper = (hk == -Inf)
248+
improper == true && @warn "R2DH: Improper term detected"
249+
improper == true && return stats
248250

249251
if verbose > 0
250252
@info log_header(

src/R2N.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ function SolverCore.solve!(
256256
verbose > 0 && @debug "R2N: found point where h has value" hk
257257
end
258258
improper = (hk == -Inf)
259+
improper == true && @warn "R2N: Improper term detected"
260+
improper == true && return stats
259261

260262
if verbose > 0
261263
@info log_header(

0 commit comments

Comments
 (0)