Vaucanson  1.4.1
transpose_view.hxx
1 // transpose_view.hxx: 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_AUTOMATA_IMPLEMENTATION_TRANSPOSE_VIEW_HXX
18 # define VCSN_AUTOMATA_IMPLEMENTATION_TRANSPOSE_VIEW_HXX
19 
20 # include <vaucanson/automata/implementation/transpose_view.hh>
21 
22 namespace vcsn {
23 
24 #define AutoType(Type) \
25  typename Element<S, TransposeView<T> >::Type
26 
27  template <class T>
28  TransposeView<T>::TransposeView()
29  {}
30 
31  template <class T>
32  TransposeView<T>::TransposeView(const T& object):
33  IdentityView<T>(object)
34  {}
35 
36  template <class T>
37  TransposeView<T>::TransposeView(T& object):
38  IdentityView<T>(object)
39  {}
40 
41  template <class T>
42  TransposeView<T>::TransposeView(const TransposeView& t):
43  IdentityView<T>(t)
44  {}
45 
46  template <class S, class T>
47  Element<S, TransposeView<T> >
49  {
51  (a.structure(), TransposeView<T>(a.value()));
52  }
53 
54  template <class S, class T>
55  const Element<S, TransposeView<T> >
57  {
59  (a.structure(), TransposeView<T>(a.value()));
60  }
61 
62  template <class S, class T>
63  const typename automaton_traits<T>::tag_t&
64  op_get_tag(const AutomataBase<S>& s, const TransposeView<T>& v)
65  {
66  return op_get_tag(s, v.object());
67  }
68 
69  template <class S, class T>
70  typename automaton_traits<T>::tag_t&
71  op_get_tag(const AutomataBase<S>& s, TransposeView<T>& v)
72  {
73  return op_get_tag(s, v.object());
74  }
75 
76  template <class S, class T>
77  const typename automaton_traits<T>::geometry_t&
78  op_geometry(const AutomataBase<S>& s, const TransposeView<T>& v)
79  {
80  return op_geometry(s, v.object());
81  }
82 
83  template <class S, class T>
84  typename automaton_traits<T>::geometry_t&
85  op_geometry(const AutomataBase<S>& s, TransposeView<T>& v)
86  {
87  return op_geometry(s, v.object());
88  }
89 
90  template <class S, class T>
91  bool
92  op_exists(const AutomataBase<S>& s, const TransposeView<T>& v)
93  {
94  return op_exists(s, v.object());
95  }
96 
97  template <class S, class T>
98  typename automaton_traits<T>::states_t
99  op_states(const AutomataBase<S>& s, const TransposeView<T>& v)
100  {
101  return op_states(s, v.object());
102  }
103 
104  template <class S, class T>
105  typename automaton_traits<T>::transitions_t
106  op_transitions(const AutomataBase<S>& s, const TransposeView<T>& v)
107  {
108  return op_transitions(s, v.object());
109  }
110 
111  template <class S, class T>
112  typename automaton_traits<T>::hstate_t
113  op_add_state(const AutomataBase<S>& s, TransposeView<T>& v)
114  {
115  return op_add_state(s, v.object());
116  }
117 
118  template <class S, class T>
119  typename automaton_traits<T>::hstate_t
120  op_choose_state(const AutomataBase<S>& s, TransposeView<T>& v)
121  {
122  return op_choose_state(s, v.object());
123  }
124 
125  template <class S, class T>
126  typename automaton_traits<T>::htransition_t
127  op_add_transition(const AutomataBase<S>& s, TransposeView<T>& v,
128  const typename automaton_traits<T>::hstate_t& from,
129  const typename automaton_traits<T>::hstate_t& to,
130  const typename Element<S, T>::label_t& label)
131  {
132  return op_add_transition(s, v.object(), from, to, label);
133  }
134 
135  template <class S, class T>
136  typename automaton_traits<T>::htransition_t
137  op_add_series_transition(const AutomataBase<S>& s,
138  TransposeView<T>& v,
139  const typename automaton_traits<T>::hstate_t& from,
140  const typename automaton_traits<T>::hstate_t& to,
141  const typename Element<S, T>::series_set_elt_t& se)
142  {
143  return op_add_series_transition(s, v.object(), from, to, se);
144  }
145 
146  template <class S, class T>
147  typename automaton_traits<T>::htransition_t
148  op_add_spontaneous(const AutomataBase<S>& s, TransposeView<T>& v,
149  const typename automaton_traits<T>::hstate_t& from,
150  const typename automaton_traits<T>::hstate_t& to)
151  {
152  return op_add_spontaneous(s, v.object(), from, to);
153  }
154 
155  template <class S, class T>
156  typename automaton_traits<T>::htransition_t
157  op_add_letter_transition(const AutomataBase<S>& s, TransposeView<T>& v,
158  const typename automaton_traits<T>::hstate_t& from,
159  const typename automaton_traits<T>::hstate_t& to,
160  const typename Element<S, T>::letter_t& e)
161  {
162  return op_add_letter_transition(s, v.object(), from, to, e);
163  }
164 
165  template <class S, class T>
166  void
167  op_update(const AutomataBase<S>& s, TransposeView<T>& v,
168  const typename automaton_traits<T>::htransition_t& e,
169  const AutoType(label_t)& l)
170  {
171  op_update(s, v.object(), e, l);
172  }
173 
174  template <class S, class T>
175  void
176  op_del_state(const AutomataBase<S>& s, TransposeView<T>& v,
177  const typename automaton_traits<T>::hstate_t& st)
178  {
179  op_del_state(s, v.object(), st);
180  }
181 
182  template <class S, class T>
183  void
184  op_del_transition(const AutomataBase<S>& s, TransposeView<T>& v,
185  const typename automaton_traits<T>::htransition_t& e)
186  {
187  op_del_transition(s, v.object(), e);
188  }
189 
190  template <class S, class T>
191  bool
192  op_has_state(const AutomataBase<S>& s,
193  const TransposeView<T>& v,
194  const typename automaton_traits<T>::hstate_t& st)
195  {
196  return op_has_state(s, v.object(), st);
197  }
198 
199  template <class S, class T>
200  bool
201  op_has_transition(const AutomataBase<S>& s,
202  const TransposeView<T>& v,
203  const typename automaton_traits<T>::htransition_t& e)
204  {
205  return op_has_transition(s, v.object(), e);
206  }
207 
208  template <class S, class T>
209  typename Element<S, T>::label_t
210  op_label_of(const AutomataBase<S>& s,
211  const TransposeView<T>& v,
212  const typename automaton_traits<T>::htransition_t& e)
213  {
214  return op_label_of(s, v.object(), e);
215  }
216 
217  template <class S, class T>
218  const typename Element<S, T>::series_set_elt_t
219  op_series_of(const AutomataBase<S>& s,
220  const TransposeView<T>& v,
221  const typename automaton_traits<T>::htransition_t& e)
222  {
223  typename Element<S, T>::series_set_elt_t r =
224  op_series_of(s, v.object(), e);
225  r.transpose();
226  return r;
227  }
228 
229  template <class S, class T>
230  typename Element<S, T>::series_set_elt_value_t
231  op_series_value_of(const AutomataBase<S>& s,
232  const TransposeView<T>& v,
233  const typename automaton_traits<T>::htransition_t& e)
234  {
235  return op_series_value_of(s, v.object(), e);
236  }
237 
238  template <class S, class T>
239  typename Element<S, T>::monoid_elt_t
240  op_word_of(const AutomataBase<S>& s,
241  const TransposeView<T>& v,
242  const typename automaton_traits<T>::htransition_t& e)
243  {
244  return op_word_of(s, v.object(), e);
245  }
246 
247  template <class S, class T>
248  typename Element<S, T>::monoid_elt_value_t
249  op_word_value_of(const AutomataBase<S>& s,
250  const TransposeView<T>& v,
251  const typename automaton_traits<T>::htransition_t& e)
252  {
253  return op_word_value_of(s, v.object(), e);
254  }
255 
256  template <class S, class T>
257  typename Element<S, T>::letter_t
258  op_letter_of(const AutomataBase<S>& s,
259  const TransposeView<T>& v,
260  const typename automaton_traits<T>::htransition_t& e)
261  {
262  return op_letter_of(s, v.object(), e);
263  }
264 
265  template <class S, class T>
266  bool
267  op_is_spontaneous(const AutomataBase<S>& s,
268  const TransposeView<T>& v,
269  const typename automaton_traits<T>::htransition_t& e)
270  {
271  return op_is_spontaneous(s, v.object(), e);
272  }
273 
274  template <class S, class T>
275  typename automaton_traits<TransposeView<T> >::initial_support_t
277  {
278  return op_final(s, v.object());
279  }
280 
281  template <class S, class T>
282  typename automaton_traits<TransposeView<T> >::final_support_t
284  {
285  return op_initial(s, v.object());
286  }
287 
288  template <class S, class T>
289  void
291  const typename automaton_traits<T>::hstate_t& state,
292  const AutoType(series_set_elt_t)& s)
293  {
294  return op_set_final(ss, v.object(), state, s);
295  }
296 
297  template <class S, class T>
298  AutoType(series_set_elt_t)
300  const TransposeView<T>& v,
301  const typename automaton_traits<T>::hstate_t& state)
302  {
303  AutoType(series_set_elt_t) r = op_get_final(s, v.object(), state);
304  r.transpose();
305  return r;
306  }
307 
308  template <class S, class T>
309  void
311  const typename automaton_traits<T>::hstate_t& state,
312  const typename Element<S, T>::series_set_elt_t& s)
313  {
314  op_set_initial(ss, v.object(), state, s);
315  }
316 
317  template <class S, class T>
318  typename Element<S, T>::series_set_elt_t
320  const TransposeView<T>& v,
321  const typename automaton_traits<T>::hstate_t& state)
322  {
323  typename Element<S, T>::series_set_elt_t r = op_get_initial(s, v.object(),
324  state);
325  r.transpose();
326  return r;
327  }
328 
329  template <class S, class T>
330  void
332  {
333  op_clear_final(s, v.object());
334  }
335 
336  template <class S, class T>
337  void
339  {
340  op_clear_initial(s, v.object());
341  }
342 
343  template <class S, class T>
344  typename automaton_traits<T>::hstate_t
346  const TransposeView<T>& v,
347  const typename automaton_traits<T>::htransition_t& e)
348  {
349  return op_dst_of(s, v.object(), e);
350  }
351 
352  template <class S, class T>
353  typename automaton_traits<T>::hstate_t
355  const TransposeView<T>& v,
356  const typename automaton_traits<T>::htransition_t& e)
357  {
358  return op_src_of(s, v.object(), e);
359  }
360 
361 } // vcsn
362 
363 # undef AutoType
364 
365 #endif // ! VCSN_AUTOMATA_IMPLEMENTATION_TRANSPOSE_VIEW_HXX