Index: lemon/Makefile.am
===================================================================
--- lemon/Makefile.am	(revision 2211)
+++ lemon/Makefile.am	(revision 2218)
@@ -26,4 +26,5 @@
 if HAVE_CPLEX
 lemon_libemon_la_SOURCES += lemon/lp_cplex.cc
+lemon_libemon_la_SOURCES += lemon/mip_cplex.cc
 endif
 
@@ -79,4 +80,5 @@
 	lemon/min_cut.h \
 	lemon/mip_glpk.h \
+	lemon/mip_cplex.h \
 	lemon/path.h \
 	lemon/polynomial.h \
Index: lemon/lp.h
===================================================================
--- lemon/lp.h	(revision 2144)
+++ lemon/lp.h	(revision 2218)
@@ -22,4 +22,5 @@
 #include<lemon/config.h>
 
+
 #ifdef HAVE_GLPK
 #include <lemon/lp_glpk.h>
@@ -27,4 +28,5 @@
 #elif HAVE_CPLEX
 #include <lemon/lp_cplex.h>
+#include <lemon/mip_cplex.h>
 #endif
 
@@ -33,5 +35,5 @@
 ///\ingroup gen_opt_group
 namespace lemon {
- 
+
 #ifdef DOXYGEN
   ///The default LP solver identifier
@@ -73,4 +75,5 @@
 #define DEFAULT_LP CPLEX
   typedef LpCplex Lp;
+  typedef MipCplex Mip;
   const char default_solver_name[]="CPLEX";
 #endif
Index: lemon/lp_base.h
===================================================================
--- lemon/lp_base.h	(revision 2185)
+++ lemon/lp_base.h	(revision 2218)
@@ -76,6 +76,8 @@
 	return cross[n];
       }
-      ///\todo Create an own exception type.
-      else throw LogicError(); //floatingId-s must form a continuous range;
+      else {
+	///\todo Create an own exception type.
+	throw LogicError(); //floatingId-s must form a continuous range;
+      }
     }
     ///Remove a fix id.
@@ -1170,5 +1172,8 @@
       REAL = 0,
       ///Integer variable
-      INTEGER = 1
+
+      ///Unfortunately, cplex 7.5 somewhere writes something like
+      ///#define INTEGER 'I'
+      LEMON_INTEGER = 1
       ///\todo No support for other types yet.
     };
@@ -1193,5 +1198,5 @@
     void integer(Col c, bool enable) {
       if (enable)
-	colType(c,INTEGER);
+	colType(c,LEMON_INTEGER);
       else
 	colType(c,REAL);
@@ -1203,5 +1208,5 @@
     ///\return true if the column has integer type and false if not.
     bool integer(Col c){
-      return (colType(c)==INTEGER);
+      return (colType(c)==LEMON_INTEGER);
     }
 
Index: lemon/lp_cplex.cc
===================================================================
--- lemon/lp_cplex.cc	(revision 2168)
+++ lemon/lp_cplex.cc	(revision 2218)
@@ -270,5 +270,5 @@
     status = CPXlpopt(env, lp);
     //status = CPXprimopt(env, lp);
-#if CPX_VERSION >= 900
+#if CPX_VERSION >= 800
     if (status)
     {
@@ -417,6 +417,21 @@
   LpCplex::SolutionStatus LpCplex::_getPrimalStatus()
   {
+    //Unboundedness not treated well: the following is from cplex 9.0 doc
+    // About Unboundedness
+
+    // The treatment of models that are unbounded involves a few
+    // subtleties. Specifically, a declaration of unboundedness means that
+    // ILOG CPLEX has determined that the model has an unbounded
+    // ray. Given any feasible solution x with objective z, a multiple of
+    // the unbounded ray can be added to x to give a feasible solution
+    // with objective z-1 (or z+1 for maximization models). Thus, if a
+    // feasible solution exists, then the optimal objective is
+    // unbounded. Note that ILOG CPLEX has not necessarily concluded that
+    // a feasible solution exists. Users can call the routine CPXsolninfo
+    // to determine whether ILOG CPLEX has also concluded that the model
+    // has a feasible solution.
+
     int stat = CPXgetstat(env, lp);
-#if CPX_VERSION >= 900
+#if CPX_VERSION >= 800
     switch (stat)
     {
@@ -486,5 +501,5 @@
   {
     int stat = CPXgetstat(env, lp);
-#if CPX_VERSION >= 900
+#if CPX_VERSION >= 800
     switch (stat)
     {
@@ -515,5 +530,5 @@
   {
     int stat = CPXgetstat(env, lp);
-#if CPX_VERSION >= 900
+#if CPX_VERSION >= 800
     switch (stat)
     {
Index: lemon/lp_cplex.h
===================================================================
--- lemon/lp_cplex.h	(revision 1956)
+++ lemon/lp_cplex.h	(revision 2218)
@@ -35,5 +35,5 @@
   /// 
   /// This class implements an interface for the CPLEX LP solver.
-  class LpCplex : public LpSolverBase {
+  class LpCplex :virtual public LpSolverBase {
 
   public:
Index: lemon/mip_glpk.cc
===================================================================
--- lemon/mip_glpk.cc	(revision 2213)
+++ lemon/mip_glpk.cc	(revision 2218)
@@ -17,9 +17,9 @@
  */
 
-#ifndef LEMON_ILP_GLPK_CC
-#define LEMON_ILP_GLPK_CC
+#ifndef LEMON_MIP_GLPK_CC
+#define LEMON_MIP_GLPK_CC
 
 ///\file
-///\brief Implementation of the LEMON-GLPK lp solver interface.
+///\brief Implementation of the LEMON-GLPK mip solver interface.
 
 #include <lemon/mip_glpk.h>
@@ -33,5 +33,5 @@
   void MipGlpk::_colType(int i, MipGlpk::ColTypes col_type){
     switch (col_type){
-      case INTEGER:
+      case LEMON_INTEGER:
 	lpx_set_col_kind(lp,i,LPX_IV);
 	break;
@@ -47,5 +47,5 @@
     switch (lpx_get_col_kind(lp,i)){
     case LPX_IV:
-      return INTEGER;//Or binary
+      return LEMON_INTEGER;//Or binary
     case LPX_CV:
       return REAL;
@@ -111,5 +111,5 @@
     return lpx_mip_obj_val(lp);
   }
-} //END OG NAMESPACE LEMON
+} //END OF NAMESPACE LEMON
 
-#endif
+#endif //END OF MIP_GLPK_CC
Index: lemon/mip_glpk.h
===================================================================
--- lemon/mip_glpk.h	(revision 2185)
+++ lemon/mip_glpk.h	(revision 2218)
@@ -17,9 +17,9 @@
  */
 
-#ifndef LEMON_ILP_GLPK_H
-#define LEMON_ILP_GLPK_H
+#ifndef LEMON_MIP_GLPK_H
+#define LEMON_MIP_GLPK_H
 
 ///\file
-///\brief Header of the LEMON-GLPK lp solver interface.
+///\brief Header of the LEMON-GLPK mip solver interface.
 ///\ingroup gen_opt_group
 
@@ -28,7 +28,7 @@
 
 namespace lemon {
-  /// \brief Interface for the GLPK ILP solver
+  /// \brief Interface for the GLPK MIP solver
   /// 
-  /// This class implements an interface for the GLPK ILP solver.
+  /// This class implements an interface for the GLPK MIP solver.
   ///\ingroup gen_opt_group
   class MipGlpk : public MipSolverBase, public LpGlpk{
@@ -57,3 +57,3 @@
 } //END OF NAMESPACE LEMON
 
-#endif // END OF LEMON_ILP_GLPK_H
+#endif // END OF LEMON_MIP_GLPK_H
Index: test/mip_test.cc
===================================================================
--- test/mip_test.cc	(revision 2213)
+++ test/mip_test.cc	(revision 2218)
@@ -1,10 +1,15 @@
-#include <lemon/lp.h>
 #include "test_tools.h"
+
+
+#include <lemon/mip_cplex.h>
+#include <lemon/mip_glpk.h>
+#include<lemon/config.h>
 
 using namespace lemon;
 
-void solveAndCheck(Mip& lp, LpSolverBase::SolutionStatus stat, 
+void solveAndCheck(MipSolverBase& lp, MipSolverBase::SolutionStatus stat, 
 		   double exp_opt) {
   using std::string;
+
   lp.solve();
   //int decimal,sign;
@@ -12,8 +17,9 @@
   buf << "Primalstatus should be: " << int(stat)<<" and it is "<<int(lp.primalStatus());
 
+
   //  itoa(stat,buf1, 10);
   check(lp.mipStatus()==stat, buf.str());
 
-  if (stat ==  LpSolverBase::OPTIMAL) {
+  if (stat ==  MipSolverBase::OPTIMAL) {
     std::ostringstream buf;
     buf << "Wrong optimal value: the right optimum is " << exp_opt; 
@@ -23,18 +29,16 @@
 }
 
-void aTest(Mip& mip)
+void aTest(MipSolverBase& mip)
 {
  //The following example is very simple
 
-  typedef Mip::Row Row;
-  typedef Mip::Col Col;
+
+  typedef MipSolverBase::Row Row;
+  typedef MipSolverBase::Col Col;
+
 
 
   Col x1 = mip.addCol();
   Col x2 = mip.addCol();
-
-
-
-
 
 
@@ -61,16 +65,16 @@
   //over the triangle with vertices 
   double expected_opt=4.0/5.0;
-  solveAndCheck(mip, Mip::OPTIMAL, expected_opt);
+  solveAndCheck(mip, MipSolverBase::OPTIMAL, expected_opt);
 
   //Restrict x2 to integer
-  mip.colType(x2,Mip::INTEGER);  
+  mip.colType(x2,MipSolverBase::LEMON_INTEGER);  
   expected_opt=1.0/2.0;
-  solveAndCheck(mip, Mip::OPTIMAL, expected_opt);
+  solveAndCheck(mip, MipSolverBase::OPTIMAL, expected_opt);
 
 
   //Restrict both to integer
-  mip.colType(x1,Mip::INTEGER);  
+  mip.colType(x1,MipSolverBase::LEMON_INTEGER);  
   expected_opt=0;
-  solveAndCheck(mip, Mip::OPTIMAL, expected_opt);
+  solveAndCheck(mip, MipSolverBase::OPTIMAL, expected_opt);
 
  
@@ -87,4 +91,12 @@
 #endif
 
+
+
+#ifdef HAVE_CPLEX
+  //std::cout<<ATTILA<<INTEGER;
+  MipCplex mip2;
+  aTest(mip2);
+#endif
+
   return 0;
 
