- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

# krat_exp_transpose.hxx

    00001 // krat_exp_transpose.hxx: this file is part of the Vaucanson project.
    00002 //
    00003 // Vaucanson, a generic library for finite state machines.
    00004 //
    00005 // Copyright (C) 2004, 2005, 2011 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_KRAT_EXP_TRANSPOSE_HXX
    00018 # define VCSN_ALGEBRA_IMPLEMENTATION_SERIES_KRAT_EXP_TRANSPOSE_HXX
    00019
    00020 # include <vaucanson/algebra/concept/series_base.hh>
    00021 # include <vaucanson/algebra/implementation/series/krat_exp_pattern.hh>
    00022
    00023
    00024 namespace vcsn {
    00025
    00026   namespace algebra {
    00027
    00028     template <class Series, class T, class Dispatch>
    00029     struct KRatExpTranspose : algebra::KRatExpIdentity<
    00030       KRatExpTranspose<Series, T, Dispatch>,
    00031       Series,
    00032       T,
    00033       Dispatch
    00034       >
    00035     {
    00036       typedef KRatExpTranspose<Series, T, Dispatch>     self_t;
    00037       typedef Element<Series, T>                        return_type;
    00038       typedef typename Element<Series, T>::semiring_elt_t semiring_elt_t;
    00039       typedef typename semiring_elt_t::value_t          semiring_elt_value_t;
    00040       typedef typename Element<Series, T>::monoid_elt_t monoid_elt_t;
    00041       typedef typename monoid_elt_t::value_t            monoid_elt_value_t;
    00042       typedef typename monoid_elt_t::set_t              monoid_t;
    00043       typedef typename monoid_t::alphabet_t             alphabet_t;
    00044       typedef typename alphabet_t::letter_t             letter_t;
    00045       INHERIT_CONSTRUCTORS(self_t, T, semiring_elt_t, Dispatch);
    00046
    00047       KRatExpTranspose(const Element<Series, T>& exp) :
    00048         KRatExpIdentity<KRatExpTranspose<Series, T, Dispatch>,
    00049                         Series,
    00050                         T,
    00051                         Dispatch
    00052                         >(exp)
    00053       {}
    00054
    00055       MATCH__(Product, lhs, rhs)
    00056       {
    00057         return this->match(rhs) * this->match(lhs);
    00058       }
    00059       END
    00060
    00061       MATCH_(Constant, m)
    00062       {
    00063         monoid_elt_t melt (this->exp_.structure().monoid(), m);
    00064         melt.mirror();
    00065         return Element<Series, T> (this->exp_.structure(), melt);
    00066       }
    00067       END
    00068
    00069     };
    00070
    00071
    00072   } // algebra
    00073
    00074 }
    00075
    00076 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_SERIES_KRAT_EXP_TRANSPOSE_HXX