00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef VCSN_ALGEBRA_IMPLEMENTATION_SERIES_SERIES_HXX
00018 # define VCSN_ALGEBRA_IMPLEMENTATION_SERIES_SERIES_HXX
00019
00020 # include <vaucanson/algebra/implementation/series/series.hh>
00021 # include <vaucanson/misc/unique.hh>
00022
00023 namespace vcsn {
00024
00025 namespace algebra {
00026
00027
00028
00029
00030
00031 template<typename Semiring, typename Monoid>
00032 Series<Semiring, Monoid>::Series(const Semiring& w, const Monoid& m)
00033 : SetSlot<Semiring,semiring_slot_tag>(w),
00034 SetSlot<Monoid,monoid_slot_tag>(m)
00035 {}
00036
00037 template<typename Semiring, typename Monoid>
00038 Series<Semiring, Monoid>::Series(const Series& other) :
00039 SeriesBase<Series<Semiring,Monoid> >(other),
00040 SetSlot<Semiring,semiring_slot_tag>(other),
00041 SetSlot<Monoid,monoid_slot_tag>(other)
00042 {}
00043
00044 template<typename Semiring, typename Monoid>
00045 const Semiring& Series<Semiring, Monoid>::semiring() const
00046 {
00047 return static_cast<const SetSlot<Semiring,semiring_slot_tag>* >(this)->_structure_get();
00048 }
00049
00050 template<typename Semiring, typename Monoid>
00051 const Monoid& Series<Semiring, Monoid>::monoid() const
00052 {
00053 return static_cast<const SetSlot<Monoid,monoid_slot_tag>* >(this)->_structure_get();
00054 }
00055
00056 template<typename W, typename M>
00057 bool operator==(const Series<W, M>& s1,
00058 const Series<W, M>& s2)
00059 {
00060 return & s1.monoid() == & s2.monoid() &&
00061 & s1.semiring() == & s2.semiring();
00062 }
00063
00064 template <class W, class M, class NewW, class NewM>
00065 typename mute_series_traits<Series<W, M>, NewW, NewM >::ret
00066 mute_series(const Series<W, M>& s, const NewW& w, const NewM& m)
00067 {
00068 return mute_series_traits<Series<W, M>, NewW, NewM >::ret(w, m);
00069 }
00070
00071 }
00072
00073 }
00074
00075 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_SERIES_SERIES_HXX