Vaucanson  1.4.1
has_neighbour.hxx
1 // has_neighbour.hxx: this file is part of the Vaucanson project.
2 //
3 // Vaucanson, a generic library for finite state machines.
4 //
5 // Copyright (C) 2006, 2008 The Vaucanson Group.
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License
9 // as published by the Free Software Foundation; either version 2
10 // of the License, or (at your option) any later version.
11 //
12 // The complete GNU General Public Licence Notice can be found as the
13 // `COPYING' file in the root directory.
14 //
15 // The Vaucanson Group consists of people listed in the `AUTHORS' file.
16 //
17 #ifndef VCSN_ALGORITHMS_INTERNAL_HAS_NEIGHBOUR_HXX
18 # define VCSN_ALGORITHMS_INTERNAL_HAS_NEIGHBOUR_HXX
19 
20 # include <vaucanson/algorithms/internal/has_neighbour.hh>
21 
22 namespace vcsn {
23  // Determine whether there is at least one neighbour of a state.
24 
25  template<typename A, typename T>
27  const typename automaton_traits<T>::hstate_t s)
28  {
29  typedef Element<A, T> automaton_t;
30  AUTOMATON_TYPES(automaton_t);
31  precondition (a.has_state (s));
32  delta_iterator i(a.value(), s);
33  return ! i.done();
34  }
35 
36  template<typename A, typename T>
38  const typename automaton_traits<T>::hstate_t s)
39  {
40  typedef Element<A, T> automaton_t;
41  AUTOMATON_TYPES(automaton_t);
42  precondition (a.has_state (s));
43  rdelta_iterator i(a.value(), s);
44  return ! i.done();
45  }
46 } // vcsn
47 
48 #endif // ! VCSN_ALGORITHMS_INTERNAL_HAS_NEIGHBOUR_HXX