Many of ckeckCompileXYZ()'s are now in the corresponding skeleton headers.
(Tests for Symmetric Graphs are still to be moved)
1.1 --- a/src/lemon/skeletons/graph.h Mon Oct 04 17:13:21 2004 +0000
1.2 +++ b/src/lemon/skeletons/graph.h Tue Oct 05 09:41:05 2004 +0000
1.3 @@ -45,6 +45,9 @@
1.4 /// feature, the documentation of a real graph imlementation
1.5 /// like @ref ListGraph or
1.6 /// @ref SmartGraph will just refer to this structure.
1.7 + ///
1.8 + /// \todo A pages describing the concept of concept description would
1.9 + /// be nice.
1.10 class StaticGraph
1.11 {
1.12 public:
1.13 @@ -442,10 +445,206 @@
1.14 };
1.15 };
1.16
1.17 + struct DummyType {
1.18 + int value;
1.19 + DummyType() {}
1.20 + DummyType(int p) : value(p) {}
1.21 + DummyType& operator=(int p) { value = p; return *this;}
1.22 + };
1.23 +
1.24 + ///\brief Checks whether \c G meets the
1.25 + ///\ref lemon::skeleton::StaticGraph "StaticGraph" concept
1.26 + template<class Graph> void checkCompileStaticGraph(Graph &G)
1.27 + {
1.28 + typedef typename Graph::Node Node;
1.29 + typedef typename Graph::NodeIt NodeIt;
1.30 + typedef typename Graph::Edge Edge;
1.31 + typedef typename Graph::EdgeIt EdgeIt;
1.32 + typedef typename Graph::InEdgeIt InEdgeIt;
1.33 + typedef typename Graph::OutEdgeIt OutEdgeIt;
1.34 +
1.35 + {
1.36 + Node i; Node j(i); Node k(INVALID);
1.37 + i=j;
1.38 + bool b; b=true;
1.39 + b=(i==INVALID); b=(i!=INVALID);
1.40 + b=(i==j); b=(i!=j); b=(i<j);
1.41 + }
1.42 + {
1.43 + NodeIt i; NodeIt j(i); NodeIt k(INVALID); NodeIt l(G);
1.44 + i=j;
1.45 + j=G.first(i);
1.46 + j=++i;
1.47 + bool b; b=true;
1.48 + b=(i==INVALID); b=(i!=INVALID);
1.49 + Node n(i);
1.50 + n=i;
1.51 + b=(i==j); b=(i!=j); b=(i<j);
1.52 + //Node ->NodeIt conversion
1.53 + NodeIt ni(G,n);
1.54 + }
1.55 + {
1.56 + Edge i; Edge j(i); Edge k(INVALID);
1.57 + i=j;
1.58 + bool b; b=true;
1.59 + b=(i==INVALID); b=(i!=INVALID);
1.60 + b=(i==j); b=(i!=j); b=(i<j);
1.61 + }
1.62 + {
1.63 + EdgeIt i; EdgeIt j(i); EdgeIt k(INVALID); EdgeIt l(G);
1.64 + i=j;
1.65 + j=G.first(i);
1.66 + j=++i;
1.67 + bool b; b=true;
1.68 + b=(i==INVALID); b=(i!=INVALID);
1.69 + Edge e(i);
1.70 + e=i;
1.71 + b=(i==j); b=(i!=j); b=(i<j);
1.72 + //Edge ->EdgeIt conversion
1.73 + EdgeIt ei(G,e);
1.74 + }
1.75 + {
1.76 + Node n;
1.77 + InEdgeIt i; InEdgeIt j(i); InEdgeIt k(INVALID); InEdgeIt l(G,n);
1.78 + i=j;
1.79 + j=G.first(i,n);
1.80 + j=++i;
1.81 + bool b; b=true;
1.82 + b=(i==INVALID); b=(i!=INVALID);
1.83 + Edge e(i);
1.84 + e=i;
1.85 + b=(i==j); b=(i!=j); b=(i<j);
1.86 + //Edge ->InEdgeIt conversion
1.87 + InEdgeIt ei(G,e);
1.88 + }
1.89 + {
1.90 + Node n;
1.91 + OutEdgeIt i; OutEdgeIt j(i); OutEdgeIt k(INVALID); OutEdgeIt l(G,n);
1.92 + i=j;
1.93 + j=G.first(i,n);
1.94 + j=++i;
1.95 + bool b; b=true;
1.96 + b=(i==INVALID); b=(i!=INVALID);
1.97 + Edge e(i);
1.98 + e=i;
1.99 + b=(i==j); b=(i!=j); b=(i<j);
1.100 + //Edge ->OutEdgeIt conversion
1.101 + OutEdgeIt ei(G,e);
1.102 + }
1.103 + {
1.104 + Node n,m;
1.105 + n=m=INVALID;
1.106 + Edge e;
1.107 + e=INVALID;
1.108 + n=G.tail(e);
1.109 + n=G.head(e);
1.110 + }
1.111 + // id tests
1.112 + { Node n; int i=G.id(n); i=i; }
1.113 + { Edge e; int i=G.id(e); i=i; }
1.114 + //NodeMap tests
1.115 + {
1.116 + Node k;
1.117 + typename Graph::template NodeMap<int> m(G);
1.118 + //Const map
1.119 + typename Graph::template NodeMap<int> const &cm = m;
1.120 + //Inicialize with default value
1.121 + typename Graph::template NodeMap<int> mdef(G,12);
1.122 + //Copy
1.123 + typename Graph::template NodeMap<int> mm(cm);
1.124 + //Copy from another type
1.125 + typename Graph::template NodeMap<double> dm(cm);
1.126 + //Copy to more complex type
1.127 + typename Graph::template NodeMap<DummyType> em(cm);
1.128 + int v;
1.129 + v=m[k]; m[k]=v; m.set(k,v);
1.130 + v=cm[k];
1.131 +
1.132 + m=cm;
1.133 + dm=cm; //Copy from another type
1.134 + em=cm; //Copy to more complex type
1.135 + {
1.136 + //Check the typedef's
1.137 + typename Graph::template NodeMap<int>::ValueType val;
1.138 + val=1;
1.139 + typename Graph::template NodeMap<int>::KeyType key;
1.140 + key = typename Graph::NodeIt(G);
1.141 + }
1.142 + }
1.143 + { //bool NodeMap
1.144 + Node k;
1.145 + typename Graph::template NodeMap<bool> m(G);
1.146 + typename Graph::template NodeMap<bool> const &cm = m; //Const map
1.147 + //Inicialize with default value
1.148 + typename Graph::template NodeMap<bool> mdef(G,12);
1.149 + typename Graph::template NodeMap<bool> mm(cm); //Copy
1.150 + typename Graph::template NodeMap<int> dm(cm); //Copy from another type
1.151 + bool v;
1.152 + v=m[k]; m[k]=v; m.set(k,v);
1.153 + v=cm[k];
1.154 +
1.155 + m=cm;
1.156 + dm=cm; //Copy from another type
1.157 + m=dm; //Copy to another type
1.158
1.159 -
1.160 + {
1.161 + //Check the typedef's
1.162 + typename Graph::template NodeMap<bool>::ValueType val;
1.163 + val=true;
1.164 + typename Graph::template NodeMap<bool>::KeyType key;
1.165 + key= typename Graph::NodeIt(G);
1.166 + }
1.167 + }
1.168 + //EdgeMap tests
1.169 + {
1.170 + Edge k;
1.171 + typename Graph::template EdgeMap<int> m(G);
1.172 + typename Graph::template EdgeMap<int> const &cm = m; //Const map
1.173 + //Inicialize with default value
1.174 + typename Graph::template EdgeMap<int> mdef(G,12);
1.175 + typename Graph::template EdgeMap<int> mm(cm); //Copy
1.176 + typename Graph::template EdgeMap<double> dm(cm);//Copy from another type
1.177 + int v;
1.178 + v=m[k]; m[k]=v; m.set(k,v);
1.179 + v=cm[k];
1.180 +
1.181 + m=cm;
1.182 + dm=cm; //Copy from another type
1.183 + {
1.184 + //Check the typedef's
1.185 + typename Graph::template EdgeMap<int>::ValueType val;
1.186 + val=1;
1.187 + typename Graph::template EdgeMap<int>::KeyType key;
1.188 + key= typename Graph::EdgeIt(G);
1.189 + }
1.190 + }
1.191 + { //bool EdgeMap
1.192 + Edge k;
1.193 + typename Graph::template EdgeMap<bool> m(G);
1.194 + typename Graph::template EdgeMap<bool> const &cm = m; //Const map
1.195 + //Inicialize with default value
1.196 + typename Graph::template EdgeMap<bool> mdef(G,12);
1.197 + typename Graph::template EdgeMap<bool> mm(cm); //Copy
1.198 + typename Graph::template EdgeMap<int> dm(cm); //Copy from another type
1.199 + bool v;
1.200 + v=m[k]; m[k]=v; m.set(k,v);
1.201 + v=cm[k];
1.202 +
1.203 + m=cm;
1.204 + dm=cm; //Copy from another type
1.205 + m=dm; //Copy to another type
1.206 + {
1.207 + //Check the typedef's
1.208 + typename Graph::template EdgeMap<bool>::ValueType val;
1.209 + val=true;
1.210 + typename Graph::template EdgeMap<bool>::KeyType key;
1.211 + key= typename Graph::EdgeIt(G);
1.212 + }
1.213 + }
1.214 + }
1.215 +
1.216 /// An empty non-static graph class.
1.217 -
1.218 +
1.219 /// This class provides everything that \ref StaticGraph
1.220 /// with additional functionality which enables to build a
1.221 /// graph from scratch.
1.222 @@ -477,6 +676,30 @@
1.223 void clear() { }
1.224 };
1.225
1.226 +
1.227 + ///\brief Checks whether \c G meets the
1.228 + ///\ref lemon::skeleton::ExtendableGraph "ExtendableGraph" concept
1.229 + template<class Graph> void checkCompileExtendableGraph(Graph &G)
1.230 + {
1.231 + checkCompileStaticGraph(G);
1.232 +
1.233 + typedef typename Graph::Node Node;
1.234 + typedef typename Graph::NodeIt NodeIt;
1.235 + typedef typename Graph::Edge Edge;
1.236 + typedef typename Graph::EdgeIt EdgeIt;
1.237 + typedef typename Graph::InEdgeIt InEdgeIt;
1.238 + typedef typename Graph::OutEdgeIt OutEdgeIt;
1.239 +
1.240 + Node n,m;
1.241 + n=G.addNode();
1.242 + m=G.addNode();
1.243 + Edge e;
1.244 + e=G.addEdge(n,m);
1.245 +
1.246 + // G.clear();
1.247 + }
1.248 +
1.249 +
1.250 /// An empty erasable graph class.
1.251
1.252 /// This class is an extension of \ref ExtendableGraph. It also makes it
1.253 @@ -500,7 +723,41 @@
1.254 ///
1.255 void erase(Edge e) { }
1.256 };
1.257 +
1.258 + template<class Graph> void checkCompileGraphEraseEdge(Graph &G)
1.259 + {
1.260 + typename Graph::Edge e;
1.261 + G.erase(e);
1.262 + }
1.263
1.264 + template<class Graph> void checkCompileGraphEraseNode(Graph &G)
1.265 + {
1.266 + typename Graph::Node n;
1.267 + G.erase(n);
1.268 + }
1.269 +
1.270 + ///\brief Checks whether \c G meets the
1.271 + ///\ref lemon::skeleton::EresableGraph "EresableGraph" concept
1.272 + template<class Graph> void checkCompileErasableGraph(Graph &G)
1.273 + {
1.274 + checkCompileExtendableGraph(G);
1.275 + checkCompileGraphEraseNode(G);
1.276 + checkCompileGraphEraseEdge(G);
1.277 + }
1.278 +
1.279 + ///Checks whether a graph has findEdge() member function.
1.280 +
1.281 + ///\todo findEdge() might be a global function.
1.282 + ///
1.283 + template<class Graph> void checkCompileGraphFindEdge(Graph &G)
1.284 + {
1.285 + typedef typename Graph::NodeIt Node;
1.286 + typedef typename Graph::NodeIt NodeIt;
1.287 +
1.288 + G.findEdge(NodeIt(G),++NodeIt(G),G.findEdge(NodeIt(G),++NodeIt(G)));
1.289 + G.findEdge(Node(),Node(),G.findEdge(Node(),Node()));
1.290 + }
1.291 +
1.292 // @}
1.293 } //namespace skeleton
1.294 } //namespace lemon
2.1 --- a/src/test/Makefile.am Mon Oct 04 17:13:21 2004 +0000
2.2 +++ b/src/test/Makefile.am Tue Oct 05 09:41:05 2004 +0000
2.3 @@ -2,7 +2,7 @@
2.4
2.5 EXTRA_DIST = preflow_graph.dim #input file for preflow_test.cc
2.6
2.7 -noinst_HEADERS = test_tools.h graph_test.h
2.8 +noinst_HEADERS = test_tools.h graph_test.h sym_graph_test.h
2.9
2.10 check_PROGRAMS = \
2.11 bfs_test \
3.1 --- a/src/test/graph_test.cc Mon Oct 04 17:13:21 2004 +0000
3.2 +++ b/src/test/graph_test.cc Tue Oct 05 09:41:05 2004 +0000
3.3 @@ -67,27 +67,34 @@
3.4 }
3.5
3.6 //Compile Graph
3.7 -template void lemon::checkCompileStaticGraph<skeleton::StaticGraph>
3.8 +template void lemon::skeleton::checkCompileStaticGraph<skeleton::StaticGraph>
3.9 (skeleton::StaticGraph &);
3.10
3.11 -template void lemon::checkCompileGraph<skeleton::ExtendableGraph>
3.12 +template
3.13 +void lemon::skeleton::checkCompileExtendableGraph<skeleton::ExtendableGraph>
3.14 (skeleton::ExtendableGraph &);
3.15
3.16 -template void lemon::checkCompileErasableGraph<skeleton::ErasableGraph>
3.17 +template
3.18 +void lemon::skeleton::checkCompileErasableGraph<skeleton::ErasableGraph>
3.19 (skeleton::ErasableGraph &);
3.20
3.21 //Compile SmartGraph
3.22 -template void lemon::checkCompileGraph<SmartGraph>(SmartGraph &);
3.23 -template void lemon::checkCompileGraphFindEdge<SmartGraph>(SmartGraph &);
3.24 +template
3.25 +void lemon::skeleton::checkCompileExtendableGraph<SmartGraph>(SmartGraph &);
3.26 +template
3.27 +void lemon::skeleton::checkCompileGraphFindEdge<SmartGraph>(SmartGraph &);
3.28
3.29 //Compile SymSmartGraph
3.30 //template void hugo::checkCompileGraph<SymSmartGraph>(SymSmartGraph &);
3.31 //template void hugo::checkCompileGraphFindEdge<SymSmartGraph>(SymSmartGraph &);
3.32
3.33 //Compile ListGraph
3.34 -template void lemon::checkCompileGraph<ListGraph>(ListGraph &);
3.35 -template void lemon::checkCompileErasableGraph<ListGraph>(ListGraph &);
3.36 -template void lemon::checkCompileGraphFindEdge<ListGraph>(ListGraph &);
3.37 +template
3.38 +void lemon::skeleton::checkCompileExtendableGraph<ListGraph>(ListGraph &);
3.39 +template
3.40 +void lemon::skeleton::checkCompileErasableGraph<ListGraph>(ListGraph &);
3.41 +template
3.42 +void lemon::skeleton::checkCompileGraphFindEdge<ListGraph>(ListGraph &);
3.43
3.44
3.45 //Compile SymListGraph
3.46 @@ -96,22 +103,24 @@
3.47 //template void hugo::checkCompileGraphFindEdge<SymListGraph>(SymListGraph &);
3.48
3.49 //Compile FullGraph
3.50 -template void lemon::checkCompileStaticGraph<FullGraph>(FullGraph &);
3.51 -template void lemon::checkCompileGraphFindEdge<FullGraph>(FullGraph &);
3.52 +template void lemon::skeleton::checkCompileStaticGraph<FullGraph>(FullGraph &);
3.53 +template
3.54 +void lemon::skeleton::checkCompileGraphFindEdge<FullGraph>(FullGraph &);
3.55
3.56 //Compile EdgeSet <ListGraph>
3.57 -template void lemon::checkCompileGraph<EdgeSet <ListGraph> >
3.58 +template void lemon::skeleton::checkCompileExtendableGraph<EdgeSet <ListGraph> >
3.59 (EdgeSet <ListGraph> &);
3.60 -template void lemon::checkCompileGraphEraseEdge<EdgeSet <ListGraph> >
3.61 +template void lemon::skeleton::checkCompileGraphEraseEdge<EdgeSet <ListGraph> >
3.62 (EdgeSet <ListGraph> &);
3.63 -template void lemon::checkCompileGraphFindEdge<EdgeSet <ListGraph> >
3.64 +template void lemon::skeleton::checkCompileGraphFindEdge<EdgeSet <ListGraph> >
3.65 (EdgeSet <ListGraph> &);
3.66
3.67 //Compile EdgeSet <NodeSet>
3.68 -template void lemon::checkCompileGraph<EdgeSet <NodeSet> >(EdgeSet <NodeSet> &);
3.69 -template void lemon::checkCompileGraphEraseEdge<EdgeSet <NodeSet> >
3.70 +template void lemon::skeleton::checkCompileExtendableGraph<EdgeSet <NodeSet> >
3.71 (EdgeSet <NodeSet> &);
3.72 -template void lemon::checkCompileGraphFindEdge<EdgeSet <NodeSet> >
3.73 +template void lemon::skeleton::checkCompileGraphEraseEdge<EdgeSet <NodeSet> >
3.74 +(EdgeSet <NodeSet> &);
3.75 +template void lemon::skeleton::checkCompileGraphFindEdge<EdgeSet <NodeSet> >
3.76 (EdgeSet <NodeSet> &);
3.77
3.78
4.1 --- a/src/test/graph_test.h Mon Oct 04 17:13:21 2004 +0000
4.2 +++ b/src/test/graph_test.h Tue Oct 05 09:41:05 2004 +0000
4.3 @@ -24,251 +24,6 @@
4.4 //! \brief Some utility to test graph classes.
4.5 namespace lemon {
4.6
4.7 - struct DummyType {
4.8 - int value;
4.9 - DummyType() {}
4.10 - DummyType(int p) : value(p) {}
4.11 - DummyType& operator=(int p) { value = p; return *this;}
4.12 - };
4.13 -
4.14 -
4.15 - template<class Graph> void checkCompileStaticGraph(Graph &G)
4.16 - {
4.17 - typedef typename Graph::Node Node;
4.18 - typedef typename Graph::NodeIt NodeIt;
4.19 - typedef typename Graph::Edge Edge;
4.20 - typedef typename Graph::EdgeIt EdgeIt;
4.21 - typedef typename Graph::InEdgeIt InEdgeIt;
4.22 - typedef typename Graph::OutEdgeIt OutEdgeIt;
4.23 -
4.24 - {
4.25 - Node i; Node j(i); Node k(INVALID);
4.26 - i=j;
4.27 - bool b; b=true;
4.28 - b=(i==INVALID); b=(i!=INVALID);
4.29 - b=(i==j); b=(i!=j); b=(i<j);
4.30 - }
4.31 - {
4.32 - NodeIt i; NodeIt j(i); NodeIt k(INVALID); NodeIt l(G);
4.33 - i=j;
4.34 - j=G.first(i);
4.35 - j=++i;
4.36 - bool b; b=true;
4.37 - b=(i==INVALID); b=(i!=INVALID);
4.38 - Node n(i);
4.39 - n=i;
4.40 - b=(i==j); b=(i!=j); b=(i<j);
4.41 - //Node ->NodeIt conversion
4.42 - NodeIt ni(G,n);
4.43 - }
4.44 - {
4.45 - Edge i; Edge j(i); Edge k(INVALID);
4.46 - i=j;
4.47 - bool b; b=true;
4.48 - b=(i==INVALID); b=(i!=INVALID);
4.49 - b=(i==j); b=(i!=j); b=(i<j);
4.50 - }
4.51 - {
4.52 - EdgeIt i; EdgeIt j(i); EdgeIt k(INVALID); EdgeIt l(G);
4.53 - i=j;
4.54 - j=G.first(i);
4.55 - j=++i;
4.56 - bool b; b=true;
4.57 - b=(i==INVALID); b=(i!=INVALID);
4.58 - Edge e(i);
4.59 - e=i;
4.60 - b=(i==j); b=(i!=j); b=(i<j);
4.61 - //Edge ->EdgeIt conversion
4.62 - EdgeIt ei(G,e);
4.63 - }
4.64 - {
4.65 - Node n;
4.66 - InEdgeIt i; InEdgeIt j(i); InEdgeIt k(INVALID); InEdgeIt l(G,n);
4.67 - i=j;
4.68 - j=G.first(i,n);
4.69 - j=++i;
4.70 - bool b; b=true;
4.71 - b=(i==INVALID); b=(i!=INVALID);
4.72 - Edge e(i);
4.73 - e=i;
4.74 - b=(i==j); b=(i!=j); b=(i<j);
4.75 - //Edge ->InEdgeIt conversion
4.76 - InEdgeIt ei(G,e);
4.77 - }
4.78 - {
4.79 - Node n;
4.80 - OutEdgeIt i; OutEdgeIt j(i); OutEdgeIt k(INVALID); OutEdgeIt l(G,n);
4.81 - i=j;
4.82 - j=G.first(i,n);
4.83 - j=++i;
4.84 - bool b; b=true;
4.85 - b=(i==INVALID); b=(i!=INVALID);
4.86 - Edge e(i);
4.87 - e=i;
4.88 - b=(i==j); b=(i!=j); b=(i<j);
4.89 - //Edge ->OutEdgeIt conversion
4.90 - OutEdgeIt ei(G,e);
4.91 - }
4.92 - {
4.93 - Node n,m;
4.94 - n=m=INVALID;
4.95 - Edge e;
4.96 - e=INVALID;
4.97 - n=G.tail(e);
4.98 - n=G.head(e);
4.99 - }
4.100 - // id tests
4.101 - { Node n; int i=G.id(n); i=i; }
4.102 - { Edge e; int i=G.id(e); i=i; }
4.103 - //NodeMap tests
4.104 - {
4.105 - Node k;
4.106 - typename Graph::template NodeMap<int> m(G);
4.107 - //Const map
4.108 - typename Graph::template NodeMap<int> const &cm = m;
4.109 - //Inicialize with default value
4.110 - typename Graph::template NodeMap<int> mdef(G,12);
4.111 - //Copy
4.112 - typename Graph::template NodeMap<int> mm(cm);
4.113 - //Copy from another type
4.114 - typename Graph::template NodeMap<double> dm(cm);
4.115 - //Copy to more complex type
4.116 - typename Graph::template NodeMap<DummyType> em(cm);
4.117 - int v;
4.118 - v=m[k]; m[k]=v; m.set(k,v);
4.119 - v=cm[k];
4.120 -
4.121 - m=cm;
4.122 - dm=cm; //Copy from another type
4.123 - em=cm; //Copy to more complex type
4.124 - {
4.125 - //Check the typedef's
4.126 - typename Graph::template NodeMap<int>::ValueType val;
4.127 - val=1;
4.128 - typename Graph::template NodeMap<int>::KeyType key;
4.129 - key = typename Graph::NodeIt(G);
4.130 - }
4.131 - }
4.132 - { //bool NodeMap
4.133 - Node k;
4.134 - typename Graph::template NodeMap<bool> m(G);
4.135 - typename Graph::template NodeMap<bool> const &cm = m; //Const map
4.136 - //Inicialize with default value
4.137 - typename Graph::template NodeMap<bool> mdef(G,12);
4.138 - typename Graph::template NodeMap<bool> mm(cm); //Copy
4.139 - typename Graph::template NodeMap<int> dm(cm); //Copy from another type
4.140 - bool v;
4.141 - v=m[k]; m[k]=v; m.set(k,v);
4.142 - v=cm[k];
4.143 -
4.144 - m=cm;
4.145 - dm=cm; //Copy from another type
4.146 - m=dm; //Copy to another type
4.147 -
4.148 - {
4.149 - //Check the typedef's
4.150 - typename Graph::template NodeMap<bool>::ValueType val;
4.151 - val=true;
4.152 - typename Graph::template NodeMap<bool>::KeyType key;
4.153 - key= typename Graph::NodeIt(G);
4.154 - }
4.155 - }
4.156 - //EdgeMap tests
4.157 - {
4.158 - Edge k;
4.159 - typename Graph::template EdgeMap<int> m(G);
4.160 - typename Graph::template EdgeMap<int> const &cm = m; //Const map
4.161 - //Inicialize with default value
4.162 - typename Graph::template EdgeMap<int> mdef(G,12);
4.163 - typename Graph::template EdgeMap<int> mm(cm); //Copy
4.164 - typename Graph::template EdgeMap<double> dm(cm); //Copy from another type
4.165 - int v;
4.166 - v=m[k]; m[k]=v; m.set(k,v);
4.167 - v=cm[k];
4.168 -
4.169 - m=cm;
4.170 - dm=cm; //Copy from another type
4.171 - {
4.172 - //Check the typedef's
4.173 - typename Graph::template EdgeMap<int>::ValueType val;
4.174 - val=1;
4.175 - typename Graph::template EdgeMap<int>::KeyType key;
4.176 - key= typename Graph::EdgeIt(G);
4.177 - }
4.178 - }
4.179 - { //bool EdgeMap
4.180 - Edge k;
4.181 - typename Graph::template EdgeMap<bool> m(G);
4.182 - typename Graph::template EdgeMap<bool> const &cm = m; //Const map
4.183 - //Inicialize with default value
4.184 - typename Graph::template EdgeMap<bool> mdef(G,12);
4.185 - typename Graph::template EdgeMap<bool> mm(cm); //Copy
4.186 - typename Graph::template EdgeMap<int> dm(cm); //Copy from another type
4.187 - bool v;
4.188 - v=m[k]; m[k]=v; m.set(k,v);
4.189 - v=cm[k];
4.190 -
4.191 - m=cm;
4.192 - dm=cm; //Copy from another type
4.193 - m=dm; //Copy to another type
4.194 - {
4.195 - //Check the typedef's
4.196 - typename Graph::template EdgeMap<bool>::ValueType val;
4.197 - val=true;
4.198 - typename Graph::template EdgeMap<bool>::KeyType key;
4.199 - key= typename Graph::EdgeIt(G);
4.200 - }
4.201 - }
4.202 - }
4.203 -
4.204 - template<class Graph> void checkCompileGraph(Graph &G)
4.205 - {
4.206 - checkCompileStaticGraph(G);
4.207 -
4.208 - typedef typename Graph::Node Node;
4.209 - typedef typename Graph::NodeIt NodeIt;
4.210 - typedef typename Graph::Edge Edge;
4.211 - typedef typename Graph::EdgeIt EdgeIt;
4.212 - typedef typename Graph::InEdgeIt InEdgeIt;
4.213 - typedef typename Graph::OutEdgeIt OutEdgeIt;
4.214 -
4.215 - Node n,m;
4.216 - n=G.addNode();
4.217 - m=G.addNode();
4.218 - Edge e;
4.219 - e=G.addEdge(n,m);
4.220 -
4.221 - // G.clear();
4.222 - }
4.223 -
4.224 - template<class Graph> void checkCompileGraphEraseEdge(Graph &G)
4.225 - {
4.226 - typename Graph::Edge e;
4.227 - G.erase(e);
4.228 - }
4.229 -
4.230 - template<class Graph> void checkCompileGraphEraseNode(Graph &G)
4.231 - {
4.232 - typename Graph::Node n;
4.233 - G.erase(n);
4.234 - }
4.235 -
4.236 - template<class Graph> void checkCompileErasableGraph(Graph &G)
4.237 - {
4.238 - checkCompileGraph(G);
4.239 - checkCompileGraphEraseNode(G);
4.240 - checkCompileGraphEraseEdge(G);
4.241 - }
4.242 -
4.243 - template<class Graph> void checkCompileGraphFindEdge(Graph &G)
4.244 - {
4.245 - typedef typename Graph::NodeIt Node;
4.246 - typedef typename Graph::NodeIt NodeIt;
4.247 -
4.248 - G.findEdge(NodeIt(G),++NodeIt(G),G.findEdge(NodeIt(G),++NodeIt(G)));
4.249 - G.findEdge(Node(),Node(),G.findEdge(Node(),Node()));
4.250 - }
4.251 -
4.252 template<class Graph> void checkGraphNodeList(Graph &G, int nn)
4.253 {
4.254 typename Graph::NodeIt n(G);
5.1 --- a/src/test/graph_wrapper_test.cc Mon Oct 04 17:13:21 2004 +0000
5.2 +++ b/src/test/graph_wrapper_test.cc Tue Oct 05 09:41:05 2004 +0000
5.3 @@ -38,24 +38,24 @@
5.4
5.5 //Compile GraphWrapper
5.6 typedef GraphWrapper<Graph> GW;
5.7 -template void checkCompileStaticGraph<GW>(GW &);
5.8 +template void lemon::skeleton::checkCompileStaticGraph<GW>(GW &);
5.9
5.10 //Compile RevGraphWrapper
5.11 typedef RevGraphWrapper<Graph> RevGW;
5.12 -template void checkCompileStaticGraph<RevGW>(RevGW &);
5.13 +template void lemon::skeleton::checkCompileStaticGraph<RevGW>(RevGW &);
5.14
5.15 //Compile SubGraphWrapper
5.16 typedef SubGraphWrapper<Graph, Graph::NodeMap<bool>,
5.17 Graph::EdgeMap<bool> > SubGW;
5.18 -template void checkCompileStaticGraph<SubGW>(SubGW &);
5.19 +template void lemon::skeleton::checkCompileStaticGraph<SubGW>(SubGW &);
5.20
5.21 //Compile NodeSubGraphWrapper
5.22 typedef NodeSubGraphWrapper<Graph, Graph::NodeMap<bool> > NodeSubGW;
5.23 -template void checkCompileStaticGraph<NodeSubGW>(NodeSubGW &);
5.24 +template void lemon::skeleton::checkCompileStaticGraph<NodeSubGW>(NodeSubGW &);
5.25
5.26 //Compile EdgeSubGraphWrapper
5.27 typedef EdgeSubGraphWrapper<Graph, Graph::EdgeMap<bool> > EdgeSubGW;
5.28 -template void checkCompileStaticGraph<EdgeSubGW>(EdgeSubGW &);
5.29 +template void lemon::skeleton::checkCompileStaticGraph<EdgeSubGW>(EdgeSubGW &);
5.30
5.31 //Compile UndirGraphWrapper
5.32 /// \bug UndirGraphWrapper cannot pass the StaticGraph test
5.33 @@ -69,24 +69,25 @@
5.34 //Compile SubBidirGraphWrapper
5.35 typedef SubBidirGraphWrapper<Graph, Graph::EdgeMap<bool>,
5.36 Graph::EdgeMap<bool> > SubBDGW;
5.37 -template void checkCompileStaticGraph<SubBDGW>(SubBDGW &);
5.38 +template void lemon::skeleton::checkCompileStaticGraph<SubBDGW>(SubBDGW &);
5.39
5.40 //Compile BidirGraphWrapper
5.41 typedef BidirGraphWrapper<Graph> BidirGW;
5.42 -template void checkCompileStaticGraph<BidirGW>(BidirGW &);
5.43 +template void lemon::skeleton::checkCompileStaticGraph<BidirGW>(BidirGW &);
5.44
5.45 //Compile BidirGraph
5.46 typedef BidirGraph<Graph> BidirG;
5.47 -template void checkCompileStaticGraph<BidirG>(BidirG &);
5.48 +template void lemon::skeleton::checkCompileStaticGraph<BidirG>(BidirG &);
5.49
5.50 //Compile ResGraphWrapper
5.51 typedef ResGraphWrapper<Graph, int, Graph::EdgeMap<int>,
5.52 Graph::EdgeMap<int> > ResGW;
5.53 -template void checkCompileStaticGraph<ResGW>(ResGW &);
5.54 +template void lemon::skeleton::checkCompileStaticGraph<ResGW>(ResGW &);
5.55
5.56 //Compile ErasingFirstGraphWrapper
5.57 typedef ErasingFirstGraphWrapper<Graph, Graph::NodeMap<Graph::Edge> > ErasingFirstGW;
5.58 -template void checkCompileStaticGraph<ErasingFirstGW>(ErasingFirstGW &);
5.59 +template
5.60 +void lemon::skeleton::checkCompileStaticGraph<ErasingFirstGW>(ErasingFirstGW &);
5.61
5.62
5.63 int main()
6.1 --- a/src/test/sym_graph_test.cc Mon Oct 04 17:13:21 2004 +0000
6.2 +++ b/src/test/sym_graph_test.cc Tue Oct 05 09:41:05 2004 +0000
6.3 @@ -66,12 +66,14 @@
6.4
6.5 //Compile SymSmartGraph
6.6 template void lemon::checkCompileSymGraph<SymSmartGraph>(SymSmartGraph &);
6.7 -template void lemon::checkCompileGraphFindEdge<SymSmartGraph>(SymSmartGraph &);
6.8 +template
6.9 +void lemon::skeleton::checkCompileGraphFindEdge<SymSmartGraph>(SymSmartGraph &);
6.10
6.11 //Compile SymListGraph
6.12 template void lemon::checkCompileSymGraph<SymListGraph>(SymListGraph &);
6.13 template void lemon::checkCompileErasableSymGraph<SymListGraph>(SymListGraph &);
6.14 -template void lemon::checkCompileGraphFindEdge<SymListGraph>(SymListGraph &);
6.15 +template
6.16 +void lemon::skeleton::checkCompileGraphFindEdge<SymListGraph>(SymListGraph &);
6.17
6.18 int main()
6.19 {
7.1 --- a/src/test/sym_graph_test.h Mon Oct 04 17:13:21 2004 +0000
7.2 +++ b/src/test/sym_graph_test.h Tue Oct 05 09:41:05 2004 +0000
7.3 @@ -24,7 +24,11 @@
7.4 //! \file
7.5 //! \brief Some utility to test symmetric graph classes.
7.6 namespace lemon {
7.7 +
7.8 + /// \e
7.9
7.10 + /// \todo This should go to lemon/skeleton/symgraph.h
7.11 + ///
7.12 template<class Graph> void checkCompileStaticSymGraph(Graph &G)
7.13 {
7.14 typedef typename Graph::Node Node;
7.15 @@ -36,7 +40,7 @@
7.16 typedef typename Graph::InEdgeIt InEdgeIt;
7.17 typedef typename Graph::OutEdgeIt OutEdgeIt;
7.18
7.19 - checkCompileStaticGraph(G);
7.20 + lemon::skeleton::checkCompileStaticGraph(G);
7.21
7.22 {
7.23 SymEdge i; SymEdge j(i); SymEdge k(INVALID);
7.24 @@ -153,7 +157,7 @@
7.25 template<class Graph> void checkCompileErasableSymGraph(Graph &G)
7.26 {
7.27 checkCompileSymGraph(G);
7.28 - checkCompileGraphEraseNode(G);
7.29 + lemon::skeleton::checkCompileGraphEraseNode(G);
7.30 checkCompileSymGraphEraseSymEdge(G);
7.31 }
7.32