src/work/marci/graph_wrapper_test.cc
changeset 870 9bde6cd8e3da
parent 850 54d3c1599d08
child 873 f3a30fda2e49
equal deleted inserted replaced
0:7c6854513787 1:b7fca71aa1d6
     3 #include<hugo/skeletons/graph.h>
     3 #include<hugo/skeletons/graph.h>
     4 #include<hugo/list_graph.h>
     4 #include<hugo/list_graph.h>
     5 #include<hugo/full_graph.h>
     5 #include<hugo/full_graph.h>
     6 #include<hugo/graph_wrapper.h>
     6 #include<hugo/graph_wrapper.h>
     7 
     7 
     8 #include"test_tools.h"
     8 #include"test/test_tools.h"
     9 #include"graph_test.h"
     9 #include"test/graph_test.h"
    10 
    10 
    11 /**
    11 /**
    12 \file
    12 \file
    13 This test makes consistency checks of list graph structures.
    13 This test makes consistency checks of list graph structures.
    14 
    14 
    18 conversion.
    18 conversion.
    19 */
    19 */
    20 
    20 
    21 using namespace hugo;
    21 using namespace hugo;
    22 
    22 
    23 template<class Graph> void bidirPetersen(Graph &G)
    23 // template<class Graph> void bidirPetersen(Graph &G)
    24 {
    24 // {
    25   typedef typename Graph::Edge Edge;
    25 //   typedef typename Graph::Edge Edge;
    26   typedef typename Graph::EdgeIt EdgeIt;
    26 //   typedef typename Graph::EdgeIt EdgeIt;
    27   
    27   
    28   checkGraphEdgeList(G,15);
    28 //   checkGraphEdgeList(G,15);
    29   
    29   
    30   std::vector<Edge> ee;
    30 //   std::vector<Edge> ee;
    31   
    31   
    32   for(EdgeIt e(G);e!=INVALID;++e) ee.push_back(e);
    32 //   for(EdgeIt e(G);e!=INVALID;++e) ee.push_back(e);
    33 
    33 
    34   for(typename std::vector<Edge>::iterator p=ee.begin();p!=ee.end();p++)
    34 //   for(typename std::vector<Edge>::iterator p=ee.begin();p!=ee.end();p++)
    35     G.addEdge(G.head(*p),G.tail(*p));
    35 //     G.addEdge(G.head(*p),G.tail(*p));
    36 }
    36 // }
    37 
    37 
    38 template<class Graph> void checkPetersen(Graph &G)
    38 // template<class Graph> void checkPetersen(Graph &G)
    39 {
    39 // {
    40   typedef typename Graph::Node Node;
    40 //   typedef typename Graph::Node Node;
    41 
    41 
    42   typedef typename Graph::EdgeIt EdgeIt;
    42 //   typedef typename Graph::EdgeIt EdgeIt;
    43   typedef typename Graph::NodeIt NodeIt;
    43 //   typedef typename Graph::NodeIt NodeIt;
    44 
    44 
    45   checkGraphNodeList(G,10);
    45 //   checkGraphNodeList(G,10);
    46   checkGraphEdgeList(G,30);
    46 //   checkGraphEdgeList(G,30);
    47 
    47 
    48   for(NodeIt n(G);n!=INVALID;++n) {
    48 //   for(NodeIt n(G);n!=INVALID;++n) {
    49     checkGraphInEdgeList(G,n,3);
    49 //     checkGraphInEdgeList(G,n,3);
    50     checkGraphOutEdgeList(G,n,3);
    50 //     checkGraphOutEdgeList(G,n,3);
    51     ++n;
    51 //     ++n;
    52   }  
    52 //   }  
    53 }
    53 // }
    54 
    54 
    55 //Compile GraphSkeleton
    55 // //Compile GraphSkeleton
    56 template void checkCompileStaticGraph<skeleton::StaticGraphSkeleton>
    56 // template void checkCompileStaticGraph<skeleton::StaticGraphSkeleton>
    57 (skeleton::StaticGraphSkeleton &);
    57 // (skeleton::StaticGraphSkeleton &);
    58 
    58 
    59 template void checkCompileGraph<skeleton::GraphSkeleton>
    59 // template void checkCompileGraph<skeleton::GraphSkeleton>
    60 (skeleton::GraphSkeleton &);
    60 // (skeleton::GraphSkeleton &);
    61 
    61 
    62 template void checkCompileErasableGraph<skeleton::ErasableGraphSkeleton>
    62 // template void checkCompileErasableGraph<skeleton::ErasableGraphSkeleton>
    63 (skeleton::ErasableGraphSkeleton &);
    63 // (skeleton::ErasableGraphSkeleton &);
    64 
    64 
    65 //Compile SmartGraph
    65 //Compile SmartGraph
    66 typedef SmartGraph Graph;
    66 typedef SmartGraph Graph;
    67 typedef GraphWrapper<Graph> GW;
    67 typedef GraphWrapper<Graph> GW;
    68 template void checkCompileStaticGraph<GW>(GW &);
    68 template void checkCompileStaticGraph<GW>(GW &);