lemon/lp_glpk.cc
changeset 1477 0d32f7947a00
parent 1466 65f8b0ee6306
child 1540 7d028a73d7f2
equal deleted inserted replaced
6:32d2885720fb 7:80e145e999e7
    19 
    19 
    20 ///\file
    20 ///\file
    21 ///\brief Implementation of the LEMON-GLPK lp solver interface.
    21 ///\brief Implementation of the LEMON-GLPK lp solver interface.
    22 
    22 
    23 #include <lemon/lp_glpk.h>
    23 #include <lemon/lp_glpk.h>
    24 
    24 //#include <iostream>
    25 namespace lemon {
    25 namespace lemon {
    26 
    26 
    27 
    27 
    28   LpGlpk::LpGlpk() : Parent(), 
    28   LpGlpk::LpGlpk() : Parent(), 
    29 		     lp(lpx_create_prob()) {
    29 		     lp(lpx_create_prob()) {
   437     }
   437     }
   438   }
   438   }
   439 
   439 
   440   LpGlpk::SolutionStatus LpGlpk::_getDualStatus()
   440   LpGlpk::SolutionStatus LpGlpk::_getDualStatus()
   441   {
   441   {
       
   442 //     std::cout<<"Itt megy: "<<lpx_get_dual_stat(lp)<<std::endl;
       
   443 //     std::cout<<"Itt a primal: "<<lpx_get_prim_stat(lp)<<std::endl;
       
   444 
   442     switch (lpx_get_dual_stat(lp)) {
   445     switch (lpx_get_dual_stat(lp)) {
   443     case LPX_D_UNDEF://Undefined (no solve has been run yet)
   446     case LPX_D_UNDEF://Undefined (no solve has been run yet)
   444       return UNDEFINED;
   447       return UNDEFINED;
   445     case LPX_D_NOFEAS://There is no feasible solution (primal, I guess)
   448     case LPX_D_NOFEAS://There is no feasible solution (primal, I guess)
   446 //    case LPX_D_INFEAS://Infeasible 
   449 //    case LPX_D_INFEAS://Infeasible 
   447       return INFEASIBLE;
   450       return INFEASIBLE;
   448     case LPX_FEAS://Feasible    
   451     case LPX_D_FEAS://Feasible    
   449       switch (lpx_get_prim_stat(lp)) {
   452       switch (lpx_get_status(lp)) {
   450       case LPX_P_NOFEAS:
   453       case LPX_NOFEAS:
   451 	return INFINITE;
   454 	return INFINITE;
   452       case LPX_OPT:
   455       case LPX_OPT:
   453 	return OPTIMAL;
   456 	return OPTIMAL;
   454       default:
   457       default:
   455 	return FEASIBLE;
   458 	return FEASIBLE;