Skip to content

Commit 5ccacbf

Browse files
R2N: compute opnorm for hessian in sparseCOO format
1 parent 6fb1dec commit 5ccacbf

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/R2N.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,13 @@ function SolverCore.solve!(
301301
λmax::T = T(1)
302302
if !solver.store_h
303303
solver.subpb.model.B = hess_op(nlp, xk)
304+
λmax, found_λ = opnorm(solver.subpb.model.B)
305+
found_λ || error("operator norm computation failed")
304306
else
305307
hess_coord!(nlp, xk, solver.subpb.model.B.vals)
308+
λmax = opnorm(solver.subpb.model.B)
306309
end
307-
308-
λmax, found_λ = opnorm(solver.subpb.model.B)
309-
found_λ || error("operator norm computation failed")
310-
310+
311311
ν₁ = θ / (λmax + σk)
312312

313313
sqrt_ξ1_νInv = one(T)
@@ -435,13 +435,13 @@ function SolverCore.solve!(
435435
end
436436
if !solver.store_h
437437
solver.subpb.model.B = hess_op(nlp, xk)
438+
λmax, found_λ = opnorm(solver.subpb.model.B)
439+
found_λ || error("operator norm computation failed")
438440
else
439441
hess_coord!(nlp, xk, solver.subpb.model.B.vals)
442+
λmax = opnorm(solver.subpb.model.B)
440443
end
441-
442-
λmax, found_λ = opnorm(solver.subpb.model.B)
443-
found_λ || error("operator norm computation failed")
444-
444+
445445
∇fk⁻ .= ∇fk
446446
end
447447

0 commit comments

Comments
 (0)