1.1 --- a/src/work/deba/test_graph.h Wed May 12 14:07:00 2004 +0000
1.2 +++ b/src/work/deba/test_graph.h Thu May 13 08:20:39 2004 +0000
1.3 @@ -30,28 +30,26 @@
1.4 class InEdgeIt;
1.5 class SymEdgeIt;
1.6
1.7 -// template <typename T> class NodeMap;
1.8 -// template <typename T> class EdgeMap;
1.9 + // template <typename T> class NodeMap;
1.10 + // template <typename T> class EdgeMap;
1.11 private:
1.12 -// template <typename T> friend class NodeMap;
1.13 - // template <typename T> friend class EdgeMap;
1.14 + // template <typename T> friend class NodeMap;
1.15 + // template <typename T> friend class EdgeMap;
1.16
1.17 private:
1.18
1.19
1.20 - public:
1.21 + public:
1.22
1.23 - typedef MapBase<ListGraph, Node, NodeIt> NodeMapBase;
1.24 - typedef MapRegistry<ListGraph, Node, NodeIt> NodeMapRegistry;
1.25 - typedef VectorMapFactory<ListGraph, Node, NodeIt> NodeMapFactory;
1.26 - NodeMapRegistry node_maps;
1.27 + typedef MapRegistry<ListGraph, Node, NodeIt> NodeMapRegistry;
1.28 + typedef VectorMapFactory<NodeMapRegistry> NodeMapFactory;
1.29 + NodeMapRegistry node_maps;
1.30
1.31
1.32
1.33 - typedef MapBase<ListGraph, Edge, EdgeIt> EdgeMapBase;
1.34 - typedef MapRegistry<ListGraph, Edge, EdgeIt> EdgeMapRegistry;
1.35 - typedef VectorMapFactory<ListGraph, Edge, EdgeIt> EdgeMapFactory;
1.36 - EdgeMapRegistry edge_maps;
1.37 + typedef MapRegistry<ListGraph, Edge, EdgeIt> EdgeMapRegistry;
1.38 + typedef VectorMapFactory<EdgeMapRegistry> EdgeMapFactory;
1.39 + EdgeMapRegistry edge_maps;
1.40
1.41
1.42 int node_id;
1.43 @@ -302,27 +300,27 @@
1.44 /* adding nodes and edges */
1.45
1.46 Node addNode() {
1.47 - Node n = _add_node();
1.48 - node_maps.add(n);
1.49 - return n;
1.50 - }
1.51 + Node n = _add_node();
1.52 + node_maps.add(n);
1.53 + return n;
1.54 + }
1.55 Edge addEdge(Node u, Node v) {
1.56 - Edge e = _add_edge(u.node, v.node);
1.57 - edge_maps.add(e);
1.58 + Edge e = _add_edge(u.node, v.node);
1.59 + edge_maps.add(e);
1.60 return e;
1.61 }
1.62
1.63 void erase(Node i) {
1.64 - node_maps.erase(i);
1.65 + node_maps.erase(i);
1.66 while (first<OutEdgeIt>(i).valid()) erase(first<OutEdgeIt>(i));
1.67 while (first<InEdgeIt>(i).valid()) erase(first<InEdgeIt>(i));
1.68 _delete_node(i.node);
1.69 }
1.70
1.71 void erase(Edge e) {
1.72 - edge_maps.erase(e);
1.73 - _delete_edge(e.edge);
1.74 - }
1.75 + edge_maps.erase(e);
1.76 + _delete_edge(e.edge);
1.77 + }
1.78
1.79 void clear() {
1.80 while (first<NodeIt>().valid()) erase(first<NodeIt>());
1.81 @@ -510,42 +508,42 @@
1.82
1.83 };
1.84
1.85 -// template< typename T >
1.86 -// T ListGraph::first() const {
1.87 -// std::cerr << "Invalid use of template<typemane T> T ListGraph::first<T>();" << std::endl;
1.88 -// return T();
1.89 -// }
1.90 + // template< typename T >
1.91 + // T ListGraph::first() const {
1.92 + // std::cerr << "Invalid use of template<typemane T> T ListGraph::first<T>();" << std::endl;
1.93 + // return T();
1.94 + // }
1.95
1.96 -// template<>
1.97 -// ListGraph::NodeIt ListGraph::first<ListGraph::NodeIt>() const {
1.98 -// return firstNode();
1.99 -// }
1.100 + // template<>
1.101 + // ListGraph::NodeIt ListGraph::first<ListGraph::NodeIt>() const {
1.102 + // return firstNode();
1.103 + // }
1.104
1.105 -// template<>
1.106 -// ListGraph::EdgeIt ListGraph::first<ListGraph::EdgeIt>() const {
1.107 -// return firstEdge();
1.108 -// }
1.109 + // template<>
1.110 + // ListGraph::EdgeIt ListGraph::first<ListGraph::EdgeIt>() const {
1.111 + // return firstEdge();
1.112 + // }
1.113
1.114 -// template< typename T >
1.115 -// T ListGraph::first(ListGraph::Node v) const {
1.116 -// std::cerr << "Invalid use of template<typemane T> T ListGraph::first<T>(ListGRaph::Node);" << std::endl;
1.117 -// return T();
1.118 -// }
1.119 + // template< typename T >
1.120 + // T ListGraph::first(ListGraph::Node v) const {
1.121 + // std::cerr << "Invalid use of template<typemane T> T ListGraph::first<T>(ListGRaph::Node);" << std::endl;
1.122 + // return T();
1.123 + // }
1.124
1.125 -// template<>
1.126 -// ListGraph::OutEdgeIt ListGraph::first<ListGraph::OutEdgeIt>(const ListGraph::Node v) const {
1.127 -// return firstOutEdge(v);
1.128 -// }
1.129 + // template<>
1.130 + // ListGraph::OutEdgeIt ListGraph::first<ListGraph::OutEdgeIt>(const ListGraph::Node v) const {
1.131 + // return firstOutEdge(v);
1.132 + // }
1.133
1.134 -// template<>
1.135 -// ListGraph::InEdgeIt ListGraph::first<ListGraph::InEdgeIt>(const ListGraph::Node v) const {
1.136 -// return firstInEdge(v);
1.137 -// }
1.138 + // template<>
1.139 + // ListGraph::InEdgeIt ListGraph::first<ListGraph::InEdgeIt>(const ListGraph::Node v) const {
1.140 + // return firstInEdge(v);
1.141 + // }
1.142
1.143 -// template<>
1.144 -// ListGraph::SymEdgeIt ListGraph::first<ListGraph::SymEdgeIt>(const ListGraph::Node v) const {
1.145 -// return firstSymEdge(v);
1.146 -// }
1.147 + // template<>
1.148 + // ListGraph::SymEdgeIt ListGraph::first<ListGraph::SymEdgeIt>(const ListGraph::Node v) const {
1.149 + // return firstSymEdge(v);
1.150 + // }
1.151
1.152
1.153 } //namespace hugo