-
Notifications
You must be signed in to change notification settings - Fork 93
/
ex-dep
executable file
·60 lines (42 loc) · 1.59 KB
/
ex-dep
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
#!/bin/sh
# Examples of a how a parity check matrix with dependent rows is handled.
set -e # Stop if an error occurs
set -v # Echo commands as they are read
# CODE 1
make-pchk ex-dep.pchk 4 6 0:0 0:5 3:1 3:2
print-pchk -d ex-dep.pchk
echo 00011011 >ex-dep.src
# SPARSE REPRESENTATION
make-gen ex-dep.pchk ex-dep.gen sparse
print-gen -d ex-dep.gen
encode ex-dep.pchk ex-dep.gen ex-dep.src ex-dep.enc; cat ex-dep.enc
verify ex-dep.pchk ex-dep.enc ex-dep.gen ex-dep.src
# DENSE REPRESENTATION
make-gen ex-dep.pchk ex-dep.gen dense
print-gen -d ex-dep.gen
encode ex-dep.pchk ex-dep.gen ex-dep.src ex-dep.enc; cat ex-dep.enc
verify ex-dep.pchk ex-dep.enc ex-dep.gen ex-dep.src
# MIXED REPRESENTATION
make-gen ex-dep.pchk ex-dep.gen mixed
print-gen -d ex-dep.gen
encode ex-dep.pchk ex-dep.gen ex-dep.src ex-dep.enc; cat ex-dep.enc
verify ex-dep.pchk ex-dep.enc ex-dep.gen ex-dep.src
# CODE 2
make-pchk ex-dep.pchk 4 5 0:0 0:1 1:1 1:2 2:0 2:2 3:3 3:4
print-pchk -d ex-dep.pchk
echo 01 >ex-dep.src
# SPARSE REPRESENTATION
make-gen ex-dep.pchk ex-dep.gen sparse
print-gen -d ex-dep.gen
encode ex-dep.pchk ex-dep.gen ex-dep.src ex-dep.enc; cat ex-dep.enc
verify ex-dep.pchk ex-dep.enc ex-dep.gen ex-dep.src
# DENSE REPRESENTATION
make-gen ex-dep.pchk ex-dep.gen dense
print-gen -d ex-dep.gen
encode ex-dep.pchk ex-dep.gen ex-dep.src ex-dep.enc; cat ex-dep.enc
verify ex-dep.pchk ex-dep.enc ex-dep.gen ex-dep.src
# MIXED REPRESENTATION
make-gen ex-dep.pchk ex-dep.gen mixed
print-gen -d ex-dep.gen
encode ex-dep.pchk ex-dep.gen ex-dep.src ex-dep.enc; cat ex-dep.enc
verify ex-dep.pchk ex-dep.enc ex-dep.gen ex-dep.src