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

Method Encoder_RSC_sys

src/Module/Encoder/RSC/Encoder_RSC_sys.cpp:11–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9
10template<typename B>
11Encoder_RSC_sys<B>::Encoder_RSC_sys(const int& K, const int& N, const int n_ff, const bool buffered_encoding)
12 : Encoder<B>(K, N)
13 , n_ff(n_ff)
14 , n_states(1 << n_ff)
15 , buffered_encoding(buffered_encoding)
16{
17 const std::string name = "Encoder_RSC_sys";
18 this->set_name(name);
19
20 if (n_ff <= 0)
21 {
22 std::stringstream message;
23 message << "'n_ff' has to be greater than 0 ('n_ff' = " << n_ff << ").";
24 throw spu::tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());
25 }
26
27 if (N - 2 * n_ff != 2 * K)
28 {
29 std::stringstream message;
30 message << "'N' - 2 * 'n_ff' has to be equal to 2 * 'K' ('N' = " << N << ", 'n_ff' = " << n_ff
31 << ", 'K' = " << K << ").";
32 throw spu::tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());
33 }
34
35 if (!buffered_encoding)
36 for (auto k = 0; k < this->K; k++)
37 this->info_bits_pos[k] = 2 * k;
38}
39
40template<typename B>
41int

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected