18 # include <vaucanson/design_pattern/design_pattern.hh>
19 # include <vaucanson/automata/concept/automata.hh>
24 template<
typename lhs_t,
typename rhs_t>
27 std::map<typename rhs_t::hstate_t, typename lhs_t::hstate_t> stmap;
29 for (
typename rhs_t::state_iterator i = from.states().begin();
30 i != from.states().end(); ++i)
32 typename lhs_t::hstate_t s = dst.add_state();
33 if (from.is_final(*i))
35 if (from.is_initial(*i))
40 typedef typename lhs_t::semiring_elt_t semiring_elt_t;
41 semiring_elt_t one(dst.series().semiring().wone_);
42 for (
typename rhs_t::transition_iterator i = from.transitions().begin();
43 i != from.transitions().end(); ++i)
45 typename rhs_t::series_set_elt_t label(from.series_of(*i));
47 int size = label.supp().size();
50 typename rhs_t::series_set_elt_t::support_t::const_iterator m =
52 for (
int j = 0; j < size; ++j, ++m)
54 typename lhs_t::series_set_elt_t
55 series(dst.structure().series());
56 typename lhs_t::monoid_elt_t
57 mv(dst.structure().series().monoid());
59 series.assoc(mv, one);
60 dst.add_series_transition(stmap[from.src_of(*i)],
61 stmap[from.dst_of(*i)], series);