Skip to content

Commit 6671aed

Browse files
add opnorm with arpack for R2N
1 parent 354d557 commit 6671aed

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/R2N.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ For advanced usage, first define a solver "R2NSolver" to preallocate the memory
131131
- `ν::T = eps(T)^(1 / 5)`: inverse of the initial regularization parameter: ν = 1/σ;
132132
- `γ::T = T(3)`: regularization parameter multiplier, σ := σ/γ when the iteration is very successful and σ := σγ when the iteration is unsuccessful.
133133
- `θ::T = 1/(1 + eps(T)^(1 / 5))`: is the model decrease fraction with respect to the decrease of the Cauchy model.
134-
- `m_monotone::Int = 1`: monotonicity parameter. By default, R2DH is monotone but the non-monotone variant will be used if `m_monotone > 1`
134+
- `m_monotone::Int = 1`: monotonicity parameter. By default, R2N is monotone but the non-monotone variant will be used if `m_monotone > 1`
135135
136136
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.
137137
@@ -289,7 +289,8 @@ function SolverCore.solve!(
289289
λmax::T = T(1)
290290
solver.subpb.model.B = hess_op(nlp, xk)
291291

292-
λmax = opnorm(solver.subpb.model.B)
292+
λmax, found_λ = opnorm(solver.subpb.model.B)
293+
found_λ || error("operator norm computation failed")
293294

294295
ν₁ = θ / (λmax + σk)
295296
ν_sub = ν₁
@@ -424,8 +425,9 @@ function SolverCore.solve!(
424425
end
425426
solver.subpb.model.B = hess_op(nlp, xk)
426427

427-
λmax = opnorm(solver.subpb.model.B)
428-
428+
λmax, found_λ = opnorm(solver.subpb.model.B)
429+
found_λ || error("operator norm computation failed")
430+
429431
∇fk⁻ .= ∇fk
430432
end
431433

0 commit comments

Comments
 (0)