17 #ifndef VCSN_ALGEBRA_IMPLEMENTATION_SERIES_KRAT_CONVERSION_HXX
18 # define VCSN_ALGEBRA_IMPLEMENTATION_SERIES_KRAT_CONVERSION_HXX
20 # include <vaucanson/algebra/implementation/series/krat_conversion.hh>
30 template<
typename Tm,
typename Tw,
typename oTm,
typename oTw,
32 ExpConvertVisitor<Tm, Tw, oTm, oTw, Series_>::ExpConvertVisitor(
const Series_& s)
37 template<
typename Tm,
typename Tw,
typename oTm,
typename oTw,
39 ExpConvertVisitor<Tm, Tw, oTm, oTw, Series_>::~ExpConvertVisitor()
42 template<
typename Tm,
typename Tw,
typename oTm,
typename oTw,
45 ExpConvertVisitor<Tm, Tw, oTm, oTw, Series_>::product(
const node_t* left_,
48 right_->accept(*
this);
54 template<
typename Tm,
typename Tw,
typename oTm,
typename oTw,
57 ExpConvertVisitor<Tm, Tw, oTm, oTw, Series_>::sum(
const node_t* left_,
60 right_->accept(*
this);
66 template<
typename Tm,
typename Tw,
typename oTm,
typename oTw,
72 op_in_star(series_, exp_);
75 template<
typename Tm,
typename Tw,
typename oTm,
typename oTw,
78 ExpConvertVisitor<Tm, Tw, oTm, oTw, Series_>::left_weight(
const oTw& w,
82 exp_ =
op_mul(series_.semiring(), series_,
83 op_convert(
SELECT(
typename Series_::semiring_t),
89 template<
typename Tm,
typename Tw,
typename oTm,
typename oTw,
92 ExpConvertVisitor<Tm, Tw, oTm, oTw, Series_>::right_weight(
const oTw& w,
97 op_in_mul(series_, series_.semiring(), exp_,
98 op_convert(
SELECT(
typename Series_::semiring_t),
103 template<
typename Tm,
typename Tw,
typename oTm,
typename oTw,
106 ExpConvertVisitor<Tm, Tw, oTm, oTw, Series_>::constant(
const oTm& m_)
108 Tm m = op_convert(
SELECT(
typename Series_::monoid_t),
111 if (m == identity_value(
SELECT(
typename Series_::monoid_t),
115 exp_ = exp_t::constant(m);
118 template<
typename Tm,
typename Tw,
typename oTm,
typename oTw,
121 ExpConvertVisitor<Tm, Tw, oTm, oTw, Series_>::one()
126 template<
typename Tm,
typename Tw,
typename oTm,
typename oTw,
129 ExpConvertVisitor<Tm, Tw, oTm, oTw, Series_>::zero()
131 exp_ = exp_t::zero();
134 template<
typename Tm,
typename Tw,
typename oTm,
typename oTw,
136 const typename ExpConvertVisitor<Tm,Tw,oTm,oTw,Series_>::exp_t&
142 template<
typename Tm,
typename Tw,
typename W,
typename M,
143 typename oTm,
typename oTw>
146 const Series<W, M>& s,
147 const rat::exp<oTm, oTw>& arg)
149 ExpConvertVisitor<Tm, Tw, oTm, oTw, Series<W, M> > v(s);
154 template<
typename W,
typename M,
typename Tm,
typename Tw,
155 typename oTm,
typename oTw>
156 Element<Series<W, M>, rat::exp<Tm, Tw> >
157 convert_exp(
SELECTOR4(Element<Series<W, M>, rat::exp<Tm, Tw> >),
158 const Element<Series<W, M>, rat::exp<oTm, oTw> >& arg)
160 return Element<Series<W, M>, rat::exp<Tm, Tw> >
162 convert_exp(
SELECT2(rat::exp<Tm, Tw>),
171 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_SERIES_KRAT_CONVERSION_HXX