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

Method Encoder_BCH

src/Module/Encoder/BCH/Encoder_BCH.cpp:12–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10
11template<typename B>
12Encoder_BCH<B>::Encoder_BCH(const int& K, const int& N, const tools::BCH_polynomial_generator<B>& GF_poly)
13 : Encoder<B>(K, N)
14 , n_rdncy(GF_poly.get_n_rdncy())
15 , g(GF_poly.get_g())
16 , bb(n_rdncy)
17{
18 const std::string name = "Encoder_BCH";
19 this->set_name(name);
20 for (auto& t : this->tasks)
21 t->set_replicability(true);
22
23 if ((this->N - this->K) != n_rdncy)
24 {
25 std::stringstream message;
26 message << "'N - K' is different than 'n_rdncy' ('K' = " << K << ", 'N' = " << N << ", 'n_rdncy' = " << n_rdncy
27 << ", 'N - K' = " << (this->N - this->K) << ").";
28 throw spu::tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());
29 }
30
31 std::iota(
32 this->info_bits_pos.begin(), this->info_bits_pos.end(), n_rdncy); // redundancy on the first 'n_rdncy' bits
33}
34
35template<typename B>
36Encoder_BCH<B>*

Callers

nothing calls this directly

Calls 1

get_n_rdncyMethod · 0.45

Tested by

no test coverage detected