MCPcopy Create free account
hub / github.com/aff3ct/aff3ct / _encode

Method _encode

src/Module/Encoder/Repetition/Encoder_repetition_sys.cpp:44–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42
43template<typename B>
44void
45Encoder_repetition_sys<B>::_encode(const B* U_K, B* X_N, const size_t /*frame_id*/)
46{
47 // repetition
48 if (buffered_encoding)
49 {
50 // systematic bits
51 std::copy(U_K, U_K + this->K, X_N);
52
53 // parity bits
54 for (auto i = 1; i <= rep_count; i++)
55 std::copy(U_K, U_K + this->K, X_N + i * this->K);
56 }
57 else
58 {
59 for (auto i = 0; i < this->K; i++)
60 {
61 const auto off1 = i * (rep_count + 1);
62 const auto off2 = off1 + 1;
63
64 const auto bit = U_K[i];
65
66 X_N[off1] = bit; // systematic bit
67
68 // parity bits
69 for (auto j = 0; j < rep_count; j++)
70 X_N[off2 + j] = bit;
71 }
72 }
73}
74
75template<typename B>
76bool

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected