Changeset 2213:2c094dfa176d in lemon-0.x for lemon/mip_glpk.cc
- Timestamp:
- 09/08/06 17:51:32 (17 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2941
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/mip_glpk.cc
r2185 r2213 58 58 LpGlpk::SolveExitStatus MipGlpk::_solve(){ 59 59 int result = lpx_simplex(lp); 60 result = lpx_integer(lp);61 switch (result){62 case LPX_E_OBJLL:63 case LPX_E_OBJUL:64 case LPX_E_ITLIM:65 case LPX_E_TMLIM:60 // 61 if (lpx_get_status(lp)==LPX_OPT){ 62 //Maybe we could try the routine lpx_intopt(lp), a revised 63 //version of lpx_integer 64 result = lpx_integer(lp); 65 switch (result){ 66 66 case LPX_E_OK: 67 67 return SOLVED; 68 68 default: 69 return UNSOLVED; 69 return UNSOLVED; 70 } 71 70 72 } 73 return UNSOLVED; 71 74 } 72 75 … … 74 77 LpGlpk::SolutionStatus MipGlpk::_getMipStatus(){ 75 78 76 //Meg kell nezni: ha az LP is infinite, akkor ez is, ha az is 77 //infeasible, akkor ez is, de ez lehet maskepp is infeasible. 78 int stat= lpx_mip_status(lp); 79 switch (stat) { 80 case LPX_I_UNDEF://Undefined (no solve has been run yet) 81 return UNDEFINED; 82 case LPX_I_NOFEAS://There is no feasible integral solution (primal, I guess) 83 return INFEASIBLE; 84 // case LPX_UNBND://Unbounded 85 // return INFINITE; 86 case LPX_I_FEAS://Feasible 87 return FEASIBLE; 88 case LPX_I_OPT://Feasible 89 return OPTIMAL; 90 default: 79 if (lpx_get_status(lp)==LPX_OPT){ 80 //Meg kell nezni: ha az LP is infinite, akkor ez is, ha az is 81 //infeasible, akkor ez is, de ez lehet maskepp is infeasible. 82 int stat= lpx_mip_status(lp); 83 84 switch (stat) { 85 case LPX_I_UNDEF://Undefined (no solve has been run yet) 86 return UNDEFINED; 87 case LPX_I_NOFEAS://There is no feasible integral solution 88 return INFEASIBLE; 89 // case LPX_UNBND://Unbounded 90 // return INFINITE; 91 case LPX_I_FEAS://Feasible 92 return FEASIBLE; 93 case LPX_I_OPT://Feasible 94 return OPTIMAL; 95 default: 91 96 return UNDEFINED; //to avoid gcc warning 92 97 //FIXME error 98 } 93 99 } 100 else 101 return UNDEFINED; //Maybe we could refine this: what does the LP 102 //relaxation look like 103 94 104 } 95 105
Note: See TracChangeset
for help on using the changeset viewer.