Changeset 2218:50f1a780a5ff in lemon-0.x for lemon
- Timestamp:
- 09/21/06 16:46:28 (18 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2952
- Location:
- lemon
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/Makefile.am
r2211 r2218 26 26 if HAVE_CPLEX 27 27 lemon_libemon_la_SOURCES += lemon/lp_cplex.cc 28 lemon_libemon_la_SOURCES += lemon/mip_cplex.cc 28 29 endif 29 30 … … 79 80 lemon/min_cut.h \ 80 81 lemon/mip_glpk.h \ 82 lemon/mip_cplex.h \ 81 83 lemon/path.h \ 82 84 lemon/polynomial.h \ -
lemon/lp.h
r2144 r2218 22 22 #include<lemon/config.h> 23 23 24 24 25 #ifdef HAVE_GLPK 25 26 #include <lemon/lp_glpk.h> … … 27 28 #elif HAVE_CPLEX 28 29 #include <lemon/lp_cplex.h> 30 #include <lemon/mip_cplex.h> 29 31 #endif 30 32 … … 33 35 ///\ingroup gen_opt_group 34 36 namespace lemon { 35 37 36 38 #ifdef DOXYGEN 37 39 ///The default LP solver identifier … … 73 75 #define DEFAULT_LP CPLEX 74 76 typedef LpCplex Lp; 77 typedef MipCplex Mip; 75 78 const char default_solver_name[]="CPLEX"; 76 79 #endif -
lemon/lp_base.h
r2185 r2218 76 76 return cross[n]; 77 77 } 78 ///\todo Create an own exception type. 79 else throw LogicError(); //floatingId-s must form a continuous range; 78 else { 79 ///\todo Create an own exception type. 80 throw LogicError(); //floatingId-s must form a continuous range; 81 } 80 82 } 81 83 ///Remove a fix id. … … 1170 1172 REAL = 0, 1171 1173 ///Integer variable 1172 INTEGER = 1 1174 1175 ///Unfortunately, cplex 7.5 somewhere writes something like 1176 ///#define INTEGER 'I' 1177 LEMON_INTEGER = 1 1173 1178 ///\todo No support for other types yet. 1174 1179 }; … … 1193 1198 void integer(Col c, bool enable) { 1194 1199 if (enable) 1195 colType(c, INTEGER);1200 colType(c,LEMON_INTEGER); 1196 1201 else 1197 1202 colType(c,REAL); … … 1203 1208 ///\return true if the column has integer type and false if not. 1204 1209 bool integer(Col c){ 1205 return (colType(c)== INTEGER);1210 return (colType(c)==LEMON_INTEGER); 1206 1211 } 1207 1212 -
lemon/lp_cplex.cc
r2168 r2218 270 270 status = CPXlpopt(env, lp); 271 271 //status = CPXprimopt(env, lp); 272 #if CPX_VERSION >= 900272 #if CPX_VERSION >= 800 273 273 if (status) 274 274 { … … 417 417 LpCplex::SolutionStatus LpCplex::_getPrimalStatus() 418 418 { 419 //Unboundedness not treated well: the following is from cplex 9.0 doc 420 // About Unboundedness 421 422 // The treatment of models that are unbounded involves a few 423 // subtleties. Specifically, a declaration of unboundedness means that 424 // ILOG CPLEX has determined that the model has an unbounded 425 // ray. Given any feasible solution x with objective z, a multiple of 426 // the unbounded ray can be added to x to give a feasible solution 427 // with objective z-1 (or z+1 for maximization models). Thus, if a 428 // feasible solution exists, then the optimal objective is 429 // unbounded. Note that ILOG CPLEX has not necessarily concluded that 430 // a feasible solution exists. Users can call the routine CPXsolninfo 431 // to determine whether ILOG CPLEX has also concluded that the model 432 // has a feasible solution. 433 419 434 int stat = CPXgetstat(env, lp); 420 #if CPX_VERSION >= 900435 #if CPX_VERSION >= 800 421 436 switch (stat) 422 437 { … … 486 501 { 487 502 int stat = CPXgetstat(env, lp); 488 #if CPX_VERSION >= 900503 #if CPX_VERSION >= 800 489 504 switch (stat) 490 505 { … … 515 530 { 516 531 int stat = CPXgetstat(env, lp); 517 #if CPX_VERSION >= 900532 #if CPX_VERSION >= 800 518 533 switch (stat) 519 534 { -
lemon/lp_cplex.h
r1956 r2218 35 35 /// 36 36 /// This class implements an interface for the CPLEX LP solver. 37 class LpCplex : public LpSolverBase {37 class LpCplex :virtual public LpSolverBase { 38 38 39 39 public: -
lemon/mip_glpk.cc
r2213 r2218 17 17 */ 18 18 19 #ifndef LEMON_ ILP_GLPK_CC20 #define LEMON_ ILP_GLPK_CC19 #ifndef LEMON_MIP_GLPK_CC 20 #define LEMON_MIP_GLPK_CC 21 21 22 22 ///\file 23 ///\brief Implementation of the LEMON-GLPK lp solver interface.23 ///\brief Implementation of the LEMON-GLPK mip solver interface. 24 24 25 25 #include <lemon/mip_glpk.h> … … 33 33 void MipGlpk::_colType(int i, MipGlpk::ColTypes col_type){ 34 34 switch (col_type){ 35 case INTEGER:35 case LEMON_INTEGER: 36 36 lpx_set_col_kind(lp,i,LPX_IV); 37 37 break; … … 47 47 switch (lpx_get_col_kind(lp,i)){ 48 48 case LPX_IV: 49 return INTEGER;//Or binary49 return LEMON_INTEGER;//Or binary 50 50 case LPX_CV: 51 51 return REAL; … … 111 111 return lpx_mip_obj_val(lp); 112 112 } 113 } //END O GNAMESPACE LEMON113 } //END OF NAMESPACE LEMON 114 114 115 #endif 115 #endif //END OF MIP_GLPK_CC -
lemon/mip_glpk.h
r2185 r2218 17 17 */ 18 18 19 #ifndef LEMON_ ILP_GLPK_H20 #define LEMON_ ILP_GLPK_H19 #ifndef LEMON_MIP_GLPK_H 20 #define LEMON_MIP_GLPK_H 21 21 22 22 ///\file 23 ///\brief Header of the LEMON-GLPK lp solver interface.23 ///\brief Header of the LEMON-GLPK mip solver interface. 24 24 ///\ingroup gen_opt_group 25 25 … … 28 28 29 29 namespace lemon { 30 /// \brief Interface for the GLPK ILP solver30 /// \brief Interface for the GLPK MIP solver 31 31 /// 32 /// This class implements an interface for the GLPK ILP solver.32 /// This class implements an interface for the GLPK MIP solver. 33 33 ///\ingroup gen_opt_group 34 34 class MipGlpk : public MipSolverBase, public LpGlpk{ … … 57 57 } //END OF NAMESPACE LEMON 58 58 59 #endif // END OF LEMON_ ILP_GLPK_H59 #endif // END OF LEMON_MIP_GLPK_H
Note: See TracChangeset
for help on using the changeset viewer.