Skip to content

Commit 6897f7b

Browse files
authored
Apply suggestions from code review
1 parent 8eaae42 commit 6897f7b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/NLPModelsIpopt.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function SolverCore.reset!(solver::IpoptSolver, nlp::AbstractNLPModel)
9494
@assert nlp.meta.ncon == problem.m
9595

9696
problem.obj_val = Inf
97-
problem.status = 0
97+
problem.status = -1
9898
problem.x .= nlp.meta.x0
9999
eval_f, eval_g, eval_grad_f, eval_jac_g, eval_h = set_callbacks(nlp)
100100
problem.eval_f = eval_f
@@ -111,7 +111,6 @@ end
111111
function SolverCore.reset!(solver::IpoptSolver)
112112
problem = solver.problem
113113

114-
# Reset solver state to initial values
115114
problem.obj_val = Inf
116115
problem.status = -1 # Use -1 to indicate not solved yet
117116
problem.intermediate = nothing

test/runtests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ end
125125
solver = IpoptSolver(nlp)
126126

127127
# Solve the problem first
128-
stats = solve!(solver, nlp, stats, print_level=0)
128+
stats = solve!(solver, nlp, stats, print_level = 0)
129129
@test stats.status == :first_order
130130
@test isapprox(stats.solution, [1.0; 1.0], atol = 1e-6)
131131

@@ -134,7 +134,7 @@ end
134134
reset!(solver)
135135

136136
# Solve again with new initial guess
137-
stats = solve!(solver, nlp, stats, print_level=0)
137+
stats = solve!(solver, nlp, stats, print_level = 0)
138138
@test stats.status == :first_order
139139
@test isapprox(stats.solution, [1.0; 1.0], atol = 1e-6)
140140
end

0 commit comments

Comments
 (0)