[Ipopt-tickets] [Ipopt] #183: AMPL loops tests fail with Ipopt (??? Lagrange multipliers instead of "dual/marginal_value")
Ipopt
coin-trac at coin-or.org
Sat Mar 30 21:22:43 EDT 2013
#183: AMPL loops tests fail with Ipopt (??? Lagrange multipliers instead of
"dual/marginal_value")
-------------------------+-----------------------------------------
Reporter: VladimirVV | Owner: ipopt-team
Type: defect | Status: reopened
Priority: normal | Component: Ipopt
Version: 3.10 | Severity: normal
Resolution: | Keywords: AMPL loops sign dual values
-------------------------+-----------------------------------------
Changes (by guest):
* status: closed => reopened
* resolution: fixed =>
Comment:
Thank you for addressing this issue. Forgive me for re-opining once more,
but I think one last patch is required for the bound multipliers returned
through the zU and zL suffixes (i.e., the reduced costs). Please consider
the following patch which corrects the sign for zU in the case of a min
problem and corrects the sign for zL in the case of a max problem:
{{{
#!diff
Index: Ipopt/src/Apps/AmplSolver/AmplTNLP.cpp
===================================================================
--- Ipopt/src/Apps/AmplSolver/AmplTNLP.cpp (revision 2183)
+++ Ipopt/src/Apps/AmplSolver/AmplTNLP.cpp (working copy)
@@ -422,13 +422,13 @@
const double* zU_init =
suffix_handler_->GetNumberSuffixValues("ipopt_zU_in",
AmplSuffixHandler::Variable_Source);
for (Index i=0; i<n; i++) {
if (zL_init) {
- z_L[i]=zL_init[i];
+ z_L[i]= obj_sign_ * zL_init[i];
}
else {
z_L[i] =1.0;
}
if (zU_init) {
- z_U[i]=zU_init[i];
+ z_U[i]= -obj_sign_ * zU_init[i];
}
else {
z_U[i] =1.0;
@@ -632,14 +632,23 @@
}
IpBlasDcopy(n, x, 1, x_sol_, 1);
- IpBlasDcopy(n, z_L, 1, z_L_sol_, 1);
- IpBlasDcopy(n, z_U, 1, z_U_sol_, 1);
IpBlasDcopy(m, g, 1, g_sol_, 1);
- if( obj_sign_ == -1.0 )
+ if( obj_sign_ == -1 ) { // max problem
IpBlasDcopy(m, lambda, 1, lambda_sol_, 1);
- else
- for( int i = 0; i < m; ++i )
+ IpBlasDcopy(n, z_U, 1, z_U_sol_, 1);
+ for( int i = 0; i < n; ++i ) {
+ z_L_sol_[i] = -z_L[i];
+ }
+ }
+ else { // min problem
+ IpBlasDcopy(n, z_L, 1, z_L_sol_, 1);
+ for( int i = 0; i < n; ++i ) {
+ z_U_sol_[i] = -z_U[i];
+ }
+ for( int i = 0; i < m; ++i ) {
lambda_sol_[i] = -lambda[i];
+ }
+ }
obj_sol_ = obj_value;
std::string message;
}}}
--
Ticket URL: <https://projects.coin-or.org/ticket/183#comment:5>
Ipopt <http://projects.coin-or.org/Ipopt>
Interior-point optimizer for nonlinear programs.
More information about the Ipopt-tickets
mailing list