Index: src/work/marci/lp/lp_solver_wrapper_3.h
===================================================================
--- src/work/marci/lp/lp_solver_wrapper_3.h	(revision 1074)
+++ src/work/marci/lp/lp_solver_wrapper_3.h	(revision 1081)
@@ -37,5 +37,4 @@
 
 namespace lemon {
-
   
   /// \addtogroup misc
@@ -185,8 +184,15 @@
     /// \e
     virtual ~LPSolverBase() { }
+
+    //MATRIX INDEPEDENT MANIPULATING FUNCTIONS
+
+  public:
     /// \e
     virtual void setMinimize() = 0;
     /// \e
     virtual void setMaximize() = 0;
+
+    //LOW LEVEL INTERFACE, MATRIX MANIPULATING FUNCTIONS
+
   protected:
     /// \e
@@ -194,4 +200,36 @@
     /// \e
     virtual int _addCol() = 0;
+    /// \e
+    virtual void _setRowCoeffs(int i, 
+			       std::vector<std::pair<int, double> > coeffs) = 0;
+    /// \e
+    virtual void _setColCoeffs(int i, 
+			       std::vector<std::pair<int, double> > coeffs) = 0;
+    /// \e
+    virtual void _eraseCol(int i) = 0;
+    /// \e
+    virtual void _eraseRow(int i) = 0;
+  public:
+    /// \e
+    enum Bound { FREE, LOWER, UPPER, DOUBLE, FIXED };
+  protected:
+    /// \e
+    virtual void _setColBounds(int i, Bound bound, 
+			       _Value lo, _Value up) = 0; 
+    /// \e
+    virtual void _setRowBounds(int i, Bound bound, 
+			       _Value lo, _Value up) = 0; 
+    /// \e
+    virtual void _setObjCoef(int i, _Value obj_coef) = 0;
+    /// \e
+    virtual _Value _getObjCoef(int i) = 0;
+
+    //LOW LEVEL, SOLUTION RETRIEVING FUNCTIONS
+
+  protected:
+    virtual _Value _getPrimal(int i) = 0;
+
+    //HIGH LEVEL INTERFACE, MATRIX MANIPULATING FUNTIONS
+
   public:
     /// \e
@@ -222,10 +260,4 @@
     }
     /// \e
-    virtual void setRowCoeffs(int i, 
-			      std::vector<std::pair<int, double> > coeffs) = 0;
-    /// \e
-    virtual void setColCoeffs(int i, 
-			      std::vector<std::pair<int, double> > coeffs) = 0;
-    /// \e
     template <typename Begin, typename End>
     void setRowCoeffs(RowIt row_it, Begin begin, End end) {
@@ -235,5 +267,5 @@
 			 make_pair(col_iter_map[begin->first], begin->second));
       }
-      setRowCoeffs(row_iter_map[row_it], coeffs);
+      _setRowCoeffs(row_iter_map[row_it], coeffs);
     }
     /// \e
@@ -245,55 +277,6 @@
 			 make_pair(row_iter_map[begin->first], begin->second));
       }
-      setColCoeffs(col_iter_map[col_it], coeffs);
-    }
-    /// temporally, glpk style indexing
-    //virtual void setRowCoeffs(RowIt row_it, int num, 
-    //		      int* indices, _Value* doubles) = 0;
-    //pair<RowIt, _Value>-bol kell megadni egy std range-et
-    /// \e
-    //    virtual void seColCoeffs(int i, 
-    //			      std::vector<std::pair<int, double> > coeffs) = 0;
-    /// \e
-//     template <typename Begin, typename End>
-//     void setRowCoeffs(RowIt row_it, Begin begin, End end) {
-//       int mem_length=1+colNum();
-//       int* indices = new int[mem_length];
-//       _Value* doubles = new _Value[mem_length];
-//       int length=0;
-//       for ( ; begin!=end; ++begin) {
-// 	++length;
-// 	indices[length]=col_iter_map[begin->first];
-// 	doubles[length]=begin->second;
-//       }
-//       setRowCoeffs(row_it, length, indices, doubles);
-//       delete [] indices;
-//       delete [] doubles;
-//     } 
-    /// temporally, glpk style indexing
-    //virtual void setColCoeffs(ColIt col_it, int num, 
-    //			      int* indices, _Value* doubles) = 0;
-    //pair<ColIt, _Value>-bol kell megadni egy std range-et
-    /// \e
-//     template <typename Begin, typename End>
-//     void setColCoeffs(ColIt col_it, Begin begin, End end) {
-//       int mem_length=1+rowNum();
-//       int* indices = new int[mem_length];
-//       _Value* doubles = new _Value[mem_length];
-//       int length=0;
-//       for ( ; begin!=end; ++begin) {
-// 	++length;
-// 	indices[length]=row_iter_map[begin->first];
-// 	doubles[length]=begin->second;
-//       }
-//       setColCoeffs(col_it, length, indices, doubles);
-//       delete [] indices;
-//       delete [] doubles;
-//     }
-  protected:
-    /// \e
-    virtual void _eraseCol(int i) = 0;
-    /// \e
-    virtual void _eraseRow(int i) = 0;
-  public:
+      _setColCoeffs(col_iter_map[col_it], coeffs);
+    }
     /// \e
     void eraseCol(const ColIt& col_it) {
@@ -323,13 +306,24 @@
     }
     /// \e
-    virtual void setColBounds(const ColIt& col_it, int bound_type, 
-			      _Value lo, _Value up) =0; 
-    /// \e
-    virtual _Value getObjCoef(const ColIt& col_it) = 0;
-    /// \e
-    virtual void setRowBounds(const RowIt& row_it, int bound_type, 
-			      _Value lo, _Value up) = 0;
-    /// \e
-    virtual void setObjCoef(const ColIt& col_it, _Value obj_coef) = 0;
+    void setColBounds(const ColIt& col_it, Bound bound, 
+		      _Value lo, _Value up) {
+      _setColBounds(col_iter_map[col_it], bound, lo, up);
+    }
+    /// \e
+    void setRowBounds(const RowIt& row_it, Bound bound, 
+		      _Value lo, _Value up) {
+      _setRowBounds(row_iter_map[row_it], bound, lo, up);
+    }
+    /// \e
+    void setObjCoef(const ColIt& col_it, _Value obj_coef) {
+      _setObjCoef(col_iter_map[col_it], obj_coef);
+    }
+    /// \e
+    _Value getObjCoef(const ColIt& col_it) {
+      return _getObjCoef(col_iter_map[col_it]);
+    }
+
+    //SOLVER FUNCTIONS
+
     /// \e
     virtual void solveSimplex() = 0;
@@ -339,7 +333,16 @@
     virtual void solveDualSimplex() = 0;
     /// \e
-    virtual _Value getPrimal(const ColIt& col_it) = 0;
+
+    //HIGH LEVEL, SOLUTION RETRIEVING FUNCTIONS
+
+  public:
+    _Value getPrimal(const ColIt& col_it) {
+      return _getPrimal(col_iter_map[col_it]);
+    }
     /// \e
     virtual _Value getObjVal() = 0;
+
+    //OTHER FUNCTIONS
+
     /// \e
     virtual int rowNum() const = 0;
@@ -376,5 +379,5 @@
   /// solvers, i.e. it makes possible to write algorithms using LP's, 
   /// in which the solver can be changed to an other one easily.
-  class LPSolverWrapper : public LPSolverBase<double> {
+  class LPGLPK : public LPSolverBase<double> {
   public:
     typedef LPSolverBase<double> Parent;
@@ -386,12 +389,15 @@
   public:
     /// \e
-    LPSolverWrapper() : Parent(), 
+    LPGLPK() : Parent(), 
 			lp(lpx_create_prob()) {
       lpx_set_int_parm(lp, LPX_K_DUAL, 1);
     }
     /// \e
-    ~LPSolverWrapper() {
+    ~LPGLPK() {
       lpx_delete_prob(lp);
     }
+
+    //MATRIX INDEPEDENT MANIPULATING FUNCTIONS
+
     /// \e
     void setMinimize() { 
@@ -402,4 +408,7 @@
       lpx_set_obj_dir(lp, LPX_MAX);
     }
+
+    //LOW LEVEL INTERFACE, MATRIX MANIPULATING FUNCTIONS
+
   protected:
     /// \e
@@ -411,9 +420,7 @@
       return lpx_add_rows(lp, 1);
     }
-  public:
-    using Parent::setRowCoeffs;
-    /// \e
-    virtual void setRowCoeffs(int i, 
-			      std::vector<std::pair<int, double> > coeffs) {
+    /// \e
+    virtual void _setRowCoeffs(int i, 
+			       std::vector<std::pair<int, double> > coeffs) {
       int mem_length=1+colNum();
       int* indices = new int[mem_length];
@@ -425,8 +432,8 @@
 	indices[length]=it->first;
 	doubles[length]=it->second;
-	std::cout << "  " << indices[length] << " " 
-		  << doubles[length] << std::endl;
-      }
-      std::cout << i << " " << length << std::endl;
+// 	std::cout << "  " << indices[length] << " " 
+// 		  << doubles[length] << std::endl;
+      }
+//      std::cout << i << " " << length << std::endl;
       lpx_set_mat_row(lp, i, length, indices, doubles);
       delete [] indices;
@@ -434,6 +441,6 @@
     }
     /// \e
-    virtual void setColCoeffs(int i, 
-			      std::vector<std::pair<int, double> > coeffs) {
+    virtual void _setColCoeffs(int i, 
+			       std::vector<std::pair<int, double> > coeffs) {
       int mem_length=1+rowNum();
       int* indices = new int[mem_length];
@@ -450,72 +457,5 @@
       delete [] doubles;
     }
-//     /// \e
-//     /// temporally, glpk style indexing
-//     virtual void setRowCoeffs(RowIt row_it, int num, 
-// 			      int* indices, _Value* doubles) = 0;
-//     //pair<RowIt, _Value>-bol kell megadni egy std range-et
-//     /// \e
-//     template <typename Begin, typename End>
-//     void setRowCoeffs(RowIt row_it, Begin begin, End end) {
-//       int mem_length=1+colNum();
-//       int* indices = new int[mem_length];
-//       _Value* doubles = new _Value[mem_length];
-//       int length=0;
-//       for ( ; begin!=end; ++begin) {
-// 	++length;
-// 	indices[length]=col_iter_map[begin->first];
-// 	doubles[length]=begin->second;
-//       }
-//       setRowCoeffs(row_it, length, indices, doubles);
-//       delete [] indices;
-//       delete [] doubles;
-//     }
-//     void setRowCoeffs(RowIt row_it, int length, 
-// 		      int* indices, double* doubles) {
-//       lpx_set_mat_row(lp, row_iter_map[row_it], length, indices, doubles);
-//     }
-//     using Parent::setColCoeffs;
-//     void setColCoeffs(ColIt col_it, int length, 
-// 		      int* indices, double* doubles) {
-//       lpx_set_mat_col(lp, col_iter_map[col_it], length, indices, doubles);
-//     }
-    //     //pair<RowIt, double>-bol kell megadni egy std range-et
-    //     /// \e
-    //     template <typename Begin, typename End>
-    //     void setColCoeffs(const ColIt& col_it, 
-    // 		      Begin begin, End end) {
-    //       int mem_length=1+lpx_get_num_rows(lp);
-    //       int* indices = new int[mem_length];
-    //       double* doubles = new double[mem_length];
-    //       int length=0;
-    //       for ( ; begin!=end; ++begin) {
-    // 	++length;
-    // 	indices[length]=row_iter_map[begin->first];
-    // 	doubles[length]=begin->second;
-    //       }
-    //       lpx_set_mat_col(lp, col_iter_map[col_it], length, indices, doubles);
-    //       delete [] indices;
-    //       delete [] doubles;
-    //     }
-    //     //pair<ColIt, double>-bol kell megadni egy std range-et
-    //     /// \e
-    //     template <typename Begin, typename End>
-    //     void setRowCoeffs(const RowIt& row_it, 
-    // 		      Begin begin, End end) {
-    //       int mem_length=1+lpx_get_num_cols(lp);
-    //       int* indices = new int[mem_length];
-    //       double* doubles = new double[mem_length];
-    //       int length=0;
-    //       for ( ; begin!=end; ++begin) {
-    // 	++length;
-    // 	indices[length]=col_iter_map[begin->first];
-    // 	doubles[length]=begin->second;
-    //       }
-    //       lpx_set_mat_row(lp, row_iter_map[row_it], length, indices, doubles);
-    //       delete [] indices;
-    //       delete [] doubles;
-    //     }
-    /// \e
-  protected:
+    /// \e
     virtual void _eraseCol(int i) {
       int cols[2];
@@ -528,23 +468,54 @@
       lpx_del_rows(lp, 1, rows);
     }
-  public:
-    /// \e
-    void setColBounds(const ColIt& col_it, int bound_type, 
-		      double lo, double up) {
-      lpx_set_col_bnds(lp, col_iter_map[col_it], bound_type, lo, up);
-    }
-    /// \e
-    double getObjCoef(const ColIt& col_it) { 
-      return lpx_get_obj_coef(lp, col_iter_map[col_it]);
-    }
-    /// \e
-    void setRowBounds(const RowIt& row_it, int bound_type, 
-		      double lo, double up) {
-      lpx_set_row_bnds(lp, row_iter_map[row_it], bound_type, lo, up);
-    }
-    /// \e
-    void setObjCoef(const ColIt& col_it, double obj_coef) { 
-      lpx_set_obj_coef(lp, col_iter_map[col_it], obj_coef);
-    }
+    virtual void _setColBounds(int i, Bound bound, 
+			       double lo, double up) {
+      switch (bound) {
+      case FREE:
+	lpx_set_col_bnds(lp, i, LPX_FR, lo, up);
+	break;
+      case LOWER:
+	lpx_set_col_bnds(lp, i, LPX_LO, lo, up);
+	break;
+      case UPPER:
+	lpx_set_col_bnds(lp, i, LPX_UP, lo, up);
+	break;
+      case DOUBLE:
+	lpx_set_col_bnds(lp, i, LPX_DB, lo, up);
+	break;
+      case FIXED:
+	lpx_set_col_bnds(lp, i, LPX_FX, lo, up);
+	break;
+      }
+    } 
+    virtual void _setRowBounds(int i, Bound bound, 
+			       double lo, double up) {
+      switch (bound) {
+      case FREE:
+	lpx_set_row_bnds(lp, i, LPX_FR, lo, up);
+	break;
+      case LOWER:
+	lpx_set_row_bnds(lp, i, LPX_LO, lo, up);
+	break;
+      case UPPER:
+	lpx_set_row_bnds(lp, i, LPX_UP, lo, up);
+	break;
+      case DOUBLE:
+	lpx_set_row_bnds(lp, i, LPX_DB, lo, up);
+	break;
+      case FIXED:
+	lpx_set_row_bnds(lp, i, LPX_FX, lo, up);
+	break;
+      }
+    } 
+  protected:
+    /// \e
+    virtual double _getObjCoef(int i) { 
+      return lpx_get_obj_coef(lp, i);
+    }
+    /// \e
+    virtual void _setObjCoef(int i, double obj_coef) { 
+      lpx_set_obj_coef(lp, i, obj_coef);
+    }
+  public:
     /// \e
     void solveSimplex() { lpx_simplex(lp); }
@@ -554,7 +525,9 @@
     void solveDualSimplex() { lpx_simplex(lp); }
     /// \e
-    double getPrimal(const ColIt& col_it) {
-      return lpx_get_col_prim(lp, col_iter_map[col_it]);
-    }
+  protected:
+    virtual double _getPrimal(int i) {
+      return lpx_get_col_prim(lp, i);
+    }
+  public:
     /// \e
     double getObjVal() { return lpx_get_obj_val(lp); }
