Skip to content

Commit

Permalink
Copy nlp.meta.x0 in state constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
tmigot committed Jan 19, 2024
1 parent 55d39d4 commit 49e4693
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Stopping/NLPStoppingmod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 49e4693

Please sign in to comment.