Index: lemon/lp_base.h
===================================================================
--- lemon/lp_base.h	(revision 877)
+++ lemon/lp_base.h	(revision 932)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2010
+ * Copyright (C) 2003-2008
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -83,5 +83,5 @@
       MESSAGE_VERBOSE
     };
-
+    
 
     ///The floating point type used by the solver
@@ -115,12 +115,12 @@
       typedef True LpCol;
       /// Default constructor
-
+      
       /// \warning The default constructor sets the Col to an
       /// undefined value.
       Col() {}
       /// Invalid constructor \& conversion.
-
+      
       /// This constructor initializes the Col to be invalid.
-      /// \sa Invalid for more details.
+      /// \sa Invalid for more details.      
       Col(const Invalid&) : _id(-1) {}
       /// Equality operator
@@ -147,5 +147,5 @@
     ///Iterator for iterate over the columns of an LP problem
 
-    /// Its usage is quite simple, for example, you can count the number
+    /// Its usage is quite simple, for example you can count the number
     /// of columns in an LP \c lp:
     ///\code
@@ -157,10 +157,10 @@
     public:
       /// Default constructor
-
+      
       /// \warning The default constructor sets the iterator
       /// to an undefined value.
       ColIt() {}
       /// Sets the iterator to the first Col
-
+      
       /// Sets the iterator to the first Col.
       ///
@@ -170,10 +170,10 @@
       }
       /// Invalid constructor \& conversion
-
+      
       /// Initialize the iterator to be invalid.
       /// \sa Invalid for more details.
       ColIt(const Invalid&) : Col(INVALID) {}
       /// Next column
-
+      
       /// Assign the iterator to the next column.
       ///
@@ -210,12 +210,12 @@
       typedef True LpRow;
       /// Default constructor
-
+      
       /// \warning The default constructor sets the Row to an
       /// undefined value.
       Row() {}
       /// Invalid constructor \& conversion.
-
+      
       /// This constructor initializes the Row to be invalid.
-      /// \sa Invalid for more details.
+      /// \sa Invalid for more details.      
       Row(const Invalid&) : _id(-1) {}
       /// Equality operator
@@ -225,5 +225,5 @@
       bool operator==(Row r) const  {return _id == r._id;}
       /// Inequality operator
-
+      
       /// \sa operator==(Row r)
       ///
@@ -242,5 +242,5 @@
     ///Iterator for iterate over the rows of an LP problem
 
-    /// Its usage is quite simple, for example, you can count the number
+    /// Its usage is quite simple, for example you can count the number
     /// of rows in an LP \c lp:
     ///\code
@@ -252,10 +252,10 @@
     public:
       /// Default constructor
-
+      
       /// \warning The default constructor sets the iterator
       /// to an undefined value.
       RowIt() {}
       /// Sets the iterator to the first Row
-
+      
       /// Sets the iterator to the first Row.
       ///
@@ -265,10 +265,10 @@
       }
       /// Invalid constructor \& conversion
-
+      
       /// Initialize the iterator to be invalid.
       /// \sa Invalid for more details.
       RowIt(const Invalid&) : Row(INVALID) {}
       /// Next row
-
+      
       /// Assign the iterator to the next row.
       ///
@@ -348,5 +348,5 @@
       typedef True SolverExpr;
       /// Default constructor
-
+      
       /// Construct an empty expression, the coefficients and
       /// the constant component are initialized to zero.
@@ -449,7 +449,7 @@
 
       ///Iterator over the expression
-
-      ///The iterator iterates over the terms of the expression.
-      ///
+      
+      ///The iterator iterates over the terms of the expression. 
+      /// 
       ///\code
       ///double s=0;
@@ -465,5 +465,5 @@
 
         /// Sets the iterator to the first term
-
+        
         /// Sets the iterator to the first term of the expression.
         ///
@@ -482,5 +482,5 @@
         const Value& operator*() const { return _it->second; }
         /// Next term
-
+        
         /// Assign the iterator to the next term.
         ///
@@ -494,7 +494,7 @@
 
       /// Const iterator over the expression
-
-      ///The iterator iterates over the terms of the expression.
-      ///
+      
+      ///The iterator iterates over the terms of the expression. 
+      /// 
       ///\code
       ///double s=0;
@@ -510,5 +510,5 @@
 
         /// Sets the iterator to the first term
-
+        
         /// Sets the iterator to the first term of the expression.
         ///
@@ -525,5 +525,5 @@
 
         /// Next term
-
+        
         /// Assign the iterator to the next term.
         ///
@@ -674,5 +674,5 @@
       typedef True SolverExpr;
       /// Default constructor
-
+      
       /// Construct an empty expression, the coefficients are
       /// initialized to zero.
@@ -709,5 +709,5 @@
       }
       /// \brief Removes the coefficients which's absolute value does
-      /// not exceed \c epsilon.
+      /// not exceed \c epsilon. 
       void simplify(Value epsilon = 0.0) {
         std::map<int, Value>::iterator it=comps.begin();
@@ -758,7 +758,7 @@
 
       ///Iterator over the expression
-
-      ///The iterator iterates over the terms of the expression.
-      ///
+      
+      ///The iterator iterates over the terms of the expression. 
+      /// 
       ///\code
       ///double s=0;
@@ -774,5 +774,5 @@
 
         /// Sets the iterator to the first term
-
+        
         /// Sets the iterator to the first term of the expression.
         ///
@@ -792,5 +792,5 @@
 
         /// Next term
-
+        
         /// Assign the iterator to the next term.
         ///
@@ -804,7 +804,7 @@
 
       ///Iterator over the expression
-
-      ///The iterator iterates over the terms of the expression.
-      ///
+      
+      ///The iterator iterates over the terms of the expression. 
+      /// 
       ///\code
       ///double s=0;
@@ -820,5 +820,5 @@
 
         /// Sets the iterator to the first term
-
+        
         /// Sets the iterator to the first term of the expression.
         ///
@@ -835,5 +835,5 @@
 
         /// Next term
-
+        
         /// Assign the iterator to the next term.
         ///
@@ -943,12 +943,4 @@
     virtual int _addCol() = 0;
     virtual int _addRow() = 0;
-
-    virtual int _addRow(Value l, ExprIterator b, ExprIterator e, Value u) {
-      int row = _addRow();
-      _setRowCoeffs(row, b, e);
-      _setRowLowerBound(row, l);
-      _setRowUpperBound(row, u);
-      return row;
-    }
 
     virtual void _eraseCol(int col) = 0;
@@ -1216,8 +1208,6 @@
     ///\return The created row.
     Row addRow(Value l,const Expr &e, Value u) {
-      Row r;
-      e.simplify();
-      r._id = _addRowId(_addRow(l - *e, ExprIterator(e.comps.begin(), cols),
-                                ExprIterator(e.comps.end(), cols), u - *e));
+      Row r=addRow();
+      row(r,l,e,u);
       return r;
     }
@@ -1228,10 +1218,6 @@
     ///\return The created row.
     Row addRow(const Constr &c) {
-      Row r;
-      c.expr().simplify();
-      r._id = _addRowId(_addRow(c.lowerBounded()?c.lowerBound()-*c.expr():-INF,
-                                ExprIterator(c.expr().comps.begin(), cols),
-                                ExprIterator(c.expr().comps.end(), cols),
-                                c.upperBounded()?c.upperBound()-*c.expr():INF));
+      Row r=addRow();
+      row(r,c);
       return r;
     }
@@ -1619,5 +1605,5 @@
   inline LpBase::Constr operator<=(const LpBase::Expr &e,
                                    const LpBase::Expr &f) {
-    return LpBase::Constr(0, f - e, LpBase::INF);
+    return LpBase::Constr(0, f - e, LpBase::NaN);
   }
 
@@ -1637,5 +1623,5 @@
   inline LpBase::Constr operator<=(const LpBase::Expr &e,
                                    const LpBase::Value &f) {
-    return LpBase::Constr(- LpBase::INF, e, f);
+    return LpBase::Constr(LpBase::NaN, e, f);
   }
 
@@ -1646,5 +1632,5 @@
   inline LpBase::Constr operator>=(const LpBase::Expr &e,
                                    const LpBase::Expr &f) {
-    return LpBase::Constr(0, e - f, LpBase::INF);
+    return LpBase::Constr(0, e - f, LpBase::NaN);
   }
 
@@ -1666,5 +1652,5 @@
   inline LpBase::Constr operator>=(const LpBase::Expr &e,
                                    const LpBase::Value &f) {
-    return LpBase::Constr(f, e, LpBase::INF);
+    return LpBase::Constr(f, e, LpBase::NaN);
   }
 
@@ -1818,8 +1804,8 @@
     enum VarStatus {
       /// The variable is in the basis
-      BASIC,
+      BASIC, 
       /// The variable is free, but not basic
       FREE,
-      /// The variable has active lower bound
+      /// The variable has active lower bound 
       LOWER,
       /// The variable has active upper bound
@@ -1900,5 +1886,5 @@
     }
     /// Returns a component of the primal ray
-
+    
     /// The primal ray is solution of the modified primal problem,
     /// where we change each finite bound to 0, and we looking for a
@@ -1934,5 +1920,5 @@
 
     /// Returns a component of the dual ray
-
+    
     /// The dual ray is solution of the modified primal problem, where
     /// we change each finite bound to 0 (i.e. the objective function
@@ -2076,5 +2062,5 @@
     }
     ///The value of the objective function
-
+    
     ///\return
     ///- \ref INF or -\ref INF means either infeasibility or unboundedness
