Skip to content

Commit 3269c28

Browse files
compute norm(Bk) within R2N
1 parent d763256 commit 3269c28

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/R2N.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ function R2N(
132132
quasiNewtTest = isa(f, QuasiNewtonModel)
133133
Bk = hess_op(f, xk)
134134

135-
λmax = opnorm(Bk)
135+
λmax, found_λ = opnorm(Bk)
136+
found_λ || error("operator norm computation failed")
136137
νInv = (1 + θ) * (σk + λmax)
137138
sqrt_ξ1_νInv = one(R)
138139

@@ -247,7 +248,8 @@ function R2N(
247248
push!(f, s, ∇fk - ∇fk⁻)
248249
end
249250
Bk = hess_op(f, xk)
250-
λmax = opnorm(Bk)
251+
λmax, found_λ = opnorm(Bk)
252+
found_λ || error("operator norm computation failed")
251253
∇fk⁻ .= ∇fk
252254
end
253255

0 commit comments

Comments
 (0)