Vaucanson 1.4
|
00001 // has_neighbour.hxx: this file is part of the Vaucanson project. 00002 // 00003 // Vaucanson, a generic library for finite state machines. 00004 // 00005 // Copyright (C) 2006, 2008 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_INTERNAL_HAS_NEIGHBOUR_HXX 00018 # define VCSN_ALGORITHMS_INTERNAL_HAS_NEIGHBOUR_HXX 00019 00020 # include <vaucanson/algorithms/internal/has_neighbour.hh> 00021 00022 namespace vcsn { 00023 // Determine whether there is at least one neighbour of a state. 00024 00025 template<typename A, typename T> 00026 bool has_successors(const Element<A, T>& a, 00027 const typename automaton_traits<T>::hstate_t s) 00028 { 00029 typedef Element<A, T> automaton_t; 00030 AUTOMATON_TYPES(automaton_t); 00031 precondition (a.has_state (s)); 00032 delta_iterator i(a.value(), s); 00033 return ! i.done(); 00034 } 00035 00036 template<typename A, typename T> 00037 bool has_predecessors(const Element<A, T>& a, 00038 const typename automaton_traits<T>::hstate_t s) 00039 { 00040 typedef Element<A, T> automaton_t; 00041 AUTOMATON_TYPES(automaton_t); 00042 precondition (a.has_state (s)); 00043 rdelta_iterator i(a.value(), s); 00044 return ! i.done(); 00045 } 00046 } // vcsn 00047 00048 #endif // ! VCSN_ALGORITHMS_INTERNAL_HAS_NEIGHBOUR_HXX