src/work/marci/bfs_dfs.h
changeset 937 d4e911acef3d
parent 777 a82713ed19f3
child 986 e997802b855c
equal deleted inserted replaced
7:0b1d6779906f 8:3e1c763e568c
     1 // -*- c++ -*-
     1 // -*- c++ -*-
     2 #ifndef HUGO_BFS_DFS_H
     2 #ifndef LEMON_BFS_DFS_H
     3 #define HUGO_BFS_DFS_H
     3 #define LEMON_BFS_DFS_H
     4 
     4 
     5 /// \ingroup galgs
     5 /// \ingroup galgs
     6 /// \file
     6 /// \file
     7 /// \brief Bfs and dfs iterators.
     7 /// \brief Bfs and dfs iterators.
     8 ///
     8 ///
    12 
    12 
    13 #include <queue>
    13 #include <queue>
    14 #include <stack>
    14 #include <stack>
    15 #include <utility>
    15 #include <utility>
    16 
    16 
    17 #include <hugo/invalid.h>
    17 #include <lemon/invalid.h>
    18 
    18 
    19 namespace hugo {
    19 namespace lemon {
    20 
    20 
    21   /// Bfs searches for the nodes wich are not marked in 
    21   /// Bfs searches for the nodes wich are not marked in 
    22   /// \c reached_map
    22   /// \c reached_map
    23   /// Reached have to be a read-write bool node-map.
    23   /// Reached have to be a read-write bool node-map.
    24   /// \ingroup galgs
    24   /// \ingroup galgs
   115     }
   115     }
   116     /// Returns true iff the algorithm is finished.
   116     /// Returns true iff the algorithm is finished.
   117     bool finished() const { return bfs_queue.empty(); }
   117     bool finished() const { return bfs_queue.empty(); }
   118     /// The conversion operator makes for converting the bfs-iterator 
   118     /// The conversion operator makes for converting the bfs-iterator 
   119     /// to an \c out-edge-iterator.
   119     /// to an \c out-edge-iterator.
   120     ///\bug Edge have to be in HUGO 0.2
   120     ///\bug Edge have to be in LEMON 0.2
   121     operator Edge() const { return actual_edge; }
   121     operator Edge() const { return actual_edge; }
   122     /// Returns if b-node has been reached just now.
   122     /// Returns if b-node has been reached just now.
   123     bool isBNodeNewlyReached() const { return b_node_newly_reached; }
   123     bool isBNodeNewlyReached() const { return b_node_newly_reached; }
   124     /// Returns if a-node is examined.
   124     /// Returns if a-node is examined.
   125     bool isANodeExamined() const { return actual_edge==INVALID; }
   125     bool isANodeExamined() const { return actual_edge==INVALID; }
   267     }
   267     }
   268     /// Returns true iff the algorithm is finished.
   268     /// Returns true iff the algorithm is finished.
   269     bool finished() const { return dfs_stack.empty(); }
   269     bool finished() const { return dfs_stack.empty(); }
   270     /// The conversion operator makes for converting the bfs-iterator 
   270     /// The conversion operator makes for converting the bfs-iterator 
   271     /// to an \c out-edge-iterator.
   271     /// to an \c out-edge-iterator.
   272     ///\bug Edge have to be in HUGO 0.2
   272     ///\bug Edge have to be in LEMON 0.2
   273     operator Edge() const { return actual_edge; }
   273     operator Edge() const { return actual_edge; }
   274     /// Returns if b-node has been reached just now.
   274     /// Returns if b-node has been reached just now.
   275     bool isBNodeNewlyReached() const { return b_node_newly_reached; }
   275     bool isBNodeNewlyReached() const { return b_node_newly_reached; }
   276     /// Returns if a-node is examined.
   276     /// Returns if a-node is examined.
   277     bool isANodeExamined() const { return actual_edge==INVALID; }
   277     bool isANodeExamined() const { return actual_edge==INVALID; }
   341     /// \deprecated
   341     /// \deprecated
   342     const PredMap& getPredMap() const { return pred; }
   342     const PredMap& getPredMap() const { return pred; }
   343   };
   343   };
   344 
   344 
   345 
   345 
   346 } // namespace hugo
   346 } // namespace lemon
   347 
   347 
   348 #endif //HUGO_BFS_DFS_H
   348 #endif //LEMON_BFS_DFS_H