-
Notifications
You must be signed in to change notification settings - Fork 0
/
golay.h
35 lines (32 loc) · 1.04 KB
/
golay.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef GOLAY_H
#define GOLAY_H
class Golay {
private:
int n = 24;
int k = 12;
int u[24] = {};
int s[12] = {};
int r[24] = {};
int P[12][12] = {{1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1},
{0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1},
{0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1},
{0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1},
{1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1},
{1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1},
{1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1},
{0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1},
{1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1},
{1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1},
{0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}};
int** G = new int*[12];
int** HT = new int*[24];
void get_matrices();
void get_syndrome();
public:
Golay();
void encode(int*);
void add_errors();
void decode();
};
#endif