[Lemon-commits] [lemon_svn] alpar: r1727 - hugo/trunk/src/work/athos/lp

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:47:13 CET 2006


Author: alpar
Date: Sun Apr  3 12:20:49 2005
New Revision: 1727

Modified:
   hugo/trunk/src/work/athos/lp/lp_base.h
   hugo/trunk/src/work/athos/lp/lp_glpk.cc
   hugo/trunk/src/work/athos/lp/lp_glpk.h
   hugo/trunk/src/work/athos/lp/lp_solver_skeleton.cc
   hugo/trunk/src/work/athos/lp/lp_solver_skeleton.h

Log:
Documentation of abstract functions is in lp_solver_skeleton.h

Modified: hugo/trunk/src/work/athos/lp/lp_base.h
==============================================================================
--- hugo/trunk/src/work/athos/lp/lp_base.h	(original)
+++ hugo/trunk/src/work/athos/lp/lp_base.h	Sun Apr  3 12:20:49 2005
@@ -361,69 +361,26 @@
     _FixId rows;
     _FixId cols;
 
-    /// \e
     virtual int _addCol() = 0;
-    /// \e
     virtual int _addRow() = 0;
-    /// \e
-
-    /// \warning Arrays are indexed from 1 (datum at index 0 is ignored)
-    ///
     virtual void _setRowCoeffs(int i, 
 			       int length,
                                int  const * indices, 
                                Value  const * values ) = 0;
-    /// \e
-
-    /// \warning Arrays are indexed from 1 (datum at index 0 is ignored)
-    ///
     virtual void _setColCoeffs(int i, 
 			       int length,
                                int  const * indices, 
                                Value  const * values ) = 0;
-    
-    /// \e
-
-    /// The lower bound of a variable (column) have to be given by an 
-    /// extended number of type Value, i.e. a finite number of type 
-    /// Value or -\ref INF.
     virtual void _setColLowerBound(int i, Value value) = 0;
-    /// \e
-
-    /// The upper bound of a variable (column) have to be given by an 
-    /// extended number of type Value, i.e. a finite number of type 
-    /// Value or \ref INF.
     virtual void _setColUpperBound(int i, Value value) = 0;
-    /// \e
-
-    /// The lower bound of a linear expression (row) have to be given by an 
-    /// extended number of type Value, i.e. a finite number of type 
-    /// Value or -\ref INF.
     virtual void _setRowLowerBound(int i, Value value) = 0;
-    /// \e
-
-    /// The upper bound of a linear expression (row) have to be given by an 
-    /// extended number of type Value, i.e. a finite number of type 
-    /// Value or \ref INF.
     virtual void _setRowUpperBound(int i, Value value) = 0;
-
-    /// \e
     virtual void _setObjCoeff(int i, Value obj_coef) = 0;
-
-    ///\e
-    
-    ///\bug Wrong interface
-    ///
     virtual SolutionStatus _solve() = 0;
-
-    ///\e
-
-    ///\bug Wrong interface
-    ///
     virtual Value _getPrimal(int i) = 0;
-    ///\e
+    virtual SolutionType _getPrimalType() = 0;
+
 
-    ///\bug unimplemented!!!!
     void clearObj() {}
   public:
 
@@ -431,15 +388,15 @@
     ///\e
     virtual ~LpSolverBase() {}
 
-    ///\name Building up and modification of the LP
+    ///\name Build up and modify of the LP
 
     ///@{
 
     ///Add a new empty column (i.e a new variable) to the LP
     Col addCol() { Col c; c.id=cols.insert(_addCol()); return c;}
 
-    ///\brief Fill the elements of a container with newly created columns
-    ///(i.e a new variables)
+    ///\brief Adds several new columns
+    ///(i.e a variables) at once
     ///
     ///This magic function takes a container as its argument
     ///and fills its elements
@@ -638,7 +595,7 @@
     ///@}
 
 
-    ///\name Solving the LP
+    ///\name Solve the LP
 
     ///@{
 
@@ -647,11 +604,16 @@
     
     ///@}
     
-    ///\name Obtaining the solution LP
+    ///\name Obtain the solution
 
     ///@{
 
     ///\e
+    SolutionType primalType() {
+      return _getPrimalType();
+    }
+
+    ///\e
     Value primal(Col c) { return _getPrimal(cols.floatingId(c.id)); }
 
     ///@}

Modified: hugo/trunk/src/work/athos/lp/lp_glpk.cc
==============================================================================
--- hugo/trunk/src/work/athos/lp/lp_glpk.cc	(original)
+++ hugo/trunk/src/work/athos/lp/lp_glpk.cc	Sun Apr  3 12:20:49 2005
@@ -248,6 +248,11 @@
     return 0;
   }
   
+  LpGlpk::SolutionType LpGlpk::_getPrimalType()
+  {
+    return OPTIMAL;
+  }
+  
 
 
 } //END OF NAMESPACE LEMON

Modified: hugo/trunk/src/work/athos/lp/lp_glpk.h
==============================================================================
--- hugo/trunk/src/work/athos/lp/lp_glpk.h	(original)
+++ hugo/trunk/src/work/athos/lp/lp_glpk.h	Sun Apr  3 12:20:49 2005
@@ -76,6 +76,11 @@
     ///\bug Unimplemented
     ///
     virtual Value _getPrimal(int i);
+    ///\e
+    
+    ///\bug Unimplemented
+    ///
+    virtual SolutionType _getPrimalType();
 
   };
 } //END OF NAMESPACE LEMON

Modified: hugo/trunk/src/work/athos/lp/lp_solver_skeleton.cc
==============================================================================
--- hugo/trunk/src/work/athos/lp/lp_solver_skeleton.cc	(original)
+++ hugo/trunk/src/work/athos/lp/lp_solver_skeleton.cc	Sun Apr  3 12:20:49 2005
@@ -75,5 +75,10 @@
     return 0;
   }
   
+  LpSolverSkeleton::SolutionType LpSolverSkeleton::_getPrimalType()
+  {
+    return OPTIMAL;
+  }
+  
 } //namespace lemon
 

Modified: hugo/trunk/src/work/athos/lp/lp_solver_skeleton.h
==============================================================================
--- hugo/trunk/src/work/athos/lp/lp_solver_skeleton.h	(original)
+++ hugo/trunk/src/work/athos/lp/lp_solver_skeleton.h	Sun Apr  3 12:20:49 2005
@@ -29,23 +29,72 @@
     int col_num,row_num;
     
   protected:
+    /// \e
     virtual int _addCol();
+    /// \e
     virtual int _addRow();
+    /// \e
+
+    /// \warning Arrays are indexed from 1 (datum at index 0 is ignored)
+    ///
     virtual void _setRowCoeffs(int i, 
 			       int length,
                                int  const * indices, 
                                Value  const * values );
+    /// \e
+
+    /// \warning Arrays are indexed from 1 (datum at index 0 is ignored)
+    ///
     virtual void _setColCoeffs(int i, 
 			       int length,
                                int  const * indices, 
-                               Value  const * values);
+                               Value  const * values );
+    
+    /// \e
+
+    /// The lower bound of a variable (column) have to be given by an 
+    /// extended number of type Value, i.e. a finite number of type 
+    /// Value or -\ref INF.
     virtual void _setColLowerBound(int i, Value value);
+    /// \e
+
+    /// The upper bound of a variable (column) have to be given by an 
+    /// extended number of type Value, i.e. a finite number of type 
+    /// Value or \ref INF.
     virtual void _setColUpperBound(int i, Value value);
+    /// \e
+
+    /// The lower bound of a linear expression (row) have to be given by an 
+    /// extended number of type Value, i.e. a finite number of type 
+    /// Value or -\ref INF.
     virtual void _setRowLowerBound(int i, Value value);
+    /// \e
+
+    /// The upper bound of a linear expression (row) have to be given by an 
+    /// extended number of type Value, i.e. a finite number of type 
+    /// Value or \ref INF.
     virtual void _setRowUpperBound(int i, Value value);
+
+    /// \e
     virtual void _setObjCoeff(int i, Value obj_coef);
+
+    ///\e
+    
+    ///\bug Wrong interface
+    ///
     virtual SolutionStatus _solve();
+
+    ///\e
+
+    ///\bug Wrong interface
+    ///
     virtual Value _getPrimal(int i);
+    ///\e
+
+    ///\bug Wrong interface
+    ///
+    virtual SolutionType _getPrimalType();
+
   public:
     LpSolverSkeleton() : LpSolverBase(), col_num(0), row_num(0) {}
   };  



More information about the Lemon-commits mailing list