Vaucanson
1.4.1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
vaucanson
algorithms
prefix.hxx
1
// prefix.hxx: this file is part of the Vaucanson project.
2
//
3
// Vaucanson, a generic library for finite state machines.
4
//
5
// Copyright (C) 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_PREFIX_HXX
18
# define VCSN_ALGORITHMS_PREFIX_HXX
19
20
# include <
vaucanson/algorithms/prefix.hh
>
21
22
# include <vaucanson/automata/concept/automata_base.hh>
23
# include <
vaucanson/algorithms/realtime.hh
>
24
# include <vaucanson/automata/implementation/transpose_view.hh>
25
# include <vaucanson/misc/usual_macros.hh>
26
# include <
vaucanson/algorithms/is_trim.hh
>
27
28
namespace
vcsn {
29
30
/*--------------.
31
| prefix_here |
32
`--------------*/
33
34
template
<
typename
A,
typename
AI>
35
void
36
prefix_here
(Element<A, AI>& a)
37
{
38
precondition(
is_realtime
(a));
39
precondition(
is_trim
(a));
40
41
typedef
Element<A, AI> automaton_t;
42
AUTOMATON_TYPES (automaton_t);
43
44
for_all_states (i, a)
45
a.set_final (*i);
46
}
47
48
/*---------.
49
| prefix |
50
`---------*/
51
52
template<typename A, typename AI>
53
Element<A, AI>
54
prefix
(const
Element
<A, AI>& a)
55
{
56
Element<A, AI>
res (a);
57
prefix_here
(res);
58
return
(res);
59
}
60
61
}
// vcsn
62
63
#endif // !VCSN_ALGORITHMS_PREFIX_HXX
Generated on Sat Jul 14 2012 18:46:40 for Vaucanson by
1.8.1.1