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

Method _encode

src/Module/Encoder/LDPC/From_IRA/Encoder_LDPC_from_IRA.cpp:35–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33
34template<typename B>
35void
36Encoder_LDPC_from_IRA<B>::_encode(const B* U_K, B* X_N, const size_t /*frame_id*/)
37{
38 int M = this->N - this->K;
39
40 // Systematic part
41 std::copy_n(U_K, this->K, X_N);
42
43 // init the parity part
44 B* parity = X_N + this->K;
45 std::fill_n(parity, M, 0);
46
47 // Calculate parity part
48 for (auto& l : this->H.get_rows_from_col(0))
49 if (l < (unsigned)this->K) parity[0] ^= U_K[l];
50
51 for (auto i = 1; i < M; i++)
52 {
53 parity[i] = parity[i - 1];
54
55 for (auto& l : this->H.get_rows_from_col(i))
56 if (l < (unsigned)this->K) parity[i] ^= U_K[l];
57 }
58}
59
60template<typename B>
61void

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected