Vaucanson
1.4.1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
vaucanson
algorithms
algorithms/transpose.hxx
1
// transpose.hxx: this file is part of the Vaucanson project.
2
//
3
// Vaucanson, a generic library for finite state machines.
4
//
5
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008 The
6
// Vaucanson Group.
7
//
8
// This program is free software; you can redistribute it and/or
9
// modify it under the terms of the GNU General Public License
10
// as published by the Free Software Foundation; either version 2
11
// of the License, or (at your option) any later version.
12
//
13
// The complete GNU General Public Licence Notice can be found as the
14
// `COPYING' file in the root directory.
15
//
16
// The Vaucanson Group consists of people listed in the `AUTHORS' file.
17
//
18
#ifndef VCSN_ALGORITHMS_TRANSPOSE_HXX
19
# define VCSN_ALGORITHMS_TRANSPOSE_HXX
20
21
#include <
vaucanson/algorithms/transpose.hh
>
22
#include <vaucanson/automata/implementation/transpose_view.hh>
23
#include <vaucanson/automata/concept/copy.hh>
24
25
namespace
vcsn
26
{
27
template
<
typename
A,
typename
AI1,
typename
AI2>
28
void
29
transpose
(
Element<A, AI1>
& dst,
const
Element<A, AI2>
& from)
30
{
31
BENCH_TASK_SCOPED(
"transpose"
);
32
typedef
Element<A, AI1>
automaton_t;
33
AUTOMATON_TYPES(automaton_t);
34
auto_copy(dst,
transpose_view
(from));
35
// transpose_view is still a quick transposition without label transpose.
36
// transpose now inverts all transitions of the dst_ automaton.
37
for_all_transitions(e, dst)
38
dst.series_of(*e).transpose();
39
}
40
41
template
<
typename
A,
typename
AI>
42
Element<A, AI>
43
transpose
(
const
Element<A, AI>
& from)
44
{
45
Element<A, AI>
dst(from.
structure
());
46
transpose
(dst, from);
47
return
dst;
48
}
49
50
}
//vcsn
51
52
#endif // ! VCSN_ALGORITHMS_TRANSPOSE_HXX
Generated on Sat Jul 14 2012 18:46:41 for Vaucanson by
1.8.1.1