Skip to content

Commit 33a583d

Browse files
add sparse hessian
1 parent 66a1b0a commit 33a583d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/R2N.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ function R2NSolver(
3535
reg_nlp::AbstractRegularizedNLPModel{T, V};
3636
subsolver = R2Solver,
3737
m_monotone::Int = 1,
38+
sparse = false
3839
) where {T, V}
3940
x0 = reg_nlp.model.meta.x0
4041
l_bound = reg_nlp.model.meta.lvar
@@ -69,7 +70,7 @@ function R2NSolver(
6970
has_bnds ? shifted(reg_nlp.h, xk, l_bound_m_x, u_bound_m_x, reg_nlp.selected) :
7071
shifted(reg_nlp.h, xk)
7172

72-
Bk = hess_op(reg_nlp, xk)
73+
Bk = sparse ? hess(reg_nlp, xk) : hess_op(reg_nlp, xk)
7374
sub_nlp = QuadraticModel(∇fk, Bk, σ = T(1), x0 = x0)
7475
subpb = RegularizedNLPModel(sub_nlp, ψ)
7576
substats = RegularizedExecutionStats(subpb)

0 commit comments

Comments
 (0)