00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef VCSN_AUTOMATA_IMPLEMENTATION_TRANSPOSE_VIEW_HXX
00018 # define VCSN_AUTOMATA_IMPLEMENTATION_TRANSPOSE_VIEW_HXX
00019
00020 # include <vaucanson/automata/implementation/transpose_view.hh>
00021
00022 namespace vcsn {
00023
00024 #define AutoType(Type) \
00025 typename Element<S, TransposeView<T> >::Type
00026
00027 template <class T>
00028 TransposeView<T>::TransposeView()
00029 {}
00030
00031 template <class T>
00032 TransposeView<T>::TransposeView(const T& object):
00033 IdentityView<T>(object)
00034 {}
00035
00036 template <class T>
00037 TransposeView<T>::TransposeView(T& object):
00038 IdentityView<T>(object)
00039 {}
00040
00041 template <class T>
00042 TransposeView<T>::TransposeView(const TransposeView& t):
00043 IdentityView<T>(t)
00044 {}
00045
00046 template <class S, class T>
00047 Element<S, TransposeView<T> >
00048 transpose_view(Element<S, T>& a)
00049 {
00050 return Element<S, TransposeView<T> >
00051 (a.structure(), TransposeView<T>(a.value()));
00052 }
00053
00054 template <class S, class T>
00055 const Element<S, TransposeView<T> >
00056 transpose_view(const Element<S, T>& a)
00057 {
00058 return Element<S, TransposeView<T> >
00059 (a.structure(), TransposeView<T>(a.value()));
00060 }
00061
00062 template <class S, class T>
00063 const typename automaton_traits<T>::tag_t&
00064 op_get_tag(const AutomataBase<S>& s, const TransposeView<T>& v)
00065 {
00066 return op_get_tag(s, v.object());
00067 }
00068
00069 template <class S, class T>
00070 typename automaton_traits<T>::tag_t&
00071 op_get_tag(const AutomataBase<S>& s, TransposeView<T>& v)
00072 {
00073 return op_get_tag(s, v.object());
00074 }
00075
00076 template <class S, class T>
00077 const typename automaton_traits<T>::geometry_t&
00078 op_get_geometry(const AutomataBase<S>& s, const TransposeView<T>& v)
00079 {
00080 return op_get_geometry(s, v.object());
00081 }
00082
00083 template <class S, class T>
00084 typename automaton_traits<T>::geometry_t&
00085 op_get_geometry(const AutomataBase<S>& s, TransposeView<T>& v)
00086 {
00087 return op_get_geometry(s, v.object());
00088 }
00089
00090 template <class S, class T>
00091 bool
00092 op_exists(const AutomataBase<S>& s, const TransposeView<T>& v)
00093 {
00094 return op_exists(s, v.object());
00095 }
00096
00097 template <class S, class T>
00098 typename automaton_traits<T>::states_t
00099 op_states(const AutomataBase<S>& s, const TransposeView<T>& v)
00100 {
00101 return op_states(s, v.object());
00102 }
00103
00104 template <class S, class T>
00105 typename automaton_traits<T>::transitions_t
00106 op_transitions(const AutomataBase<S>& s, const TransposeView<T>& v)
00107 {
00108 return op_transitions(s, v.object());
00109 }
00110
00111 template <class S, class T>
00112 typename automaton_traits<T>::hstate_t
00113 op_add_state(const AutomataBase<S>& s, TransposeView<T>& v)
00114 {
00115 return op_add_state(s, v.object());
00116 }
00117
00118 template <class S, class T>
00119 typename automaton_traits<T>::hstate_t
00120 op_choose_state(const AutomataBase<S>& s, TransposeView<T>& v)
00121 {
00122 return op_choose_state(s, v.object());
00123 }
00124
00125 template <class S, class T>
00126 typename automaton_traits<T>::htransition_t
00127 op_add_transition(const AutomataBase<S>& s, TransposeView<T>& v,
00128 const typename automaton_traits<T>::hstate_t& from,
00129 const typename automaton_traits<T>::hstate_t& to,
00130 const typename Element<S, T>::label_t& label)
00131 {
00132 return op_add_transition(s, v.object(), from, to, label);
00133 }
00134
00135 template <class S, class T>
00136 typename automaton_traits<T>::htransition_t
00137 op_add_series_transition(const AutomataBase<S>& s,
00138 TransposeView<T>& v,
00139 const typename automaton_traits<T>::hstate_t& from,
00140 const typename automaton_traits<T>::hstate_t& to,
00141 const typename Element<S, T>::series_set_elt_t& se)
00142 {
00143 return op_add_series_transition(s, v.object(), from, to, se);
00144 }
00145
00146 template <class S, class T>
00147 typename automaton_traits<T>::htransition_t
00148 op_add_spontaneous(const AutomataBase<S>& s, TransposeView<T>& v,
00149 const typename automaton_traits<T>::hstate_t& from,
00150 const typename automaton_traits<T>::hstate_t& to)
00151 {
00152 return op_add_spontaneous(s, v.object(), from, to);
00153 }
00154
00155 template <class S, class T>
00156 typename automaton_traits<T>::htransition_t
00157 op_add_letter_transition(const AutomataBase<S>& s, TransposeView<T>& v,
00158 const typename automaton_traits<T>::hstate_t& from,
00159 const typename automaton_traits<T>::hstate_t& to,
00160 const typename Element<S, T>::letter_t& e)
00161 {
00162 return op_add_letter_transition(s, v.object(), from, to, e);
00163 }
00164
00165 template <class S, class T>
00166 void
00167 op_update(const AutomataBase<S>& s, TransposeView<T>& v,
00168 const typename automaton_traits<T>::htransition_t& e,
00169 const AutoType(label_t)& l)
00170 {
00171 op_update(s, v.object(), e, l);
00172 }
00173
00174 template <class S, class T>
00175 void
00176 op_del_state(const AutomataBase<S>& s, TransposeView<T>& v,
00177 const typename automaton_traits<T>::hstate_t& st)
00178 {
00179 op_del_state(s, v.object(), st);
00180 }
00181
00182 template <class S, class T>
00183 void
00184 op_del_transition(const AutomataBase<S>& s, TransposeView<T>& v,
00185 const typename automaton_traits<T>::htransition_t& e)
00186 {
00187 op_del_transition(s, v.object(), e);
00188 }
00189
00190 template <class S, class T>
00191 bool
00192 op_has_state(const AutomataBase<S>& s,
00193 const TransposeView<T>& v,
00194 const typename automaton_traits<T>::hstate_t& st)
00195 {
00196 return op_has_state(s, v.object(), st);
00197 }
00198
00199 template <class S, class T>
00200 bool
00201 op_has_transition(const AutomataBase<S>& s,
00202 const TransposeView<T>& v,
00203 const typename automaton_traits<T>::htransition_t& e)
00204 {
00205 return op_has_transition(s, v.object(), e);
00206 }
00207
00208 template <class S, class T>
00209 typename Element<S, T>::label_t
00210 op_label_of(const AutomataBase<S>& s,
00211 const TransposeView<T>& v,
00212 const typename automaton_traits<T>::htransition_t& e)
00213 {
00214 return op_label_of(s, v.object(), e);
00215 }
00216
00217 template <class S, class T>
00218 const typename Element<S, T>::series_set_elt_t
00219 op_series_of(const AutomataBase<S>& s,
00220 const TransposeView<T>& v,
00221 const typename automaton_traits<T>::htransition_t& e)
00222 {
00223 typename Element<S, T>::series_set_elt_t r =
00224 op_series_of(s, v.object(), e);
00225 r.transpose();
00226 return r;
00227 }
00228
00229 template <class S, class T>
00230 typename Element<S, T>::series_set_elt_value_t
00231 op_series_value_of(const AutomataBase<S>& s,
00232 const TransposeView<T>& v,
00233 const typename automaton_traits<T>::htransition_t& e)
00234 {
00235 return op_series_value_of(s, v.object(), e);
00236 }
00237
00238 template <class S, class T>
00239 typename Element<S, T>::monoid_elt_t
00240 op_word_of(const AutomataBase<S>& s,
00241 const TransposeView<T>& v,
00242 const typename automaton_traits<T>::htransition_t& e)
00243 {
00244 return op_word_of(s, v.object(), e);
00245 }
00246
00247 template <class S, class T>
00248 typename Element<S, T>::monoid_elt_value_t
00249 op_word_value_of(const AutomataBase<S>& s,
00250 const TransposeView<T>& v,
00251 const typename automaton_traits<T>::htransition_t& e)
00252 {
00253 return op_word_value_of(s, v.object(), e);
00254 }
00255
00256 template <class S, class T>
00257 typename Element<S, T>::letter_t
00258 op_letter_of(const AutomataBase<S>& s,
00259 const TransposeView<T>& v,
00260 const typename automaton_traits<T>::htransition_t& e)
00261 {
00262 return op_letter_of(s, v.object(), e);
00263 }
00264
00265 template <class S, class T>
00266 bool
00267 op_is_spontaneous(const AutomataBase<S>& s,
00268 const TransposeView<T>& v,
00269 const typename automaton_traits<T>::htransition_t& e)
00270 {
00271 return op_is_spontaneous(s, v.object(), e);
00272 }
00273
00274 template <class S, class T>
00275 typename automaton_traits<TransposeView<T> >::initial_support_t
00276 op_initial(const AutomataBase<S>& s, const TransposeView<T>& v)
00277 {
00278 return op_final(s, v.object());
00279 }
00280
00281 template <class S, class T>
00282 typename automaton_traits<TransposeView<T> >::final_support_t
00283 op_final(const AutomataBase<S>& s, const TransposeView<T>& v)
00284 {
00285 return op_initial(s, v.object());
00286 }
00287
00288 template <class S, class T>
00289 void
00290 op_set_initial(const AutomataBase<S>& ss, TransposeView<T>& v,
00291 const typename automaton_traits<T>::hstate_t& state,
00292 const AutoType(series_set_elt_t)& s)
00293 {
00294 return op_set_final(ss, v.object(), state, s);
00295 }
00296
00297 template <class S, class T>
00298 AutoType(series_set_elt_t)
00299 op_get_initial(const AutomataBase<S>& s,
00300 const TransposeView<T>& v,
00301 const typename automaton_traits<T>::hstate_t& state)
00302 {
00303 AutoType(series_set_elt_t) r = op_get_final(s, v.object(), state);
00304 r.transpose();
00305 return r;
00306 }
00307
00308 template <class S, class T>
00309 void
00310 op_set_final(const AutomataBase<S>& ss, TransposeView<T>& v,
00311 const typename automaton_traits<T>::hstate_t& state,
00312 const typename Element<S, T>::series_set_elt_t& s)
00313 {
00314 op_set_initial(ss, v.object(), state, s);
00315 }
00316
00317 template <class S, class T>
00318 typename Element<S, T>::series_set_elt_t
00319 op_get_final(const AutomataBase<S>& s,
00320 const TransposeView<T>& v,
00321 const typename automaton_traits<T>::hstate_t& state)
00322 {
00323 typename Element<S, T>::series_set_elt_t r = op_get_initial(s, v.object(),
00324 state);
00325 r.transpose();
00326 return r;
00327 }
00328
00329 template <class S, class T>
00330 void
00331 op_clear_initial(const AutomataBase<S>& s, TransposeView<T>& v)
00332 {
00333 op_clear_final(s, v.object());
00334 }
00335
00336 template <class S, class T>
00337 void
00338 op_clear_final(const AutomataBase<S>& s, TransposeView<T>& v)
00339 {
00340 op_clear_initial(s, v.object());
00341 }
00342
00343 template <class S, class T>
00344 typename automaton_traits<T>::hstate_t
00345 op_src_of(const AutomataBase<S>& s,
00346 const TransposeView<T>& v,
00347 const typename automaton_traits<T>::htransition_t& e)
00348 {
00349 return op_dst_of(s, v.object(), e);
00350 }
00351
00352 template <class S, class T>
00353 typename automaton_traits<T>::hstate_t
00354 op_dst_of(const AutomataBase<S>& s,
00355 const TransposeView<T>& v,
00356 const typename automaton_traits<T>::htransition_t& e)
00357 {
00358 return op_src_of(s, v.object(), e);
00359 }
00360
00361
00362
00363
00364
00365 template <class S, class T,
00366 typename OutputIterator>
00367 void op_delta(const AutomataBase<S>& s,
00368 const TransposeView<T>& v,
00369 OutputIterator res,
00370 const typename automaton_traits<T>::hstate_t& from,
00371 delta_kind::transitions k)
00372 {
00373 op_rdelta(s, v.object(), res, from, k);
00374 }
00375
00376 template <class S, class T,
00377 typename OutputIterator, typename L>
00378 void op_delta(const AutomataBase<S>& s,
00379 const TransposeView<T>& v,
00380 OutputIterator res,
00381 const typename automaton_traits<T>::hstate_t& from,
00382 const L& query,
00383 delta_kind::transitions k)
00384 {
00385 op_rdelta(s, v.object(), res, from, query, k);
00386 }
00387
00388 template <class S, class T,
00389 typename OutputIterator, typename L>
00390 void op_letter_delta(const AutomataBase<S>& s,
00391 const TransposeView<T>& v,
00392 OutputIterator res,
00393 const typename automaton_traits<T>::hstate_t& from,
00394 const L& letter,
00395 delta_kind::transitions k)
00396 {
00397 op_letter_rdelta(s, v.object(), res, from, letter, k);
00398 }
00399
00400 template <class S, class T,
00401 typename OutputIterator>
00402 void op_spontaneous_delta(const AutomataBase<S>& s,
00403 const TransposeView<T>& v,
00404 OutputIterator res,
00405 const typename automaton_traits<T>::hstate_t& from,
00406 delta_kind::transitions k)
00407 {
00408 op_spontaneous_rdelta(s, v.object(), res, from, k);
00409 }
00410
00411
00412
00413
00414
00415 template <class S, class T,
00416 typename Container>
00417 void op_deltac(const AutomataBase<S>& s,
00418 const TransposeView<T>& v,
00419 Container& res, const typename automaton_traits<T>::hstate_t& from, delta_kind::transitions k)
00420 {
00421 op_rdeltac(s, v.object(), res, from, k);
00422 }
00423
00424 template <class S, class T,
00425 typename Container, typename L>
00426 void op_deltac(const AutomataBase<S>& s,
00427 const TransposeView<T>& v,
00428 Container& res,
00429 const typename automaton_traits<T>::hstate_t& from,
00430 const L& query,
00431 delta_kind::transitions k)
00432 {
00433 op_rdeltac(s, v.object(), res, from, query, k);
00434 }
00435
00436 template <class S, class T,
00437 typename Container, typename L>
00438 void op_letter_deltac(const AutomataBase<S>& s,
00439 const TransposeView<T>& v,
00440 Container& res,
00441 const typename automaton_traits<T>::hstate_t& from,
00442 const L& letter,
00443 delta_kind::transitions k)
00444 {
00445 op_letter_rdeltac(s, v.object(), res, from, letter, k);
00446 }
00447
00448 template <class S, class T, class Container>
00449 void op_spontaneous_deltac(const AutomataBase<S>& s,
00450 const TransposeView<T>& v,
00451 Container& res,
00452 const typename automaton_traits<T>::hstate_t& from,
00453 delta_kind::transitions k)
00454 {
00455 op_spontaneous_rdeltac(s, v.object(), res, from, k);
00456 }
00457
00458
00459
00460
00461
00462 template<class S, class T, typename OutputIterator>
00463 void op_delta(const AutomataBase<S>& s,
00464 const TransposeView<T>& v,
00465 OutputIterator res,
00466 const typename automaton_traits<T>::hstate_t& from,
00467 delta_kind::states k)
00468 {
00469 op_rdelta(s, v.object(), res, from, k);
00470 }
00471
00472 template<class S, class T, typename OutputIterator, typename L>
00473 void op_delta(const AutomataBase<S>& s,
00474 const TransposeView<T>& v,
00475 OutputIterator res,
00476 const typename automaton_traits<T>::hstate_t& from,
00477 const L& query,
00478 delta_kind::states k)
00479 {
00480 op_rdelta(s, v.object(), res, from, query, k);
00481 }
00482
00483 template<class S, class T, typename OutputIterator, typename L>
00484 void op_letter_delta(const AutomataBase<S>& s,
00485 const TransposeView<T>& v,
00486 OutputIterator res,
00487 const typename automaton_traits<T>::hstate_t& from,
00488 const L& letter,
00489 delta_kind::states k)
00490 {
00491 op_letter_rdelta(s, v.object(), res, from, letter, k);
00492 }
00493
00494 template<class S, class T, typename OutputIterator>
00495 void op_spontaneous_delta(const AutomataBase<S>& s,
00496 const TransposeView<T>& v,
00497 OutputIterator res,
00498 const typename automaton_traits<T>::hstate_t& from,
00499 delta_kind::states k)
00500 {
00501 op_spontaneous_rdelta(s, v.object(), res, from, k);
00502 }
00503
00504
00505
00506
00507
00508 template<class S, class T, typename Container>
00509 void op_deltac(const AutomataBase<S>& s,
00510 const TransposeView<T>& v,
00511 Container& res, const typename automaton_traits<T>::hstate_t& from, delta_kind::states k)
00512 {
00513 op_rdeltac(s, v.object(), res, from, k);
00514 }
00515
00516 template<class S, class T, typename Container, typename L>
00517 void op_deltac(const AutomataBase<S>& s,
00518 const TransposeView<T>& v,
00519 Container& res,
00520 const typename automaton_traits<T>::hstate_t& from,
00521 const L& query,
00522 delta_kind::states k)
00523 {
00524 op_rdeltac(s, v.object(), res, from, k);
00525 }
00526
00527 template<class S, class T, typename Container, typename L>
00528 void op_letter_deltac(const AutomataBase<S>& s,
00529 const TransposeView<T>& v,
00530 Container& res,
00531 const typename automaton_traits<T>::hstate_t& from,
00532 const L& letter,
00533 delta_kind::states k)
00534 {
00535 op_letter_rdeltac(s, v.object(), res, from, letter, k);
00536 }
00537
00538 template<class S, class T, typename Container>
00539 void op_spontaneous_deltac(const AutomataBase<S>& s,
00540 const TransposeView<T>& v,
00541 Container& res,
00542 const typename automaton_traits<T>::hstate_t& from,
00543 delta_kind::states k)
00544 {
00545 op_spontaneous_rdeltac(s, v.object(), res, from, k);
00546 }
00547
00548
00549
00550
00551
00552 template<class S, class T, typename OutputIterator>
00553 void op_rdelta(const AutomataBase<S>& s, const TransposeView<T>& v,
00554 OutputIterator res,
00555 const typename automaton_traits<T>::hstate_t& from,
00556 delta_kind::transitions k)
00557 {
00558 op_delta(s, v.object(), res, from, k);
00559 }
00560
00561 template<class S, class T, typename OutputIterator, typename L>
00562 void op_rdelta(const AutomataBase<S>& s, const TransposeView<T>& v,
00563 OutputIterator res,
00564 const typename automaton_traits<T>::hstate_t& from,
00565 const L& query,
00566 delta_kind::transitions k)
00567 {
00568 op_delta(s, v.object(), res, from, query, k);
00569 }
00570
00571 template<class S, class T, typename OutputIterator, typename L>
00572 void op_letter_rdelta(const AutomataBase<S>& s, const TransposeView<T>& v,
00573 OutputIterator res,
00574 const typename automaton_traits<T>::hstate_t& from,
00575 const L& letter,
00576 delta_kind::transitions k)
00577 {
00578 op_letter_delta(s, v.object(), res, from, letter, k);
00579 }
00580
00581 template<class S, class T, typename OutputIterator>
00582 void op_spontaneous_rdelta(const AutomataBase<S>& s,
00583 const TransposeView<T>& v,
00584 OutputIterator res,
00585 const typename automaton_traits<T>::hstate_t& from,
00586 delta_kind::transitions k)
00587 {
00588 op_spontaneous_delta(s, v.object(), res, from, k);
00589 }
00590
00591
00592
00593
00594
00595 template<class S, class T, typename Container>
00596 void op_rdeltac(const AutomataBase<S>& s, const TransposeView<T>& v,
00597 Container& res, const typename automaton_traits<T>::hstate_t& from, delta_kind::transitions k)
00598 {
00599 op_deltac(s, v.object(), res, from, k);
00600 }
00601
00602 template<class S, class T, typename Container, typename L>
00603 void op_rdeltac(const AutomataBase<S>& s, const TransposeView<T>& v,
00604 Container& res,
00605 const typename automaton_traits<T>::hstate_t& from,
00606 const L& query,
00607 delta_kind::transitions k)
00608 {
00609 op_deltac(s, v.object(), res, from, query, k);
00610 }
00611
00612 template<class S, class T, typename Container, typename L>
00613 void op_letter_rdeltac(const AutomataBase<S>& s, const TransposeView<T>& v,
00614 Container& res,
00615 const typename automaton_traits<T>::hstate_t& from,
00616 const L& letter,
00617 delta_kind::transitions k)
00618 {
00619 op_letter_deltac(s, v.object(), res, from, letter, k);
00620 }
00621
00622 template<class S, class T, typename Container>
00623 void op_spontaneous_rdeltac(const AutomataBase<S>& s,
00624 const TransposeView<T>& v,
00625 Container& res,
00626 const typename automaton_traits<T>::hstate_t& from,
00627 delta_kind::transitions k)
00628 {
00629 op_spontaneous_deltac(s, v.object(), res, from, k);
00630 }
00631
00632
00633
00634
00635
00636 template<class S, class T, typename OutputIterator>
00637 void op_rdelta(const AutomataBase<S>& s, const TransposeView<T>& v,
00638 OutputIterator res,
00639 const typename automaton_traits<T>::hstate_t& from,
00640 delta_kind::states k)
00641 {
00642 op_delta(s, v.object(), res, from, k);
00643 }
00644
00645 template<class S, class T, typename OutputIterator, typename L>
00646 void op_rdelta(const AutomataBase<S>& s, const TransposeView<T>& v,
00647 OutputIterator res,
00648 const typename automaton_traits<T>::hstate_t& from,
00649 const L& query,
00650 delta_kind::states k)
00651 {
00652 op_delta(s, v.object(), res, from, query, k);
00653 }
00654
00655 template<class S, class T, typename OutputIterator, typename L>
00656 void op_letter_rdelta(const AutomataBase<S>& s, const TransposeView<T>& v,
00657 OutputIterator res,
00658 const typename automaton_traits<T>::hstate_t& from,
00659 const L& letter,
00660 delta_kind::states k)
00661 {
00662 op_letter_delta(s, v.object(), res, from, letter, k);
00663 }
00664
00665 template<class S, class T, typename OutputIterator>
00666 void op_spontaneous_rdelta(const AutomataBase<S>& s,
00667 const TransposeView<T>& v,
00668 OutputIterator res,
00669 const typename automaton_traits<T>::hstate_t& from,
00670 delta_kind::states k)
00671 {
00672 op_spontaneous_delta(s, v.object(), res, from, k);
00673 }
00674
00675
00676
00677
00678
00679 template<class S, class T, typename Container>
00680 void op_rdeltac(const AutomataBase<S>& s, const TransposeView<T>& v,
00681 Container& res, const typename automaton_traits<T>::hstate_t& from, delta_kind::states k)
00682 {
00683 op_deltac(s, v.object(), res, from, k);
00684 }
00685
00686 template<class S, class T, typename Container, typename L>
00687 void op_rdeltac(const AutomataBase<S>& s, const TransposeView<T>& v,
00688 Container& res,
00689 const typename automaton_traits<T>::hstate_t& from,
00690 const L& query,
00691 delta_kind::states k)
00692 {
00693 op_deltac(s, v.object(), res, from, query, k);
00694 }
00695
00696 template<class S, class T, typename Container, typename L>
00697 void op_letter_rdeltac(const AutomataBase<S>& s, const TransposeView<T>& v,
00698 Container& res,
00699 const typename automaton_traits<T>::hstate_t& from,
00700 const L& letter,
00701 delta_kind::states k)
00702 {
00703 op_letter_deltac(s, v.object(), res, from, letter, k);
00704 }
00705
00706 template<class S, class T, typename Container>
00707 void op_spontaneous_rdeltac(const AutomataBase<S>& s,
00708 const TransposeView<T>& v,
00709 Container& res,
00710 const typename automaton_traits<T>::hstate_t& from,
00711 delta_kind::states k)
00712 {
00713 op_spontaneous_deltac(s, v.object(), res, from, k);
00714 }
00715
00716 }
00717
00718 # undef AutoType
00719
00720 #endif // ! VCSN_AUTOMATA_IMPLEMENTATION_TRANSPOSE_VIEW_HXX