From 1ef05a1cbe8f3b4310c00a090f2e5fc1406065d1 Mon Sep 17 00:00:00 2001 From: tmigot Date: Fri, 19 Jan 2024 13:24:37 +0100 Subject: [PATCH] Copy `nlp.meta.x0` in state constructor --- src/Stopping/NLPStoppingmod.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Stopping/NLPStoppingmod.jl b/src/Stopping/NLPStoppingmod.jl index 3e592dd6..2f677705 100644 --- a/src/Stopping/NLPStoppingmod.jl +++ b/src/Stopping/NLPStoppingmod.jl @@ -136,10 +136,12 @@ end function NLPStopping(pb::AbstractNLPModel; n_listofstates::Integer = 0, kwargs...) #Create a default NLPAtX + initial_guess = copy(pb.meta.x0) if get_ncon(pb) > 0 - nlp_at_x = NLPAtX(pb.meta.x0, pb.meta.y0) + initial_lag = copy(pb.meta.y0) + nlp_at_x = NLPAtX(initial_guess, initial_lag) else - nlp_at_x = NLPAtX(pb.meta.x0) + nlp_at_x = NLPAtX(initial_guess) end if n_listofstates > 0 && :list ∉ keys(kwargs)