Awali
Another Weighted Automata library
awali
sttc
weightset
gf2.hh
Go to the documentation of this file.
1
// This file is part of Awali.
2
// Copyright 2016-2022 Sylvain Lombardy, Victor Marsault, Jacques Sakarovitch
3
//
4
// Awali is a free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8
//
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17
#ifndef AWALI_WEIGHTSET_GF2_HH
18
# define AWALI_WEIGHTSET_GF2_HH
19
20
# include <cassert>
21
# include <ostream>
22
23
#include <
awali/sttc/misc/escape.hh
>
24
#include <
awali/utils/hash.hh
>
25
#include <
awali/sttc/misc/raise.hh
>
26
#include <
awali/common/enums.hh
>
27
#include <
awali/sttc/misc/stream.hh
>
28
#include <
awali/sttc/weightset/weightset.hh
>
29
30
namespace
awali
{
namespace
sttc {
31
32
namespace
internal
33
{
34
class
gf2_impl
35
{
36
public
:
37
using
self_type
= gf2;
38
39
static
std::string
sname
()
40
{
41
return
"gf2"
;
42
}
43
44
std::string
vname
(
bool
=
true
)
const
45
{
46
return
sname
();
47
}
48
49
enum
gf2_value
{
50
Z
,
O
,
X
,
X_O
,
X2
,
X2_O
,
X2_X
,
X2_X_O
51
}
52
53
gf2_value
[8][8]
addition_table
= {
54
// 0 1 x x+1 x² x²+1 x²+x x²+x+1
55
{
Z
,
O
,
X
,
X_O
,
X2
,
X2_O
,
X2_X
,
X2_X_O
}
// +0
56
{
O
,
Z
,
X_O
,
X
,
X2_O
,
X2
,
X2_X_O
,
X2_X
}
// +1
57
{
X
,
X_O
,
Z
,
O
,
X2_X
,
X2_X_O
,
X2
,
X2_O
}
// +x
58
{
X_O
,
X
,
O
,
Z
,
X2_X_O
,
X2_X
,
X2_O
,
X2
}
// +x+1
59
{
X2
,
X2_O
,
X2_X
,
X2_X_O
,
Z
,
O
,
X
,
X_O
}
// +x²
60
{
X2_O
,
X2
,
X2_X_O
,
X2_X
,
O
,
Z
,
X_O
,
X
}
// +x²+1
61
{
X2_X
,
X2_X_O
,
X2
,
X2_O
,
X
,
X_O
,
Z
,
O
}
// +x²+x
62
{
X2_X_O
,
X2_X
,
X2_O
,
X2
,
X_O
,
X
,
O
,
Z
}
// +x²+x+1
63
};
64
65
using
value_t
=
gf2_value
;
66
};
67
}
68
}}
//end of ns awali::stc
awali::sttc::internal::gf2_impl
Definition:
gf2.hh:35
awali::sttc::internal::gf2_impl::addition_table
enum awali::sttc::internal::gf2_impl::gf2_value addition_table[8][8]
awali::sttc::internal::gf2_impl::gf2_value
gf2_value
Definition:
gf2.hh:49
awali::sttc::internal::gf2_impl::X2
@ X2
Definition:
gf2.hh:50
awali::sttc::internal::gf2_impl::X2_O
@ X2_O
Definition:
gf2.hh:50
awali::sttc::internal::gf2_impl::X
@ X
Definition:
gf2.hh:50
awali::sttc::internal::gf2_impl::Z
@ Z
Definition:
gf2.hh:50
awali::sttc::internal::gf2_impl::X2_X_O
@ X2_X_O
Definition:
gf2.hh:50
awali::sttc::internal::gf2_impl::X2_X
@ X2_X
Definition:
gf2.hh:50
awali::sttc::internal::gf2_impl::X_O
@ X_O
Definition:
gf2.hh:50
awali::sttc::internal::gf2_impl::O
@ O
Definition:
gf2.hh:50
awali::sttc::internal::gf2_impl::vname
std::string vname(bool=true) const
Definition:
gf2.hh:44
awali::sttc::internal::gf2_impl::sname
static std::string sname()
Definition:
gf2.hh:39
awali::sttc::internal::gf2_impl::self_type
gf2 self_type
Definition:
gf2.hh:37
enums.hh
escape.hh
awali
Main namespace of Awali.
Definition:
ato.hh:22
raise.hh
stream.hh
hash.hh
weightset.hh
Generated on Tue Dec 20 2022 19:47:02 for Awali by
1.9.1