17 #ifndef VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_EXP_HXX
18 # define VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_EXP_HXX
20 # include <vaucanson/algebra/implementation/series/rat/exp.hh>
22 # include <vaucanson/algebra/implementation/series/rat/depth_visitor.hh>
23 # include <vaucanson/algebra/implementation/series/rat/star_height_visitor.hh>
24 # include <vaucanson/algebra/implementation/series/rat/length_visitor.hh>
30 template<
typename LetterT,
typename WeightT>
35 template<
typename LetterT,
typename WeightT>
40 template<
typename LetterT,
typename WeightT>
45 template<
typename LetterT,
typename WeightT>
47 : base_(other.base_->clone())
50 template<
typename LetterT,
typename WeightT>
56 template<
typename LetterT,
typename WeightT>
60 if (other.
base_ != base_)
63 base_ = other.
base_->clone();
68 template<
typename LetterT,
typename WeightT>
72 base_ =
new n_sum_t(base_, other.
base_->clone());
76 template<
typename LetterT,
typename WeightT>
80 base_ =
new n_prod_t(base_, other.
base_->clone());
84 template<
typename LetterT,
typename WeightT>
87 base_ =
new n_star_t(base_);
91 template<
typename LetterT,
typename WeightT>
99 template<
typename LetterT,
typename WeightT>
101 accept(ConstNodeVisitor<monoid_elt_value_t, semiring_elt_value_t>& v)
const
106 template<
typename LetterT,
typename WeightT>
109 DepthVisitor<monoid_elt_value_t, semiring_elt_value_t> v;
114 template<
typename LetterT,
typename WeightT>
117 StarHeightVisitor<monoid_elt_value_t, semiring_elt_value_t> v;
122 template<
typename LetterT,
typename WeightT>
125 LengthVisitor<monoid_elt_value_t, semiring_elt_value_t> v;
130 template<
typename LetterT,
typename WeightT>
131 typename exp<LetterT, WeightT>::node_t* &
137 template<
typename LetterT,
typename WeightT>
138 typename exp<LetterT, WeightT>::node_t*
const &
144 template<
typename LetterT,
typename WeightT>
147 return !(*base_ != *other.
base_);
150 template<
typename LetterT,
typename WeightT>
153 return *base_ != *other.
base_;
156 template<
typename LetterT,
typename WeightT>
159 return *base_ < *other.
base_;
162 template<
typename LetterT,
typename WeightT>
166 return exp(base_->clone());
169 template<
typename LetterT,
typename WeightT>
173 return exp(
new n_one_t);
176 template<
typename LetterT,
typename WeightT>
179 return exp(
new n_zero_t);
182 template<
typename LetterT,
typename WeightT>
186 return exp(
new n_const_t(l));
189 template<
typename LetterT,
typename WeightT>
195 template<
typename M,
typename W>
204 template<
typename M,
typename W>
206 const exp<M, W>& rhs)
213 template<
typename M,
typename W>
215 const exp<M, W>& rhs)
218 ret.base() =
new LeftWeighted<M, W>(lhs, ret.base());
222 template<
typename M,
typename W>
227 ret.base() =
new RightWeighted<M, W>(rhs, ret.base());
234 template<
typename M,
typename S,
typename T>
235 exp<M, Element<S, T> >
237 const exp<M, Element<S, T> >& rhs)
239 exp<M, Element<S, T> > ret(rhs);
241 =
new LeftWeighted<M, Element<S, T> >(lhs, ret.base());
245 template<
typename M,
typename S,
typename T>
246 exp<M, Element<S, T> >
247 operator*(
const exp<M, Element<S, T> >& lhs,
248 const Element<S, T>& rhs)
250 exp<M, Element<S, T> > ret(lhs);
252 =
new RightWeighted<M, Element<S, T> >(rhs, ret.base());
256 template<
typename M,
typename W>
267 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_EXP_HXX