test/bfs_test.cc
changeset 2302 d3c664c975ee
parent 2247 269a0dcee70b
child 2335 27aa03cd3121
equal deleted inserted replaced
6:677ae44f6be0 7:c2f169a0857d
    18 
    18 
    19 #include "test_tools.h"
    19 #include "test_tools.h"
    20 #include <lemon/smart_graph.h>
    20 #include <lemon/smart_graph.h>
    21 #include <lemon/bfs.h>
    21 #include <lemon/bfs.h>
    22 #include <lemon/path.h>
    22 #include <lemon/path.h>
    23 #include<lemon/concept/graph.h>
    23 #include<lemon/concepts/graph.h>
    24 
    24 
    25 using namespace lemon;
    25 using namespace lemon;
    26 
    26 
    27 const int PET_SIZE =5;
    27 const int PET_SIZE =5;
    28 
    28 
    29 
    29 
    30 void check_Bfs_Compile() 
    30 void check_Bfs_Compile() 
    31 {
    31 {
    32   typedef concept::Graph Graph;
    32   typedef concepts::Graph Graph;
    33 
    33 
    34   typedef Graph::Edge Edge;
    34   typedef Graph::Edge Edge;
    35   typedef Graph::Node Node;
    35   typedef Graph::Node Node;
    36   typedef Graph::EdgeIt EdgeIt;
    36   typedef Graph::EdgeIt EdgeIt;
    37   typedef Graph::NodeIt NodeIt;
    37   typedef Graph::NodeIt NodeIt;
    64 }
    64 }
    65 
    65 
    66 void check_Bfs_Function_Compile() 
    66 void check_Bfs_Function_Compile() 
    67 {
    67 {
    68   typedef int VType;
    68   typedef int VType;
    69   typedef concept::Graph Graph;
    69   typedef concepts::Graph Graph;
    70 
    70 
    71   typedef Graph::Edge Edge;
    71   typedef Graph::Edge Edge;
    72   typedef Graph::Node Node;
    72   typedef Graph::Node Node;
    73   typedef Graph::EdgeIt EdgeIt;
    73   typedef Graph::EdgeIt EdgeIt;
    74   typedef Graph::NodeIt NodeIt;
    74   typedef Graph::NodeIt NodeIt;
    75   typedef concept::ReadMap<Edge,VType> LengthMap;
    75   typedef concepts::ReadMap<Edge,VType> LengthMap;
    76    
    76    
    77   Graph g;
    77   Graph g;
    78   bfs(g,Node()).run();
    78   bfs(g,Node()).run();
    79   bfs(g).source(Node()).run();
    79   bfs(g).source(Node()).run();
    80   bfs(g)
    80   bfs(g)
    81     .predMap(concept::WriteMap<Node,Edge>())
    81     .predMap(concepts::WriteMap<Node,Edge>())
    82     .distMap(concept::WriteMap<Node,VType>())
    82     .distMap(concepts::WriteMap<Node,VType>())
    83     .reachedMap(concept::ReadWriteMap<Node,bool>())
    83     .reachedMap(concepts::ReadWriteMap<Node,bool>())
    84     .processedMap(concept::WriteMap<Node,bool>())
    84     .processedMap(concepts::WriteMap<Node,bool>())
    85     .run(Node());
    85     .run(Node());
    86   
    86   
    87 }
    87 }
    88 
    88 
    89 int main()
    89 int main()