39 B =
"0 1 1 1 1 1 1 1 1 1 1 1;1 1 1 0 1 1 1 0 0 0 1 0;1 1 0 1 1 1 0 0 0 1 0 1;1 0 1 1 1 0 0 0 1 0 1 1;1 1 1 1 0 0 0 1 0 1 1 0;1 1 1 0 0 0 1 0 1 1 0 1;1 1 0 0 0 1 0 1 1 0 1 1;1 0 0 0 1 0 1 1 0 1 1 1;1 0 0 1 0 1 1 0 1 1 1 0;1 0 1 0 1 1 0 1 1 1 0 0;1 1 0 1 1 0 1 1 1 0 0 0;1 0 1 1 0 1 1 1 0 0 0 1";
46 int no_bits = uncoded_bits.length();
47 int no_blocks =
floor_i(no_bits / 12.0);
49 coded_bits.set_size(24*no_blocks,
false);
53 for (i = 0; i < no_blocks; i++)
54 coded_bits.replace_mid(24*i, Gt * uncoded_bits.mid(i*12, 12));
60 encode(uncoded_bits, coded_bits);
66 int no_bits = coded_bits.length();
67 int no_blocks =
floor_i(no_bits / 24.0);
69 decoded_bits.set_size(12*no_blocks,
false);
71 bvec S(12), BS(12), r(12), temp(12), e(24), c(24);
74 for (i = 0; i < no_blocks; i++) {
75 r = coded_bits.mid(i * 24, 24);
85 for (j = 0; j < 12; j++) {
87 temp = S + B.get_col(j);
89 e =
concat(temp, eyetemp.get_row(j));
104 for (j = 0; j < 12; j++) {
105 temp = BS + B.get_row(j);
107 e =
concat(eyetemp.get_row(j), temp);
118 decoded_bits.replace_mid(i*12, c.left(12));
125 decode(coded_bits, decoded_bits);
133 it_error(
"Extended_Golay::decode(vec, bvec); soft-decision decoding is not implemented");
138 it_error(
"Extended_Golay::decode(vec, bvec); soft-decision decoding is not implemented");