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
00111 #define AutoType(Type) \
00112 typename Element<S, TransposeView<T> >::Type
00113
00115
00116 template <class S, class T>
00117 typename automaton_traits<TransposeView<T> >::initial_support_t
00118 op_initial(const AutomataBase<S>&, const TransposeView<T>&);
00119
00120 template <class S, class T>
00121 typename automaton_traits<TransposeView<T> >::final_support_t
00122 op_final(const AutomataBase<S>&, const TransposeView<T>&);
00123
00124 template <class S, class T>
00125 void
00126 op_set_initial(const AutomataBase<S>&, TransposeView<T>&,
00127 const typename automaton_traits<T>::hstate_t& state,
00128 const AutoType(series_set_elt_t)& s);
00129
00130 template <class S, class T>
00131 AutoType(series_set_elt_t)
00132 op_get_initial(const AutomataBase<S>&,
00133 const TransposeView<T>&,
00134 const typename automaton_traits<T>::hstate_t&);
00135
00136 template <class S, class T>
00137 void
00138 op_set_final(const AutomataBase<S>&, TransposeView<T>&,
00139 const typename automaton_traits<T>::hstate_t& state,
00140 const typename Element<S, T>::series_set_elt_t& s);
00141
00142 template <class S, class T>
00143 typename Element<S, T>::series_set_elt_t
00144 op_get_final(const AutomataBase<S>&,
00145 const TransposeView<T>&,
00146 const typename automaton_traits<T>::hstate_t& state);
00147
00148 template <class S, class T>
00149 void
00150 op_clear_initial(const AutomataBase<S>&, TransposeView<T>&);
00151
00152 template <class S, class T>
00153 void
00154 op_clear_final(const AutomataBase<S>&, TransposeView<T>&);
00155
00156 template <class S, class T>
00157 typename automaton_traits<T>::hstate_t
00158 op_src_of(const AutomataBase<S>&, const TransposeView<T>&,
00159 const typename automaton_traits<T>::htransition_t&);
00160
00161 template <class S, class T>
00162 typename automaton_traits<T>::hstate_t
00163 op_dst_of(const AutomataBase<S>&, const TransposeView<T>&,
00164 const typename automaton_traits<T>::htransition_t&);
00165
00168
00169
00170
00171
00173 template <class S, class T,
00174 typename OutputIterator>
00175 void op_delta(const AutomataBase<S>&, const TransposeView<T>&,
00176 OutputIterator res,
00177 const typename automaton_traits<T>::hstate_t& from,
00178 delta_kind::transitions k);
00179
00186 template <class S, class T,
00187 typename OutputIterator, typename L>
00188 void op_delta(const AutomataBase<S>&, const TransposeView<T>&,
00189 OutputIterator res,
00190 const typename automaton_traits<T>::hstate_t& from,
00191 const L& query,
00192 delta_kind::transitions k);
00193
00200 template <class S, class T,
00201 typename OutputIterator, typename L>
00202 void op_letter_delta(const AutomataBase<S>&, const TransposeView<T>&,
00203 OutputIterator res,
00204 const typename automaton_traits<T>::hstate_t& from,
00205 const L& letter,
00206 delta_kind::transitions k);
00207
00209 template <class S, class T,
00210 typename OutputIterator>
00211 void op_spontaneous_delta(const AutomataBase<S>&, const TransposeView<T>&,
00212 OutputIterator res,
00213 const typename automaton_traits<T>::hstate_t& from,
00214 delta_kind::transitions k);
00215
00216
00217
00218
00219
00221 template <class S, class T,
00222 typename Container>
00223 void op_deltac(const AutomataBase<S>&, const TransposeView<T>&,
00224 Container& res, const typename automaton_traits<T>::hstate_t& from, delta_kind::transitions k);
00225
00232 template <class S, class T,
00233 typename Container, typename L>
00234 void op_deltac(const AutomataBase<S>&, const TransposeView<T>&,
00235 Container& res,
00236 const typename automaton_traits<T>::hstate_t& from,
00237 const L& query,
00238 delta_kind::transitions k);
00239
00246 template <class S, class T,
00247 typename Container, typename L>
00248 void op_letter_deltac(const AutomataBase<S>&, const TransposeView<T>&,
00249 Container& res,
00250 const typename automaton_traits<T>::hstate_t& from,
00251 const L& letter,
00252 delta_kind::transitions k);
00253
00255 template <class S, class T, class Container>
00256 void op_spontaneous_deltac(const AutomataBase<S>&, const TransposeView<T>&,
00257 Container& res,
00258 const typename automaton_traits<T>::hstate_t& from,
00259 delta_kind::transitions k);
00260
00261
00262
00263
00264
00270 template<class S, class T, typename OutputIterator>
00271 void op_delta(const AutomataBase<S>&, const TransposeView<T>&,
00272 OutputIterator res,
00273 const typename automaton_traits<T>::hstate_t& from,
00274 delta_kind::states k);
00275
00282 template<class S, class T, typename OutputIterator, typename L>
00283 void op_delta(const AutomataBase<S>&, const TransposeView<T>&,
00284 OutputIterator res,
00285 const typename automaton_traits<T>::hstate_t& from,
00286 const L& query,
00287 delta_kind::states k);
00288
00295 template<class S, class T, typename OutputIterator, typename L>
00296 void op_letter_delta(const AutomataBase<S>&, const TransposeView<T>&,
00297 OutputIterator res,
00298 const typename automaton_traits<T>::hstate_t& from,
00299 const L& letter,
00300 delta_kind::states k);
00301
00303 template<class S, class T, typename OutputIterator>
00304 void op_spontaneous_delta(const AutomataBase<S>&, const TransposeView<T>&,
00305 OutputIterator res,
00306 const typename automaton_traits<T>::hstate_t& from,
00307 delta_kind::states k);
00308
00309
00310
00311
00312
00319 template<class S, class T, typename Container>
00320 void op_deltac(const AutomataBase<S>&, const TransposeView<T>&,
00321 Container& res, const typename automaton_traits<T>::hstate_t& from, delta_kind::states k);
00322
00329 template<class S, class T, typename Container, typename L>
00330 void op_deltac(const AutomataBase<S>&, const TransposeView<T>&,
00331 Container& res,
00332 const typename automaton_traits<T>::hstate_t& from,
00333 const L& query,
00334 delta_kind::states k);
00335
00342 template<class S, class T, typename Container, typename L>
00343 void op_letter_deltac(const AutomataBase<S>&, const TransposeView<T>&,
00344 Container& res,
00345 const typename automaton_traits<T>::hstate_t& from,
00346 const L& letter,
00347 delta_kind::states k);
00348
00350 template<class S, class T, typename Container>
00351 void op_spontaneous_deltac(const AutomataBase<S>&, const TransposeView<T>&,
00352 Container& res,
00353 const typename automaton_traits<T>::hstate_t& from,
00354 delta_kind::states k);
00355
00356
00357
00358
00359
00365 template<class S, class T, typename OutputIterator>
00366 void op_rdelta(const AutomataBase<S>&, const TransposeView<T>&,
00367 OutputIterator res,
00368 const typename automaton_traits<T>::hstate_t& from,
00369 delta_kind::transitions k);
00370
00377 template<class S, class T, typename OutputIterator, typename L>
00378 void op_rdelta(const AutomataBase<S>&, const TransposeView<T>&,
00379 OutputIterator res,
00380 const typename automaton_traits<T>::hstate_t& from,
00381 const L& query,
00382 delta_kind::transitions k);
00383
00390 template<class S, class T, typename OutputIterator, typename L>
00391 void op_letter_rdelta(const AutomataBase<S>&, const TransposeView<T>&,
00392 OutputIterator res,
00393 const typename automaton_traits<T>::hstate_t& from,
00394 const L& letter,
00395 delta_kind::transitions k);
00396
00398 template<class S, class T, typename OutputIterator>
00399 void op_spontaneous_rdelta(const AutomataBase<S>&, const TransposeView<T>&,
00400 OutputIterator res,
00401 const typename automaton_traits<T>::hstate_t& from,
00402 delta_kind::transitions k);
00403
00404
00405
00406
00407
00413 template<class S, class T, typename Container>
00414 void op_rdeltac(const AutomataBase<S>&, const TransposeView<T>&,
00415 Container& res, const typename automaton_traits<T>::hstate_t& from, delta_kind::transitions k);
00416
00423 template<class S, class T, typename Container, typename L>
00424 void op_rdeltac(const AutomataBase<S>&, const TransposeView<T>&,
00425 Container& res,
00426 const typename automaton_traits<T>::hstate_t& from,
00427 const L& query,
00428 delta_kind::transitions k);
00429
00436 template<class S, class T, typename Container, typename L>
00437 void op_letter_rdeltac(const AutomataBase<S>&, const TransposeView<T>&,
00438 Container& res,
00439 const typename automaton_traits<T>::hstate_t& from,
00440 const L& letter,
00441 delta_kind::transitions k);
00442
00444 template<class S, class T, typename Container>
00445 void op_spontaneous_rdeltac(const AutomataBase<S>&, const TransposeView<T>&,
00446 Container& res,
00447 const typename automaton_traits<T>::hstate_t& from,
00448 delta_kind::transitions k);
00449
00450
00451
00452
00453
00455 template<class S, class T, typename OutputIterator>
00456 void op_rdelta(const AutomataBase<S>&, const TransposeView<T>&,
00457 OutputIterator res,
00458 const typename automaton_traits<T>::hstate_t& from,
00459 delta_kind::states k);
00460
00467 template<class S, class T, typename OutputIterator, typename L>
00468 void op_rdelta(const AutomataBase<S>&, const TransposeView<T>&,
00469 OutputIterator res,
00470 const typename automaton_traits<T>::hstate_t& from,
00471 const L& query,
00472 delta_kind::states k);
00473
00480 template<class S, class T, typename OutputIterator, typename L>
00481 void op_letter_rdelta(const AutomataBase<S>&, const TransposeView<T>&,
00482 OutputIterator res,
00483 const typename automaton_traits<T>::hstate_t& from,
00484 const L& letter,
00485 delta_kind::states k);
00486
00488 template<class S, class T, typename OutputIterator>
00489 void op_spontaneous_rdelta(const AutomataBase<S>&, const TransposeView<T>&,
00490 OutputIterator res,
00491 const typename automaton_traits<T>::hstate_t& from,
00492 delta_kind::states k);
00493
00494
00495
00496
00497
00504 template<class S, class T, typename Container>
00505 void op_rdeltac(const AutomataBase<S>&, const TransposeView<T>&,
00506 Container& res, const typename automaton_traits<T>::hstate_t& from, delta_kind::states k);
00507
00514 template<class S, class T, typename Container, typename L>
00515 void op_rdeltac(const AutomataBase<S>&, const TransposeView<T>&,
00516 Container& res,
00517 const typename automaton_traits<T>::hstate_t& from,
00518 const L& query,
00519 delta_kind::states k);
00520
00527 template<class S, class T, typename Container, typename L>
00528 void op_letter_rdeltac(const AutomataBase<S>&, const TransposeView<T>&,
00529 Container& res,
00530 const typename automaton_traits<T>::hstate_t& from,
00531 const L& letter,
00532 delta_kind::states k);
00533
00535 template<class S, class T, typename Container>
00536 void op_spontaneous_rdeltac(const AutomataBase<S>&, const TransposeView<T>&,
00537 Container& res,
00538 const typename automaton_traits<T>::hstate_t& from,
00539 delta_kind::states k);
00540
00541 }
00542
00543 # undef AutoType
00544
00545
00546 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00547 # include <vaucanson/automata/implementation/transpose_view.hxx>
00548 #endif // VCSN_USE_INTERFACE_ONLY
00549
00550
00551 #endif // ! VCSN_AUTOMATA_IMPLEMENTATION_TRANSPOSE_VIEW_HH