Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

dfs.hxx

Go to the documentation of this file.
00001 // dfs.hh: this file is part of the Vaucanson project.
00002 //
00003 // Vaucanson, a generic library for finite state machines.
00004 //
00005 // Copyright (C) 2006, 2007 The Vaucanson Group.
00006 //
00007 // This program is free software; you can redistribute it and/or
00008 // modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2
00010 // of the License, or (at your option) any later version.
00011 //
00012 // The complete GNU General Public Licence Notice can be found as the
00013 // `COPYING' file in the root directory.
00014 //
00015 // The Vaucanson Group consists of people listed in the `AUTHORS' file.
00016 //
00017 #ifndef VCSN_ALGORITHMS_DFS_HH
00018 # define VCSN_ALGORITHMS_DFS_HH
00019 
00020 # include <map>
00021 
00033 namespace vcsn
00034 {
00035 
00036   template <typename S, typename T>
00037   void DepthFirstSearchBase<S, T>::operator() (const auto_t& aut)
00038   {
00039     visited_.clear();
00040     do_dfs(aut.structure(), aut);
00041   }
00042 
00043 
00044   template <typename S, typename T>
00045   void DepthFirstSearchBase<S, T>::do_dfs() (SELECTOR(AutomatBase<S>), const auto_t& aut)
00046   {
00047     for_all_states(s, aut)
00048       visited_[s] = WHITE;
00049 
00050     for_all_states(s, aut)
00051       if (visited_[s] == WHITE)
00052         do_dfs(s);
00053   }
00054 
00055 
00056   template <typename S, typename T>
00057   void DepthFirstSearchBase<S, T>::do_dfs() (const hstate_t& s, const auto_t& aut)
00058   {
00059     visited_[s] = GRAY;
00060     switch
00061   }
00062 
00063 
00064 }
00065 
00066 
00067 #endif // ! VCSN_ALGORITHMS_DFS_HXX

Generated on Fri Oct 12 21:22:46 2007 for Vaucanson by  doxygen 1.4.4