- BFD/DFS/Dijkstra compile test is done with skeleton::GraphSkeleton graph
authoralpar
Fri, 03 Sep 2004 09:41:50 +0000
changeset 7939cd0aeea47b0
parent 792 147eb3a58706
child 794 d9ec436d11fe
- BFD/DFS/Dijkstra compile test is done with skeleton::GraphSkeleton graph
and skeleton::ReadMap.
- 'skeleton::' is explicitely written instead of 'using namespace ...'
in graph_test.cc
- Output messages of type "makeRep(3)..." in unionfind_test.cc have been
changed in order not to confuse compiler output parsers.
src/test/bfs_test.cc
src/test/dfs_test.cc
src/test/dijkstra_test.cc
src/test/graph_test.cc
src/test/unionfind_test.cc
     1.1 --- a/src/test/bfs_test.cc	Thu Sep 02 17:56:40 2004 +0000
     1.2 +++ b/src/test/bfs_test.cc	Fri Sep 03 09:41:50 2004 +0000
     1.3 @@ -1,34 +1,32 @@
     1.4  #include "test_tools.h"
     1.5  #include <hugo/smart_graph.h>
     1.6  #include <hugo/bfs.h>
     1.7 +#include<hugo/skeletons/graph.h>
     1.8  
     1.9  using namespace hugo;
    1.10  
    1.11  const int PET_SIZE =5;
    1.12  
    1.13  
    1.14 -void check_Bfs_SmartGraph_Compile() 
    1.15 +void check_Bfs_Compile() 
    1.16  {
    1.17 -  typedef int VType;
    1.18 -  typedef SmartGraph Graph;
    1.19 +  typedef skeleton::StaticGraphSkeleton Graph;
    1.20  
    1.21    typedef Graph::Edge Edge;
    1.22    typedef Graph::Node Node;
    1.23    typedef Graph::EdgeIt EdgeIt;
    1.24    typedef Graph::NodeIt NodeIt;
    1.25 -  typedef Graph::EdgeMap<VType> LengthMap;
    1.26   
    1.27    typedef Bfs<Graph> BType;
    1.28    
    1.29    Graph G;
    1.30    Node n;
    1.31    Edge e;
    1.32 -  VType l;
    1.33 +  int l;
    1.34    bool b;
    1.35    BType::DistMap d(G);
    1.36    BType::PredMap p(G);
    1.37    BType::PredNodeMap pn(G);
    1.38 -  LengthMap cap(G);
    1.39    
    1.40    BType bfs_test(G);
    1.41    
     2.1 --- a/src/test/dfs_test.cc	Thu Sep 02 17:56:40 2004 +0000
     2.2 +++ b/src/test/dfs_test.cc	Fri Sep 03 09:41:50 2004 +0000
     2.3 @@ -1,6 +1,7 @@
     2.4  #include "test_tools.h"
     2.5  #include <hugo/smart_graph.h>
     2.6  #include <hugo/dfs.h>
     2.7 +#include<hugo/skeletons/graph.h>
     2.8  
     2.9  using namespace hugo;
    2.10  
    2.11 @@ -9,28 +10,25 @@
    2.12  
    2.13  void check_Dfs_SmartGraph_Compile() 
    2.14  {
    2.15 -  typedef int VType;
    2.16 -  typedef SmartGraph Graph;
    2.17 +  typedef skeleton::StaticGraphSkeleton Graph;
    2.18  
    2.19    typedef Graph::Edge Edge;
    2.20    typedef Graph::Node Node;
    2.21    typedef Graph::EdgeIt EdgeIt;
    2.22    typedef Graph::NodeIt NodeIt;
    2.23 -  typedef Graph::EdgeMap<VType> LengthMap;
    2.24   
    2.25 -  typedef Dfs<Graph> BType;
    2.26 +  typedef Dfs<Graph> DType;
    2.27    
    2.28    Graph G;
    2.29    Node n;
    2.30    Edge e;
    2.31 -  VType l;
    2.32 +  int l;
    2.33    bool b;
    2.34 -  BType::DistMap d(G);
    2.35 -  BType::PredMap p(G);
    2.36 -  BType::PredNodeMap pn(G);
    2.37 -  LengthMap cap(G);
    2.38 +  DType::DistMap d(G);
    2.39 +  DType::PredMap p(G);
    2.40 +  DType::PredNodeMap pn(G);
    2.41    
    2.42 -  BType dfs_test(G);
    2.43 +  DType dfs_test(G);
    2.44    
    2.45    dfs_test.run(n);
    2.46    
     3.1 --- a/src/test/dijkstra_test.cc	Thu Sep 02 17:56:40 2004 +0000
     3.2 +++ b/src/test/dijkstra_test.cc	Fri Sep 03 09:41:50 2004 +0000
     3.3 @@ -1,22 +1,23 @@
     3.4  #include "test_tools.h"
     3.5  #include <hugo/smart_graph.h>
     3.6  #include <hugo/dijkstra.h>
     3.7 -
     3.8 +#include<hugo/skeletons/graph.h>
     3.9 +#include<hugo/skeletons/maps.h>
    3.10  using namespace hugo;
    3.11  
    3.12  const int PET_SIZE =5;
    3.13  
    3.14  
    3.15 -void check_Dijkstra_SmartGraph_BinHeap_Compile() 
    3.16 +void check_Dijkstra_BinHeap_Compile() 
    3.17  {
    3.18    typedef int VType;
    3.19 -  typedef SmartGraph Graph;
    3.20 +  typedef skeleton::StaticGraphSkeleton Graph;
    3.21  
    3.22    typedef Graph::Edge Edge;
    3.23    typedef Graph::Node Node;
    3.24    typedef Graph::EdgeIt EdgeIt;
    3.25    typedef Graph::NodeIt NodeIt;
    3.26 -  typedef Graph::EdgeMap<VType> LengthMap;
    3.27 +  typedef skeleton::ReadMap<Edge,VType> LengthMap;
    3.28   
    3.29    typedef Dijkstra<Graph, LengthMap> DType;
    3.30    
    3.31 @@ -28,7 +29,7 @@
    3.32    DType::DistMap d(G);
    3.33    DType::PredMap p(G);
    3.34    DType::PredNodeMap pn(G);
    3.35 -  LengthMap cap(G);
    3.36 +  LengthMap cap;
    3.37  
    3.38    DType dijkstra_test(G,cap);
    3.39  
     4.1 --- a/src/test/graph_test.cc	Thu Sep 02 17:56:40 2004 +0000
     4.2 +++ b/src/test/graph_test.cc	Fri Sep 03 09:41:50 2004 +0000
     4.3 @@ -18,7 +18,6 @@
     4.4  */
     4.5  
     4.6  using namespace hugo;
     4.7 -using namespace hugo::skeleton;
     4.8  
     4.9  template<class Graph> void checkCompileStaticGraph(Graph &G) 
    4.10  {
    4.11 @@ -341,11 +340,13 @@
    4.12  }
    4.13  
    4.14  //Compile GraphSkeleton
    4.15 -template 
    4.16 -void checkCompileStaticGraph<StaticGraphSkeleton>(StaticGraphSkeleton &);
    4.17 -template void checkCompile<GraphSkeleton>(GraphSkeleton &);
    4.18 -template
    4.19 -void checkCompileErase<EraseableGraphSkeleton>(EraseableGraphSkeleton &);
    4.20 +template void checkCompileStaticGraph<skeleton::StaticGraphSkeleton>
    4.21 +(skeleton::StaticGraphSkeleton &);
    4.22 +
    4.23 +template void checkCompile<skeleton::GraphSkeleton>(skeleton::GraphSkeleton &);
    4.24 +
    4.25 +template void checkCompileErase<skeleton::EraseableGraphSkeleton>
    4.26 +(skeleton::EraseableGraphSkeleton &);
    4.27  
    4.28  //Compile SmartGraph
    4.29  template void checkCompile<SmartGraph>(SmartGraph &);
     5.1 --- a/src/test/unionfind_test.cc	Thu Sep 02 17:56:40 2004 +0000
     5.2 +++ b/src/test/unionfind_test.cc	Fri Sep 03 09:41:50 2004 +0000
     5.3 @@ -162,13 +162,13 @@
     5.4    cout << "Size of the class of 2: " << U.size(2) << endl;
     5.5    check(U.size(2) == 3,"Test failed.");
     5.6  
     5.7 -  cout << "makeRep(4)..." << endl;
     5.8 +  cout << "Calling makeRep(4)..." << endl;
     5.9    U.makeRep(4);
    5.10  //   print(U);
    5.11 -  cout << "makeRep(3)..." << endl;
    5.12 +  cout << "Calling makeRep(3)..." << endl;
    5.13    U.makeRep(3);
    5.14  //   print(U);
    5.15 -  cout << "makeRep(2)..." << endl;
    5.16 +  cout << "Calling makeRep(2)..." << endl;
    5.17    U.makeRep(2);
    5.18  //   print(U);
    5.19