Ignore:
Timestamp:
Nov 1, 2006 4:50:37 PM (13 years ago)
Author:
pbonami
Message:

Fix a bug with zero dimensional nlps

Location:
branches/devel/Bonmin/src/Interfaces
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/devel/Bonmin/src/Interfaces/BonTMINLP2TNLP.cpp

    r98 r103  
    415415    IpBlasDcopy(m, lambda, 1, duals_sol_, 1);
    416416
    417     IpBlasDcopy(n, z_L, 1 , &duals_sol_[m], 1);
    418     IpBlasDcopy(n, z_U, 1 , &duals_sol_[m + n], 1);
     417    IpBlasDcopy(n, z_L, 1 , duals_sol_ + m, 1);
     418    IpBlasDcopy(n, z_U, 1 , duals_sol_ + m + n, 1);
    419419
    420420    return_status_ = status;
  • branches/devel/Bonmin/src/Interfaces/BonTNLPSolver.cpp

    r96 r103  
    6363        delete [] g_l;
    6464        delete [] g_u;
     65        double * lam = new double[m];
     66        CoinFillN(lam,m,0.);
     67        double * z = new double[n];
     68        CoinFillN(z,n,0.);
    6569        tnlp->finalize_solution(Ipopt::LOCAL_INFEASIBILITY,
    6670                               n, x_sol, NULL, NULL,
    6771                               m, g_sol, NULL, obj_value);
     72        delete [] lam;
     73        delete [] z;
    6874        delete [] g_sol;
    6975        delete [] x_sol;
     
    7480    delete [] g_l;
    7581    delete [] g_u;
     82
     83    double * lam = new double[m];
     84    CoinFillN(lam,m,0.);
     85    double * z = new double[n];
     86    CoinFillN(z,n,0.);
    7687    tnlp->finalize_solution(Ipopt::SUCCESS,
    77                            n, x_sol, NULL, NULL,
    78                            m, g_sol, NULL, obj_value);
     88                           n, x_sol, z, z,
     89                           m, g_sol, lam, obj_value);
     90    delete [] lam;
     91    delete [] z;
    7992    delete [] g_sol;
    8093    delete [] x_sol;
Note: See TracChangeset for help on using the changeset viewer.