| 9 | |
| 10 | template<typename B> |
| 11 | Encoder_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 | |
| 40 | template<typename B> |
| 41 | int |
nothing calls this directly
no outgoing calls
no test coverage detected