Skip to content

Commit c72b380

Browse files
committed
changes
1 parent 1d74feb commit c72b380

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/NLPModelsIpopt.jl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,20 @@ end
212212
function ipopt(nls::AbstractNLSModel; kwargs...)
213213
ff_nls = FeasibilityFormNLS(nls)
214214
stats = ipopt(ff_nls; kwargs...)
215-
# Only keep the original variables in the solution
215+
216216
stats.solution = stats.solution[1:nls.meta.nvar]
217+
218+
if hasproperty(stats, :multipliers_L)
219+
stats.multipliers_L = stats.multipliers_L[1:nls.meta.nvar]
220+
end
221+
if hasproperty(stats, :multipliers_U)
222+
stats.multipliers_U = stats.multipliers_U[1:nls.meta.nvar]
223+
end
224+
225+
if hasproperty(stats, :multipliers)
226+
stats.multipliers = stats.multipliers[end-nls.meta.ncon+1:end]
227+
end
228+
217229
return stats
218230
end
219231

0 commit comments

Comments
 (0)