00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 #ifndef VCSN_ALGORITHMS_TRANSPOSE_HXX
00019 # define VCSN_ALGORITHMS_TRANSPOSE_HXX
00020 
00021 #include <vaucanson/algorithms/transpose.hh>
00022 #include <vaucanson/automata/implementation/transpose_view.hh>
00023 #include <vaucanson/automata/concept/copy.hh>
00024 
00025 namespace vcsn
00026 {
00027   template<typename A, typename AI1, typename AI2>
00028   void
00029   transpose(Element<A, AI1>& dst, const Element<A, AI2>& from)
00030   {
00031     BENCH_TASK_SCOPED("transpose");
00032     typedef Element<A, AI1> automaton_t;
00033     AUTOMATON_TYPES(automaton_t);
00034     auto_copy(dst, transpose_view(from));
00035     
00036     
00037     for_all_transitions(e, dst)
00038       dst.series_of(*e).transpose();
00039   }
00040 
00041   template<typename A, typename AI>
00042   Element<A, AI>
00043   transpose(const Element<A, AI>& from)
00044   {
00045     Element<A, AI> dst(from.structure());
00046     transpose(dst, from);
00047     return dst;
00048   }
00049 
00050 } 
00051 
00052 #endif // ! VCSN_ALGORITHMS_TRANSPOSE_HXX