Vaucanson  1.4.1
skeleton.hh
Go to the documentation of this file.
1 // skeleton.hh: this file is part of the Vaucanson project.
2 //
3 // Vaucanson, a generic library for finite state machines.
4 //
5 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 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_SKELETON_HH
18 # define VCSN_ALGORITHMS_INTERNAL_SKELETON_HH
19 
30 # include <vaucanson/automata/concept/automata_base.hh>
31 # include <vaucanson/misc/usual_macros.hh>
32 # include <vector>
33 
34 
35 namespace vcsn
36 {
37  // "Skeleton" of an automaton, consisting of a numbering of states
38  // and transitions by means of vectors. Additional auxiliary vectors are
39  // not used in this file.
40  template<typename A, typename T>
41  class Skeleton
42  {
43  public:
44 
45  Skeleton(const Element<A, T>& x);
46 
47  const Element<A, T>& a;
48 
49  // Vector of states. Each states can be also represented by its
50  // index.
51  std::vector<typename T::hstate_t> states;
52  // Vector of transitions. Each transition can be also
53  // represented by its index.
54  std::vector<typename T::htransition_t> transitions;
55  std::vector<int> src_transitions;
56  std::vector<int> dst_transitions;
57 
58  // List of indices of ingoing transitions in lex. order of each state
59  std::vector< std::list<int> > delta_in;
60  // List of indices of outgoing transitions in lex. order of each state
61  std::vector< std::list<int> > delta_out;
62 
63 
64  // Indices of initial and final states
65  std::list<int> I, F;
66  // Index in labels of the label of each transition
67  std::vector<int> transitions_labels;
68  // (transitions_labels[i] = index of label of transition i) Auxiliary data
69  std::vector<int> aux_states_int;
70  std::vector<bool> aux_states_bool;
71  std::vector<void*> aux_states_generic;
72  std::vector<int> aux_transitions_int;
73  std::vector<bool> aux_transitions_bool;
74  std::vector<void*> aux_transitions_generic;
75 
76  void reserve_aux_states_int();
77  void reserve_aux_states_bool();
78  void reserve_aux_states_generic();
79  void reserve_aux_transitions_int();
80  void reserve_aux_transitions_bool();
81  void reserve_aux_transitions_generic();
82  };
83 
84 } // vcsn
85 
86 # if !defined VCSN_USE_INTERFACE_ONLY && !defined VCSN_USE_LIB
87 # include <vaucanson/algorithms/internal/skeleton.hxx>
88 # endif // VCSN_USE_INTERFACE_ONLY
89 
90 #endif // ! VCSN_ALGORITHMS_INTERNAL_SKELETON_HH