[Lemon-commits] [lemon_svn] alpar: r1096 - hugo/trunk/src/hugo

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


Author: alpar
Date: Sun Sep  5 22:11:47 2004
New Revision: 1096

Modified:
   hugo/trunk/src/hugo/bfs.h
   hugo/trunk/src/hugo/dfs.h
   hugo/trunk/src/hugo/dijkstra.h

Log:
- Changes in doc
- setGraph(...) finally removed from Dijkstra, Bfs and Dfs.


Modified: hugo/trunk/src/hugo/bfs.h
==============================================================================
--- hugo/trunk/src/hugo/bfs.h	(original)
+++ hugo/trunk/src/hugo/bfs.h	Sun Sep  5 22:11:47 2004
@@ -34,9 +34,13 @@
   public:
     ///The type of the underlying graph.
     typedef GR Graph;
+    ///.
     typedef typename Graph::Node Node;
+    ///.
     typedef typename Graph::NodeIt NodeIt;
+    ///.
     typedef typename Graph::Edge Edge;
+    ///.
     typedef typename Graph::OutEdgeIt OutEdgeIt;
     
     ///\brief The type of the map that stores the last
@@ -49,15 +53,22 @@
     typedef typename Graph::template NodeMap<int> DistMap;
 
   private:
+    /// Pointer to the underlying graph.
     const Graph *G;
+    ///Pointer to the map of predecessors edges.
     PredMap *predecessor;
+    ///Indicates if \ref predecessor is locally allocated (\c true) or not.
     bool local_predecessor;
+    ///Pointer to the map of predecessors nodes.
     PredNodeMap *pred_node;
+    ///Indicates if \ref pred_node is locally allocated (\c true) or not.
     bool local_pred_node;
+    ///Pointer to the map of distances.
     DistMap *distance;
+    ///Indicates if \ref distance is locally allocated (\c true) or not.
     bool local_distance;
 
-    //The source node of the last execution.
+    ///The source node of the last execution.
     Node source;
 
 
@@ -79,6 +90,9 @@
     }
     
   public :    
+    ///Constructor.
+    
+    ///\param _G the graph the algorithm will run on.
     Bfs(const Graph& _G) :
       G(&_G),
       predecessor(NULL), local_predecessor(false),
@@ -86,6 +100,7 @@
       distance(NULL), local_distance(false)
     { }
     
+    ///Destructor.
     ~Bfs() 
     {
       if(local_predecessor) delete predecessor;
@@ -93,17 +108,6 @@
       if(local_distance) delete distance;
     }
 
-    ///Sets the graph the algorithm will run on.
-
-    ///Sets the graph the algorithm will run on.
-    ///\return <tt> (*this) </tt>
-    ///\bug What about maps?
-    ///\todo It may be unnecessary
-    Bfs &setGraph(const Graph &_G) 
-    {
-      G = &_G;
-      return *this;
-    }
     ///Sets the map storing the predecessor edges.
 
     ///Sets the map storing the predecessor edges.
@@ -249,7 +253,7 @@
     ///Checks if a node is reachable from the root.
 
     ///Returns \c true if \c v is reachable from the root.
-    ///\warning The root node is reported to be reached!
+    ///\note The root node is reported to be reached!
     ///
     ///\pre \ref run() must be called before using this function.
     ///

Modified: hugo/trunk/src/hugo/dfs.h
==============================================================================
--- hugo/trunk/src/hugo/dfs.h	(original)
+++ hugo/trunk/src/hugo/dfs.h	Sun Sep  5 22:11:47 2004
@@ -33,9 +33,13 @@
   public:
     ///The type of the underlying graph.
     typedef GR Graph;
+    /// .
     typedef typename Graph::Node Node;
+    /// .
     typedef typename Graph::NodeIt NodeIt;
+    /// .
     typedef typename Graph::Edge Edge;
+    /// .
     typedef typename Graph::OutEdgeIt OutEdgeIt;
     
     ///\brief The type of the map that stores the last
@@ -48,15 +52,22 @@
     typedef typename Graph::template NodeMap<int> DistMap;
 
   private:
+    /// Pointer to the underlying graph.
     const Graph *G;
+    ///Pointer to the map of predecessors edges.
     PredMap *predecessor;
+    ///Indicates if \ref predecessor is locally allocated (\c true) or not.
     bool local_predecessor;
+    ///Pointer to the map of predecessors nodes.
     PredNodeMap *pred_node;
+    ///Indicates if \ref pred_node is locally allocated (\c true) or not.
     bool local_pred_node;
+    ///Pointer to the map of distances.
     DistMap *distance;
+    ///Indicates if \ref distance is locally allocated (\c true) or not.
     bool local_distance;
 
-    //The source node of the last execution.
+    ///The source node of the last execution.
     Node source;
 
 
@@ -78,6 +89,9 @@
     }
     
   public :    
+    ///Constructor.
+    
+    ///\param _G the graph the algorithm will run on.
     Dfs(const Graph& _G) :
       G(&_G),
       predecessor(NULL), local_predecessor(false),
@@ -85,6 +99,7 @@
       distance(NULL), local_distance(false)
     { }
     
+    ///Destructor.
     ~Dfs() 
     {
       if(local_predecessor) delete predecessor;
@@ -92,17 +107,6 @@
       if(local_distance) delete distance;
     }
 
-    ///Sets the graph the algorithm will run on.
-
-    ///Sets the graph the algorithm will run on.
-    ///\return <tt> (*this) </tt>
-    ///\bug What about maps?
-    ///\todo It may be unnecessary
-    Dfs &setGraph(const Graph &_G) 
-    {
-      G = &_G;
-      return *this;
-    }
     ///Sets the map storing the predecessor edges.
 
     ///Sets the map storing the predecessor edges.
@@ -253,7 +257,7 @@
     ///Checks if a node is reachable from the root.
 
     ///Returns \c true if \c v is reachable from the root.
-    ///\warning The root node is reported to be reached!
+    ///\note The root node is reported to be reached!
     ///
     ///\pre \ref run() must be called before using this function.
     ///

Modified: hugo/trunk/src/hugo/dijkstra.h
==============================================================================
--- hugo/trunk/src/hugo/dijkstra.h	(original)
+++ hugo/trunk/src/hugo/dijkstra.h	Sun Sep  5 22:11:47 2004
@@ -55,9 +55,13 @@
   public:
     ///The type of the underlying graph.
     typedef GR Graph;
+    ///.
     typedef typename Graph::Node Node;
+    ///.
     typedef typename Graph::NodeIt NodeIt;
+    ///.
     typedef typename Graph::Edge Edge;
+    ///.
     typedef typename Graph::OutEdgeIt OutEdgeIt;
     
     ///The type of the length of the edges.
@@ -74,17 +78,24 @@
     typedef typename Graph::template NodeMap<ValueType> DistMap;
 
   private:
+    /// Pointer to the underlying graph.
     const Graph *G;
+    /// Pointer to the length map
     const LM *length;
-    //    bool local_length;
+    ///Pointer to the map of predecessors edges.
     PredMap *predecessor;
+    ///Indicates if \ref predecessor is locally allocated (\c true) or not.
     bool local_predecessor;
+    ///Pointer to the map of predecessors nodes.
     PredNodeMap *pred_node;
+    ///Indicates if \ref pred_node is locally allocated (\c true) or not.
     bool local_pred_node;
+    ///Pointer to the map of distances.
     DistMap *distance;
+    ///Indicates if \ref distance is locally allocated (\c true) or not.
     bool local_distance;
 
-    //The source node of the last execution.
+    ///The source node of the last execution.
     Node source;
 
     ///Initializes the maps.
@@ -93,10 +104,6 @@
     ///\todo Better memory allocation (instead of new).
     void init_maps() 
     {
-//       if(!length) {
-// 	local_length = true;
-// 	length = new LM(G);
-//       }
       if(!predecessor) {
 	local_predecessor = true;
 	predecessor = new PredMap(*G);
@@ -112,7 +119,10 @@
     }
     
   public :
+    ///Constructor.
     
+    ///\param _G the graph the algorithm will run on.
+    ///\param _length the length map used by the algorithm.
     Dijkstra(const Graph& _G, const LM& _length) :
       G(&_G), length(&_length),
       predecessor(NULL), local_predecessor(false),
@@ -120,35 +130,20 @@
       distance(NULL), local_distance(false)
     { }
     
+    ///Destructor.
     ~Dijkstra() 
     {
-      //      if(local_length) delete length;
       if(local_predecessor) delete predecessor;
       if(local_pred_node) delete pred_node;
       if(local_distance) delete distance;
     }
 
-    ///Sets the graph the algorithm will run on.
-
-    ///Sets the graph the algorithm will run on.
-    ///\return <tt> (*this) </tt>
-    ///\bug What about maps?
-    ///\todo It may be unnecessary
-    Dijkstra &setGraph(const Graph &_G) 
-    {
-      G = &_G;
-      return *this;
-    }
     ///Sets the length map.
 
     ///Sets the length map.
     ///\return <tt> (*this) </tt>
     Dijkstra &setLengthMap(const LM &m) 
     {
-//       if(local_length) {
-// 	delete length;
-// 	local_length=false;
-//       }
       length = &m;
       return *this;
     }
@@ -317,7 +312,7 @@
     ///Checks if a node is reachable from the root.
 
     ///Returns \c true if \c v is reachable from the root.
-    ///\warning the root node is reported to be reached!
+    ///\note The root node is reported to be reached!
     ///\pre \ref run() must be called before using this function.
     ///
     bool reached(Node v) { return v==source || (*predecessor)[v]!=INVALID; }



More information about the Lemon-commits mailing list