Vaucanson  1.4.1
evaluation_fmp.hxx
1 // evaluation_fmp.hxx: this file is part of the Vaucanson project.
2 //
3 // Vaucanson, a generic library for finite state machines.
4 //
5 // Copyright (C) 2005, 2006, 2008, 2011 The Vaucanson Group.
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License
9 // as published by the Free Software Foundation; either version 2
10 // of the License, or (at your option) any later version.
11 //
12 // The complete GNU General Public Licence Notice can be found as the
13 // `COPYING' file in the root directory.
14 //
15 // The Vaucanson Group consists of people listed in the `AUTHORS' file.
16 //
17 #ifndef VCSN_ALGORITHMS_EVALUATION_FMP_HXX
18 # define VCSN_ALGORITHMS_EVALUATION_FMP_HXX
19 
24 # include <vaucanson/algebra/concept/freemonoid_product.hh>
25 
26 namespace vcsn
27 {
28  template <typename S1, typename S2, typename S3,
29  typename M1, typename M2, typename M3, typename M4,
30  typename trans_t, typename auto_t, typename res_t>
31  void
32  do_evaluation_fmp(const AutomataBase<S1>&,
33  const algebra::FreeMonoidProduct<M1, M2>&,
34  const AutomataBase<S2>&, const algebra::FreeMonoid<M3>&,
35  const AutomataBase<S3>&, const algebra::FreeMonoid<M4>&,
36  const trans_t& trans, const auto_t& aut, res_t& res)
37  {
38  precondition(is_sub_normalized(trans));
39  precondition(is_realtime(aut));
40  trans_t id_aut(trans.structure());
41  identity(aut, id_aut);
42  trans_t res_composition = compose(id_aut, trans);
43  image(res_composition, res);
44  }
45 
46  // FIXME: we should empty res.
47  template <typename ST, typename TT>
48  void
50  const typename input_projection_helper<ST, TT>::ret& aut,
51  typename output_projection_helper<ST, TT>::ret& res)
52  {
53  BENCH_TASK_SCOPED("evaluation_fmp");
54  do_evaluation_fmp(trans.structure(), trans.structure().series().monoid(),
55  aut.structure(), aut.structure().series().monoid(),
56  res.structure(), res.structure().series().monoid(),
57  trans, aut, res);
58  }
59 
60 } // End of namespace vcsn.
61 #endif // ! VCSN_ALGORITHMS_EVALUATION_FMP_HXX