-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathreedmuller.h
69 lines (57 loc) · 1.5 KB
/
reedmuller.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/* reedmuller.h
*
* Reed-Muller code implementation. Currently works only over |F_2.
*
* By Sebastian Raaphorst, 2002
* ID#: 1256241
*
* $Author: vorpal $
* $Date: 2002/12/09 15:07:04 $
*/
#ifndef REEDMULLER_H
#define REEDMULLER_H
#include "ksubset.h"
/* these must be at least 4 and 2 for init and decode to work properly! */
#ifndef NUMVECTORS
#define NUMVECTORS 4
#endif
#ifndef NUMSUBSETS
#define NUMSUBSETS 2
#endif
struct _reedmuller {
int r;
int m;
int q;
int n;
int k;
int **G;
int **rows;
set s;
/* this isn't all that elegant, but allocating work vectors / subsets during
the initialization process prevents us from having to create them
dynamically during the call to the decoding function, which is
not only inefficient but bad programming style */
int *vector[NUMVECTORS];
int *subset[NUMSUBSETS];
};
typedef struct _reedmuller *reedmuller;
reedmuller reedmuller_init(int, int);
void reedmuller_free(reedmuller);
int reedmuller_encode(reedmuller, int*, int*);
int reedmuller_decode(reedmuller, int*, int*);
#endif
/*
* $Log: reedmuller.h,v $
* Revision 1.3 2002/12/09 15:07:04 vorpal
* Fixed decoding routine so that the received message was not
* altered during computation (had to add a fourth work vector to
* the reedmuller struct).
*
* Revision 1.2 2002/12/09 04:06:59 vorpal
* Added changes to allow for decoding.
* Still have to write rmdecode.c and test.
*
* Revision 1.1 2002/11/14 20:28:05 vorpal
* Adding new files to project.
*
*/