| 10 | |
| 11 | template<typename B> |
| 12 | Encoder_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 | |
| 35 | template<typename B> |
| 36 | Encoder_BCH<B>* |
nothing calls this directly
no test coverage detected