[Lemon-commits] [lemon_svn] deba: r2878 - hugo/trunk/lemon/concept

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 21:50:58 CET 2006


Author: deba
Date: Mon Jul 24 18:08:34 2006
New Revision: 2878

Modified:
   hugo/trunk/lemon/concept/bpugraph.h
   hugo/trunk/lemon/concept/ugraph.h

Log:
Improving UGraph and BpUGraph concept classes



Modified: hugo/trunk/lemon/concept/bpugraph.h
==============================================================================
--- hugo/trunk/lemon/concept/bpugraph.h	(original)
+++ hugo/trunk/lemon/concept/bpugraph.h	Mon Jul 24 18:08:34 2006
@@ -55,11 +55,12 @@
     /// as an undirected graph and consequently as a static graph.
     ///
     /// The bipartite graph stores two types of nodes which are named
-    /// ANode and BNode. The graph type contains two types ANode and BNode
-    /// which are inherited from Node type. Moreover they have
-    /// constructor which converts Node to either ANode or BNode when it is
-    /// possible. Therefor everywhere the Node type can be used instead of
-    /// ANode and BNode. So the usage of the ANode and BNode is suggested.  
+    /// ANode and BNode. The graph type contains two types ANode and
+    /// BNode which are inherited from Node type. Moreover they have
+    /// constructor which converts Node to either ANode or BNode when
+    /// it is possible. Therefor everywhere the Node type can be used
+    /// instead of ANode and BNode. So the usage of the ANode and
+    /// BNode is not suggested.
     ///
     /// The iteration on the partition can be done with the ANodeIt and 
     /// BNodeIt classes. The node map can be used to map values to the nodes
@@ -68,8 +69,12 @@
 
     class BpUGraph {
     public:
-      /// \todo undocumented
+      /// \brief The undirected graph should be tagged by the
+      /// UndirectedTag.
       ///
+      /// The undirected graph should be tagged by the UndirectedTag. This
+      /// tag helps the enable_if technics to make compile time 
+      /// specializations for undirected graphs.  
       typedef True UndirectedTag;
 
       /// \brief The base type of node iterators, 
@@ -122,15 +127,12 @@
 
       };
 
-      /// \brief The base type of anode iterators, 
-      /// or in other words, the trivial anode iterator.
+      /// \brief Helper class for ANodes.
       ///
-      /// This is the base type of each anode iterator,
-      /// thus each kind of anode iterator converts to this.
-      /// More precisely each kind of node iterator should be inherited 
-      /// from the trivial anode iterator. The ANode class should be used
-      /// only in special cases. Usually the Node type should be used insted
-      /// of it. 
+      /// This class is just a helper class for ANodes, it is not
+      /// suggested to use it directly. It can be converted easily to
+      /// node and vice versa. The usage of this class is limited
+      /// two use just as template parameters for special map types. 
       class ANode {
       public:
         /// Default constructor
@@ -179,15 +181,12 @@
 
       };
 
-      /// \brief The base type of bnode iterators, 
-      /// or in other words, the trivial bnode iterator.
+      /// \brief Helper class for BNodes.
       ///
-      /// This is the base type of each anode iterator,
-      /// thus each kind of anode iterator converts to this.
-      /// More precisely each kind of node iterator should be inherited 
-      /// from the trivial anode iterator. The BNode class should be used
-      /// only in special cases. Usually the Node type should be used insted
-      /// of it. 
+      /// This class is just a helper class for BNodes, it is not
+      /// suggested to use it directly. It can be converted easily to
+      /// node and vice versa. The usage of this class is limited
+      /// two use just as template parameters for special map types. 
       class BNode {
       public:
         /// Default constructor
@@ -290,7 +289,7 @@
       /// int count=0;
       /// for (Graph::ANodeIt n(g); n!=INVALID; ++n) ++count;
       ///\endcode
-      class ANodeIt : public ANode {
+      class ANodeIt : public Node {
       public:
         /// Default constructor
 
@@ -335,7 +334,7 @@
       /// int count=0;
       /// for (Graph::BNodeIt n(g); n!=INVALID; ++n) ++count;
       ///\endcode
-      class BNodeIt : public BNode {
+      class BNodeIt : public Node {
       public:
         /// Default constructor
 
@@ -818,16 +817,17 @@
       /// \brief Direct the given undirected edge.
       ///
       /// Direct the given undirected edge. The returned edge source
-      /// will be the given edge.
+      /// will be the given node.
       Edge direct(const UEdge&, const Node&) const {
 	return INVALID;
       }
 
       /// \brief Direct the given undirected edge.
       ///
-      /// Direct the given undirected edge. The returned edge source
-      /// will be the source of the undirected edge if the given bool
-      /// is true.
+      /// Direct the given undirected edge. The returned edge
+      /// represents the given undireted edge and the direction comes
+      /// from the given bool.  The source of the undirected edge and
+      /// the directed edge is the same when the given bool is true.
       Edge direct(const UEdge&, bool) const {
 	return INVALID;
       }
@@ -855,7 +855,7 @@
       /// \brief Returns true if the edge has default orientation.
       ///
       /// Returns whether the given directed edge is same orientation as
-      /// the corresponding undirected edge.
+      /// the corresponding undirected edge's default orientation.
       bool direction(Edge) const { return true; }
 
       /// \brief Returns the opposite directed edge.
@@ -865,14 +865,14 @@
 
       /// \brief Opposite node on an edge
       ///
-      /// \return the opposite of the given Node on the given Edge
+      /// \return the opposite of the given Node on the given UEdge
       Node oppositeNode(Node, UEdge) const { return INVALID; }
 
       /// \brief First node of the undirected edge.
       ///
       /// \return the first node of the given UEdge.
       ///
-      /// Naturally uectected edges don't have direction and thus
+      /// Naturally undirected edges don't have direction and thus
       /// don't have source and target node. But we use these two methods
       /// to query the two endnodes of the edge. The direction of the edge
       /// which arises this way is called the inherent direction of the

Modified: hugo/trunk/lemon/concept/ugraph.h
==============================================================================
--- hugo/trunk/lemon/concept/ugraph.h	(original)
+++ hugo/trunk/lemon/concept/ugraph.h	Mon Jul 24 18:08:34 2006
@@ -35,31 +35,48 @@
     /// @{
 
 
-    /// Class describing the concept of Undirected Graphs.
-
+    /// \brief Class describing the concept of Undirected Graphs.
+    ///
     /// This class describes the common interface of all Undirected
     /// Graphs.
     ///
     /// As all concept describing classes it provides only interface
     /// without any sensible implementation. So any algorithm for
     /// undirected graph should compile with this class, but it will not
-    /// run properly, of couse.
+    /// run properly, of course.
     ///
-    /// In LEMON undirected graphs also fulfill the concept of directed
-    /// graphs (\ref lemon::concept::Graph "Graph Concept"). For
-    /// explanation of this and more see also the page \ref graphs,
-    /// a tutorial about graphs.
+    /// The LEMON undirected graphs also fulfill the concept of
+    /// directed graphs (\ref lemon::concept::Graph "Graph
+    /// Concept"). Each undirected edges can be seen as two opposite
+    /// directed edge and consequently the undirected graph can be
+    /// seen as the direceted graph of these directed edges. The
+    /// UGraph has the UEdge inner class for the undirected edges and
+    /// the Edge type for the directed edges. The Edge type is
+    /// convertible to UEdge or inherited from it so from a directed
+    /// edge we can get the represented undirected edge.
     ///
-    /// You can assume that all undirected graph can be handled
-    /// as a directed graph. This way it is fully conform
-    /// to the Graph concept.
-
+    /// In the sense of the LEMON each undirected edge has a default
+    /// direction (it should be in every computer implementation,
+    /// because the order of undirected edge's nodes defines an
+    /// orientation). With the default orientation we can define that
+    /// the directed edge is forward or backward directed. With the \c
+    /// direction() and \c direct() function we can get the direction
+    /// of the directed edge and we can direct an undirected edge.
+    ///
+    /// The UEdgeIt is an iterator for the undirected edges. We can use
+    /// the UEdgeMap to map values for the undirected edges. The InEdgeIt and
+    /// OutEdgeIt iterates on the same undirected edges but with opposite
+    /// direction. The IncEdgeIt iterates also on the same undirected edges
+    /// as the OutEdgeIt and InEdgeIt but it is not convertible to Edge just
+    /// to UEdge.  
     class UGraph {
     public:
-      ///\e
-
-      ///\todo undocumented
+      /// \brief The undirected graph should be tagged by the
+      /// UndirectedTag.
       ///
+      /// The undirected graph should be tagged by the UndirectedTag. This
+      /// tag helps the enable_if technics to make compile time 
+      /// specializations for undirected graphs.  
       typedef True UndirectedTag;
 
       /// \brief The base type of node iterators, 
@@ -296,7 +313,8 @@
       /// The directed edge type.
 
       /// The directed edge type. It can be converted to the
-      /// undirected edge.
+      /// undirected edge or it should be inherited from the undirected
+      /// edge.
       class Edge : public UEdge {
       public:
         /// Default constructor
@@ -562,16 +580,17 @@
       /// \brief Direct the given undirected edge.
       ///
       /// Direct the given undirected edge. The returned edge source
-      /// will be the given edge.
+      /// will be the given node.
       Edge direct(const UEdge&, const Node&) const {
 	return INVALID;
       }
 
       /// \brief Direct the given undirected edge.
       ///
-      /// Direct the given undirected edge. The returned edge source
-      /// will be the source of the undirected edge if the given bool
-      /// is true.
+      /// Direct the given undirected edge. The returned edge
+      /// represents the given undireted edge and the direction comes
+      /// from the given bool.  The source of the undirected edge and
+      /// the directed edge is the same when the given bool is true.
       Edge direct(const UEdge&, bool) const {
 	return INVALID;
       }
@@ -579,7 +598,7 @@
       /// \brief Returns true if the edge has default orientation.
       ///
       /// Returns whether the given directed edge is same orientation as
-      /// the corresponding undirected edge.
+      /// the corresponding undirected edge's default orientation.
       bool direction(Edge) const { return true; }
 
       /// \brief Returns the opposite directed edge.
@@ -589,16 +608,16 @@
 
       /// \brief Opposite node on an edge
       ///
-      /// \return the opposite of the given Node on the given Edge
+      /// \return the opposite of the given Node on the given UEdge
       Node oppositeNode(Node, UEdge) const { return INVALID; }
 
       /// \brief First node of the undirected edge.
       ///
       /// \return the first node of the given UEdge.
       ///
-      /// Naturally uectected edges don't have direction and thus
+      /// Naturally undirected edges don't have direction and thus
       /// don't have source and target node. But we use these two methods
-      /// to query the two endnodes of the edge. The direction of the edge
+      /// to query the two nodes of the edge. The direction of the edge
       /// which arises this way is called the inherent direction of the
       /// undirected edge, and is used to define the "default" direction
       /// of the directed versions of the edges.



More information about the Lemon-commits mailing list