series.hxx

00001 // series.hxx: this file is part of the Vaucanson project.
00002 //
00003 // Vaucanson, a generic library for finite state machines.
00004 //
00005 // Copyright (C) 2001, 2002, 2003, 2004 The Vaucanson Group.
00006 //
00007 // This program is free software; you can redistribute it and/or
00008 // modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2
00010 // of the License, or (at your option) any later version.
00011 //
00012 // The complete GNU General Public Licence Notice can be found as the
00013 // `COPYING' file in the root directory.
00014 //
00015 // The Vaucanson Group consists of people listed in the `AUTHORS' file.
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     | Series<Semiring, Monoid> |
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   } // algebra
00072 
00073 } // vcsn
00074 
00075 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_SERIES_SERIES_HXX

Generated on Fri Jul 28 12:18:51 2006 for Vaucanson by  doxygen 1.4.6