-
Notifications
You must be signed in to change notification settings - Fork 1
/
ebc.h
56 lines (46 loc) · 1.35 KB
/
ebc.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
#ifndef EBC_H
#define EBC_H
#include <string>
#include <vector>
#include "graph.h"
class EBC //Expander Block Code
{
public:
EBC(int nb1, int nb2, int sb1, int sb2);
~EBC(void);
BipartiteGraph graph;
int sb1, sb2; // "s"ize of "b"locks in the first and second dimensions
int *md1, *md2;
std::vector<int> K1, K2;
std::vector<std::vector<char> > systematic;
int codeLength;
int nConstraints;
int nInfSymbols;
double designRate(void);
int rateUpperBound(void);
void setRegularMD(int md1, int md2);
void setRegularMD(std::vector<int>& MD1,std::vector<int>& MD2) ;
void setUniformRandomMD();
bool readMDFile(std::string fname);
void setSubcodeInf();
void setSubcodeInf(std::vector<int> a, std::vector<int> b);
void testSystematicProcedure(int nperm);
void makeCheckMatrix();
int CheckMatrixRank(void *f);
void printMD();
void printParams();
void printSystematic();
unsigned int nCheckOnCheck();
};
class ErasurePattern {
public:
ErasurePattern(const EBC& code);
ErasurePattern(const EBC& code, double erasureProb);
ErasurePattern(const EBC& code, std::string fname);
BipartiteGraph pattern;
//static base_srng_type RandomGen;
//const EBC code;
unsigned int instance(const EBC& code, double erasureProb);
void decode(const EBC& code);
};
#endif