test/dfs_test.cc
changeset 988 d395358592df
parent 632 65fbcf2f978a
child 1010 1861d5dcf312
child 1107 2b6bffe0e7e8
equal deleted inserted replaced
8:49fb9d42927c 9:9c1f5d27e31f
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     2  *
     2  *
     3  * This file is a part of LEMON, a generic C++ optimization library.
     3  * This file is a part of LEMON, a generic C++ optimization library.
     4  *
     4  *
     5  * Copyright (C) 2003-2009
     5  * Copyright (C) 2003-2010
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     8  *
     8  *
     9  * Permission to use, modify and distribute this software is granted
     9  * Permission to use, modify and distribute this software is granted
    10  * provided that this copyright notice appears in all copies. For
    10  * provided that this copyright notice appears in all copies. For
    81     dfs_test.addSource(s);
    81     dfs_test.addSource(s);
    82     e = dfs_test.processNextArc();
    82     e = dfs_test.processNextArc();
    83     e = const_dfs_test.nextArc();
    83     e = const_dfs_test.nextArc();
    84     b = const_dfs_test.emptyQueue();
    84     b = const_dfs_test.emptyQueue();
    85     i = const_dfs_test.queueSize();
    85     i = const_dfs_test.queueSize();
    86     
    86 
    87     dfs_test.start();
    87     dfs_test.start();
    88     dfs_test.start(t);
    88     dfs_test.start(t);
    89     dfs_test.start(am);
    89     dfs_test.start(am);
    90 
    90 
    91     l  = const_dfs_test.dist(t);
    91     l  = const_dfs_test.dist(t);
   107 
   107 
   108     concepts::ReadWriteMap<Node,Arc> pred_map;
   108     concepts::ReadWriteMap<Node,Arc> pred_map;
   109     concepts::ReadWriteMap<Node,int> dist_map;
   109     concepts::ReadWriteMap<Node,int> dist_map;
   110     concepts::ReadWriteMap<Node,bool> reached_map;
   110     concepts::ReadWriteMap<Node,bool> reached_map;
   111     concepts::WriteMap<Node,bool> processed_map;
   111     concepts::WriteMap<Node,bool> processed_map;
   112     
   112 
   113     dfs_test
   113     dfs_test
   114       .predMap(pred_map)
   114       .predMap(pred_map)
   115       .distMap(dist_map)
   115       .distMap(dist_map)
   116       .reachedMap(reached_map)
   116       .reachedMap(reached_map)
   117       .processedMap(processed_map);
   117       .processedMap(processed_map);
   124     dfs_test.addSource(s);
   124     dfs_test.addSource(s);
   125     e = dfs_test.processNextArc();
   125     e = dfs_test.processNextArc();
   126     e = dfs_test.nextArc();
   126     e = dfs_test.nextArc();
   127     b = dfs_test.emptyQueue();
   127     b = dfs_test.emptyQueue();
   128     i = dfs_test.queueSize();
   128     i = dfs_test.queueSize();
   129     
   129 
   130     dfs_test.start();
   130     dfs_test.start();
   131     dfs_test.start(t);
   131     dfs_test.start(t);
   132     dfs_test.start(am);
   132     dfs_test.start(am);
   133 
   133 
   134     l  = dfs_test.dist(t);
   134     l  = dfs_test.dist(t);