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

Method Encoder_RS

src/Module/Encoder/RS/Encoder_RS.cpp:14–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12
13template<typename B>
14Encoder_RS<B>::Encoder_RS(const int& K, const int& N, const tools::RS_polynomial_generator& GF)
15 : Encoder<B>(K * GF.get_m(), N * GF.get_m())
16 , K_rs(K)
17 , N_rs(N)
18 , m(GF.get_m())
19 , n_rdncy_bits(GF.get_n_rdncy() * m)
20 , n_rdncy(GF.get_n_rdncy())
21 , alpha_to(GF.get_alpha_to())
22 , index_of(GF.get_index_of())
23 , g(GF.get_g())
24 , mt(GF.get_mt())
25 , bb(n_rdncy)
26 , packed_U_K(K_rs)
27 , packed_X_N(N_rs)
28{
29 const std::string name = "Encoder_RS";
30 this->set_name(name);
31 for (auto& t : this->tasks)
32 t->set_replicability(true);
33
34 if ((this->N_rs - this->K_rs) != n_rdncy)
35 {
36 std::stringstream message;
37 message << "'N_rs - K_rs' is different than 'n_rdncy' ('K_rs' = " << K_rs << ", 'N_rs' = " << N_rs
38 << ", 'n_rdncy' = " << n_rdncy << ", 'N_rs - K_rs' = " << (this->N_rs - this->K_rs) << ").";
39 throw spu::tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());
40 }
41
42 if ((int)sizeof(S) * CHAR_BIT < GF.get_m())
43 {
44 std::stringstream message;
45 message << "The given Galois Field is too big to be stored in a 'S' type ('S' = " << typeid(S).name()
46 << ", 'GF.get_m()' = " << GF.get_m() << ").";
47 throw spu::tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());
48 }
49
50 std::iota(
51 this->info_bits_pos.begin(), this->info_bits_pos.end(), n_rdncy); // redundancy on the first 'n_rdncy' bits
52}
53
54template<typename B>
55Encoder_RS<B>*

Callers

nothing calls this directly

Calls 2

get_mMethod · 0.80
get_n_rdncyMethod · 0.45

Tested by

no test coverage detected