00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef VCSN_AUTOMATA_IMPLEMENTATION_TRANSPOSE_VIEW_HH
00018 # define VCSN_AUTOMATA_IMPLEMENTATION_TRANSPOSE_VIEW_HH
00019
00020 # include <vaucanson/automata/implementation/automaton_view.hh>
00021 # include <vaucanson/design_pattern/predecls.hh>
00022
00023 namespace vcsn {
00024
00035 template <class T>
00036 struct TransposeView : public IdentityView<T>
00037 {
00038 TransposeView();
00039 TransposeView(const T&);
00040 TransposeView(T&);
00041 TransposeView(const TransposeView&);
00042 };
00043
00045
00046 template <class T>
00047 struct transpose_traits
00048 {
00049 typedef undefined_type type;
00050 };
00051
00052 template <class S, class T>
00053 struct transpose_traits<Element<S, T> >
00054 {
00055 typedef Element<S, TransposeView<T> > type;
00056 };
00065 template <class S, class T>
00066 Element<S, TransposeView<T> >
00067 transpose_view(Element<S, T>&);
00068
00069 template <class S, class T>
00070 const Element<S, TransposeView<T> >
00071 transpose_view(const Element<S, T>&);
00074
00075 template <typename T>
00076 struct automaton_traits<TransposeView<T> >
00077 {
00078 typedef typename automaton_traits<T>::label_t label_t;
00079 typedef typename automaton_traits<T>::series_set_elt_value_t
00080 series_set_elt_value_t;
00081 typedef typename automaton_traits<T>::word_value_t word_value_t;
00082 typedef typename automaton_traits<T>::semiring_elt_value_t
00083 semiring_elt_value_t;
00084 typedef typename automaton_traits<T>::letter_t letter_t;
00085 typedef typename automaton_traits<T>::tag_t tag_t;
00086 typedef typename automaton_traits<T>::states_t states_t;
00087
00088 typedef typename automaton_traits<T>::state_iterator
00089 state_iterator;
00090 typedef typename automaton_traits<T>::transitions_t transitions_t;
00091
00092 typedef typename automaton_traits<T>::transition_iterator transition_iterator;
00093 typedef typename automaton_traits<T>::initial_t initial_t;
00094 typedef typename automaton_traits<T>::initial_iterator
00095 initial_iterator;
00096 typedef typename automaton_traits<T>::initial_support_t
00097 initial_support_t;
00098 typedef typename automaton_traits<T>::final_t final_t;
00099 typedef typename automaton_traits<T>::final_iterator
00100 final_iterator;
00101 typedef typename automaton_traits<T>::final_support_t
00102 final_support_t;
00103 typedef typename automaton_traits<T>::geometry_t geometry_t;
00104 typedef typename automaton_traits<T>::geometry_t::coords_t geometry_coords_t;
00105
00106
00107 typedef typename automaton_traits<T>::hstate_t hstate_t;
00108 typedef typename automaton_traits<T>::htransition_t htransition_t;
00109
00110 typedef typename automaton_traits<T>::delta_state_iterator delta_state_iterator;
00111 typedef typename automaton_traits<T>::delta_transition_iterator delta_transition_iterator;
00112 typedef typename automaton_traits<T>::rdelta_state_iterator rdelta_state_iterator;
00113 typedef typename automaton_traits<T>::rdelta_transition_iterator rdelta_transition_iterator;
00114 };
00115
00116 #define AutoType(Type) \
00117 typename Element<S, TransposeView<T> >::Type
00118
00120
00121 template <class S, class T>
00122 typename automaton_traits<TransposeView<T> >::initial_support_t
00123 op_initial(const AutomataBase<S>&, const TransposeView<T>&);
00124
00125 template <class S, class T>
00126 typename automaton_traits<TransposeView<T> >::final_support_t
00127 op_final(const AutomataBase<S>&, const TransposeView<T>&);
00128
00129 template <class S, class T>
00130 void
00131 op_set_initial(const AutomataBase<S>&, TransposeView<T>&,
00132 const typename automaton_traits<T>::hstate_t& state,
00133 const AutoType(series_set_elt_t)& s);
00134
00135 template <class S, class T>
00136 AutoType(series_set_elt_t)
00137 op_get_initial(const AutomataBase<S>&,
00138 const TransposeView<T>&,
00139 const typename automaton_traits<T>::hstate_t&);
00140
00141 template <class S, class T>
00142 void
00143 op_set_final(const AutomataBase<S>&, TransposeView<T>&,
00144 const typename automaton_traits<T>::hstate_t& state,
00145 const typename Element<S, T>::series_set_elt_t& s);
00146
00147 template <class S, class T>
00148 typename Element<S, T>::series_set_elt_t
00149 op_get_final(const AutomataBase<S>&,
00150 const TransposeView<T>&,
00151 const typename automaton_traits<T>::hstate_t& state);
00152
00153 template <class S, class T>
00154 void
00155 op_clear_initial(const AutomataBase<S>&, TransposeView<T>&);
00156
00157 template <class S, class T>
00158 void
00159 op_clear_final(const AutomataBase<S>&, TransposeView<T>&);
00160
00161 template <class S, class T>
00162 typename automaton_traits<T>::hstate_t
00163 op_src_of(const AutomataBase<S>&, const TransposeView<T>&,
00164 const typename automaton_traits<T>::htransition_t&);
00165
00166 template <class S, class T>
00167 typename automaton_traits<T>::hstate_t
00168 op_dst_of(const AutomataBase<S>&, const TransposeView<T>&,
00169 const typename automaton_traits<T>::htransition_t&);
00170
00173
00174
00175
00176
00178 template <class S, class T,
00179 typename OutputIterator>
00180 void op_delta(const AutomataBase<S>&, const TransposeView<T>&,
00181 OutputIterator res,
00182 const typename automaton_traits<T>::hstate_t& from,
00183 delta_kind::transitions k);
00184
00191 template <class S, class T,
00192 typename OutputIterator, typename L>
00193 void op_delta(const AutomataBase<S>&, const TransposeView<T>&,
00194 OutputIterator res,
00195 const typename automaton_traits<T>::hstate_t& from,
00196 const L& query,
00197 delta_kind::transitions k);
00198
00205 template <class S, class T,
00206 typename OutputIterator, typename L>
00207 void op_letter_delta(const AutomataBase<S>&, const TransposeView<T>&,
00208 OutputIterator res,
00209 const typename automaton_traits<T>::hstate_t& from,
00210 const L& letter,
00211 delta_kind::transitions k);
00212
00214 template <class S, class T,
00215 typename OutputIterator>
00216 void op_spontaneous_delta(const AutomataBase<S>&, const TransposeView<T>&,
00217 OutputIterator res,
00218 const typename automaton_traits<T>::hstate_t& from,
00219 delta_kind::transitions k);
00220
00221
00222
00223
00224
00226 template <class S, class T,
00227 typename Container>
00228 void op_deltac(const AutomataBase<S>&, const TransposeView<T>&,
00229 Container& res, const typename automaton_traits<T>::hstate_t& from, delta_kind::transitions k);
00230
00237 template <class S, class T,
00238 typename Container, typename L>
00239 void op_deltac(const AutomataBase<S>&, const TransposeView<T>&,
00240 Container& res,
00241 const typename automaton_traits<T>::hstate_t& from,
00242 const L& query,
00243 delta_kind::transitions k);
00244
00251 template <class S, class T,
00252 typename Container, typename L>
00253 void op_letter_deltac(const AutomataBase<S>&, const TransposeView<T>&,
00254 Container& res,
00255 const typename automaton_traits<T>::hstate_t& from,
00256 const L& letter,
00257 delta_kind::transitions k);
00258
00260 template <class S, class T, class Container>
00261 void op_spontaneous_deltac(const AutomataBase<S>&, const TransposeView<T>&,
00262 Container& res,
00263 const typename automaton_traits<T>::hstate_t& from,
00264 delta_kind::transitions k);
00265
00266
00267
00268
00269
00275 template<class S, class T, typename OutputIterator>
00276 void op_delta(const AutomataBase<S>&, const TransposeView<T>&,
00277 OutputIterator res,
00278 const typename automaton_traits<T>::hstate_t& from,
00279 delta_kind::states k);
00280
00287 template<class S, class T, typename OutputIterator, typename L>
00288 void op_delta(const AutomataBase<S>&, const TransposeView<T>&,
00289 OutputIterator res,
00290 const typename automaton_traits<T>::hstate_t& from,
00291 const L& query,
00292 delta_kind::states k);
00293
00300 template<class S, class T, typename OutputIterator, typename L>
00301 void op_letter_delta(const AutomataBase<S>&, const TransposeView<T>&,
00302 OutputIterator res,
00303 const typename automaton_traits<T>::hstate_t& from,
00304 const L& letter,
00305 delta_kind::states k);
00306
00308 template<class S, class T, typename OutputIterator>
00309 void op_spontaneous_delta(const AutomataBase<S>&, const TransposeView<T>&,
00310 OutputIterator res,
00311 const typename automaton_traits<T>::hstate_t& from,
00312 delta_kind::states k);
00313
00314
00315
00316
00317
00324 template<class S, class T, typename Container>
00325 void op_deltac(const AutomataBase<S>&, const TransposeView<T>&,
00326 Container& res, const typename automaton_traits<T>::hstate_t& from, delta_kind::states k);
00327
00334 template<class S, class T, typename Container, typename L>
00335 void op_deltac(const AutomataBase<S>&, const TransposeView<T>&,
00336 Container& res,
00337 const typename automaton_traits<T>::hstate_t& from,
00338 const L& query,
00339 delta_kind::states k);
00340
00347 template<class S, class T, typename Container, typename L>
00348 void op_letter_deltac(const AutomataBase<S>&, const TransposeView<T>&,
00349 Container& res,
00350 const typename automaton_traits<T>::hstate_t& from,
00351 const L& letter,
00352 delta_kind::states k);
00353
00355 template<class S, class T, typename Container>
00356 void op_spontaneous_deltac(const AutomataBase<S>&, const TransposeView<T>&,
00357 Container& res,
00358 const typename automaton_traits<T>::hstate_t& from,
00359 delta_kind::states k);
00360
00361
00362
00363
00364
00370 template<class S, class T, typename OutputIterator>
00371 void op_rdelta(const AutomataBase<S>&, const TransposeView<T>&,
00372 OutputIterator res,
00373 const typename automaton_traits<T>::hstate_t& from,
00374 delta_kind::transitions k);
00375
00382 template<class S, class T, typename OutputIterator, typename L>
00383 void op_rdelta(const AutomataBase<S>&, const TransposeView<T>&,
00384 OutputIterator res,
00385 const typename automaton_traits<T>::hstate_t& from,
00386 const L& query,
00387 delta_kind::transitions k);
00388
00395 template<class S, class T, typename OutputIterator, typename L>
00396 void op_letter_rdelta(const AutomataBase<S>&, const TransposeView<T>&,
00397 OutputIterator res,
00398 const typename automaton_traits<T>::hstate_t& from,
00399 const L& letter,
00400 delta_kind::transitions k);
00401
00403 template<class S, class T, typename OutputIterator>
00404 void op_spontaneous_rdelta(const AutomataBase<S>&, const TransposeView<T>&,
00405 OutputIterator res,
00406 const typename automaton_traits<T>::hstate_t& from,
00407 delta_kind::transitions k);
00408
00409
00410
00411
00412
00418 template<class S, class T, typename Container>
00419 void op_rdeltac(const AutomataBase<S>&, const TransposeView<T>&,
00420 Container& res, const typename automaton_traits<T>::hstate_t& from, delta_kind::transitions k);
00421
00428 template<class S, class T, typename Container, typename L>
00429 void op_rdeltac(const AutomataBase<S>&, const TransposeView<T>&,
00430 Container& res,
00431 const typename automaton_traits<T>::hstate_t& from,
00432 const L& query,
00433 delta_kind::transitions k);
00434
00441 template<class S, class T, typename Container, typename L>
00442 void op_letter_rdeltac(const AutomataBase<S>&, const TransposeView<T>&,
00443 Container& res,
00444 const typename automaton_traits<T>::hstate_t& from,
00445 const L& letter,
00446 delta_kind::transitions k);
00447
00449 template<class S, class T, typename Container>
00450 void op_spontaneous_rdeltac(const AutomataBase<S>&, const TransposeView<T>&,
00451 Container& res,
00452 const typename automaton_traits<T>::hstate_t& from,
00453 delta_kind::transitions k);
00454
00455
00456
00457
00458
00460 template<class S, class T, typename OutputIterator>
00461 void op_rdelta(const AutomataBase<S>&, const TransposeView<T>&,
00462 OutputIterator res,
00463 const typename automaton_traits<T>::hstate_t& from,
00464 delta_kind::states k);
00465
00472 template<class S, class T, typename OutputIterator, typename L>
00473 void op_rdelta(const AutomataBase<S>&, const TransposeView<T>&,
00474 OutputIterator res,
00475 const typename automaton_traits<T>::hstate_t& from,
00476 const L& query,
00477 delta_kind::states k);
00478
00485 template<class S, class T, typename OutputIterator, typename L>
00486 void op_letter_rdelta(const AutomataBase<S>&, const TransposeView<T>&,
00487 OutputIterator res,
00488 const typename automaton_traits<T>::hstate_t& from,
00489 const L& letter,
00490 delta_kind::states k);
00491
00493 template<class S, class T, typename OutputIterator>
00494 void op_spontaneous_rdelta(const AutomataBase<S>&, const TransposeView<T>&,
00495 OutputIterator res,
00496 const typename automaton_traits<T>::hstate_t& from,
00497 delta_kind::states k);
00498
00499
00500
00501
00502
00509 template<class S, class T, typename Container>
00510 void op_rdeltac(const AutomataBase<S>&, const TransposeView<T>&,
00511 Container& res, const typename automaton_traits<T>::hstate_t& from, delta_kind::states k);
00512
00519 template<class S, class T, typename Container, typename L>
00520 void op_rdeltac(const AutomataBase<S>&, const TransposeView<T>&,
00521 Container& res,
00522 const typename automaton_traits<T>::hstate_t& from,
00523 const L& query,
00524 delta_kind::states k);
00525
00532 template<class S, class T, typename Container, typename L>
00533 void op_letter_rdeltac(const AutomataBase<S>&, const TransposeView<T>&,
00534 Container& res,
00535 const typename automaton_traits<T>::hstate_t& from,
00536 const L& letter,
00537 delta_kind::states k);
00538
00540 template<class S, class T, typename Container>
00541 void op_spontaneous_rdeltac(const AutomataBase<S>&, const TransposeView<T>&,
00542 Container& res,
00543 const typename automaton_traits<T>::hstate_t& from,
00544 delta_kind::states k);
00545
00546 }
00547
00548 # undef AutoType
00549
00550
00551 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00552 # include <vaucanson/automata/implementation/transpose_view.hxx>
00553 #endif // VCSN_USE_INTERFACE_ONLY
00554
00555
00556 #endif // ! VCSN_AUTOMATA_IMPLEMENTATION_TRANSPOSE_VIEW_HH