1.1 --- a/src/work/alpar/emptygraph.h Wed Mar 24 09:36:21 2004 +0000
1.2 +++ b/src/work/alpar/emptygraph.h Wed Mar 24 13:06:06 2004 +0000
1.3 @@ -2,6 +2,9 @@
1.4 #ifndef HUGO_EMPTYGRAPH_H
1.5 #define HUGO_EMPTYGRAPH_H
1.6
1.7 +///\file
1.8 +///\brief Declaration of GraphSkeleton.
1.9 +
1.10 #include <invalid.h>
1.11
1.12 /// The namespace of HugoLib
1.13 @@ -12,9 +15,6 @@
1.14
1.15 /// An empty graph class.
1.16
1.17 - /// When you read this for the first time,
1.18 - /// please send an e-mail to alpar\@cs.elte.hu.
1.19 - ///
1.20 /// This class provides all the common features of a graph structure,
1.21 /// however completely without implementations and real data structures
1.22 /// behind the interface.
1.23 @@ -102,9 +102,9 @@
1.24 bool operator<(Edge n) const { return true; }
1.25 };
1.26
1.27 - /// This iterator goes trought the outgoing edges of a node.
1.28 + /// This iterator goes trough the outgoing edges of a node.
1.29
1.30 - /// This iterator goes trought the \e outgoing edges of a certain node
1.31 + /// This iterator goes trough the \e outgoing edges of a certain node
1.32 /// of a graph.
1.33 /// Its usage is quite simple, for example you can count the number
1.34 /// of outgoing edges of a node \c n
1.35 @@ -130,9 +130,9 @@
1.36 OutEdgeIt(const GraphSkeleton & G, Node n) {}
1.37 };
1.38
1.39 - /// This iterator goes trought the incoming edges of a node.
1.40 + /// This iterator goes trough the incoming edges of a node.
1.41
1.42 - /// This iterator goes trought the \e incoming edges of a certain node
1.43 + /// This iterator goes trough the \e incoming edges of a certain node
1.44 /// of a graph.
1.45 /// Its usage is quite simple, for example you can count the number
1.46 /// of outgoing edges of a node \c n
1.47 @@ -178,9 +178,9 @@
1.48 ///
1.49 NodeIt &first(NodeIt &i) const { return i;}
1.50
1.51 + /// The first incoming edge.
1.52 + InEdgeIt &first(InEdgeIt &i, Node n) const { return i;}
1.53 /// The first outgoing edge.
1.54 - InEdgeIt &first(InEdgeIt &i, Node n) const { return i;}
1.55 - /// The first incoming edge.
1.56 OutEdgeIt &first(OutEdgeIt &i, Node n) const { return i;}
1.57 // SymEdgeIt &first(SymEdgeIt &, Node) const { return i;}
1.58 /// The first edge of the Graph.
1.59 @@ -228,12 +228,12 @@
1.60
1.61 ///Gives back the \e id of a node.
1.62
1.63 - ///\warning Not all graph structure provide this feature.
1.64 + ///\warning Not all graph structures provide this feature.
1.65 ///
1.66 int id(const Node) const { return 0;}
1.67 ///Gives back the \e id of an edge.
1.68
1.69 - ///\warning Not all graph structure provide this feature.
1.70 + ///\warning Not all graph structures provide this feature.
1.71 ///
1.72 int id(const Edge) const { return 0;}
1.73
1.74 @@ -252,18 +252,7 @@
1.75 ///\return the new edge.
1.76 Edge addEdge(Node tail, Node head) { return INVALID;}
1.77
1.78 - /// Deletes a node.
1.79 -
1.80 - ///\warning Not all graph structure provide this feature.
1.81 - ///
1.82 - void erase(Node n) {}
1.83 - /// Deletes an edge.
1.84 -
1.85 - ///\warning Not all graph structure provide this feature.
1.86 - ///
1.87 - void erase(Edge e) {}
1.88 -
1.89 - /// Reset the graph.
1.90 + /// Resets the graph.
1.91
1.92 /// This function deletes all edges and nodes of the graph.
1.93 /// It also frees the memory allocated to store them.
1.94 @@ -271,11 +260,13 @@
1.95
1.96 int nodeNum() const { return 0;}
1.97 int edgeNum() const { return 0;}
1.98 -
1.99 +
1.100 + /// Defalult constructor.
1.101 GraphSkeleton() {}
1.102 + ///Copy consructor.
1.103 GraphSkeleton(const GraphSkeleton &G) {}
1.104
1.105 -
1.106 +
1.107
1.108 ///Read/write/reference map of the nodes to type \c T.
1.109
1.110 @@ -343,6 +334,40 @@
1.111 };
1.112 };
1.113
1.114 + /// An empty eraseable graph class.
1.115 +
1.116 + /// This class provides all the common features of an \e eraseable graph
1.117 + /// structure,
1.118 + /// however completely without implementations and real data structures
1.119 + /// behind the interface.
1.120 + /// All graph algorithms should compile with this class, but it will not
1.121 + /// run properly, of course.
1.122 + ///
1.123 + /// \todo This blabla could be replaced by a sepatate description about
1.124 + /// Skeletons.
1.125 + ///
1.126 + /// It can be used for checking the interface compatibility,
1.127 + /// or it can serve as a skeleton of a new graph structure.
1.128 + ///
1.129 + /// Also, you will find here the full documentation of a certain graph
1.130 + /// feature, the documentation of a real graph imlementation
1.131 + /// like @ref ListGraph or
1.132 + /// @ref SmartGraph will just refer to this structure.
1.133 + class EraseableGraphSkeleton : public GraphSkeleton
1.134 + {
1.135 + public:
1.136 + /// Deletes a node.
1.137 + void erase(Node n) {}
1.138 + /// Deletes an edge.
1.139 + void erase(Edge e) {}
1.140 +
1.141 + /// Defalult constructor.
1.142 + GraphSkeleton() {}
1.143 + ///Copy consructor.
1.144 + GraphSkeleton(const GraphSkeleton &G) {}
1.145 + };
1.146 +
1.147 +
1.148 // @}
1.149
1.150 } //namespace hugo