| 10 | |
| 11 | template<typename B> |
| 12 | Encoder_RA<B>::Encoder_RA(const int& K, const int& N, const Interleaver<B>& interleaver) |
| 13 | : Encoder<B>(K, N) |
| 14 | , rep_count(N / K) |
| 15 | , U(N) |
| 16 | , tmp_X_N(N) |
| 17 | , interleaver(interleaver.clone()) |
| 18 | { |
| 19 | const std::string name = "Encoder_RA"; |
| 20 | this->set_name(name); |
| 21 | for (auto& t : this->tasks) |
| 22 | t->set_replicability(true); |
| 23 | this->set_sys(false); |
| 24 | |
| 25 | if (N % K) |
| 26 | { |
| 27 | std::stringstream message; |
| 28 | message << "'K' has to be a multiple of 'N' ('K' = " << K << ", 'N' = " << N << ")."; |
| 29 | throw spu::tools::invalid_argument(__FILE__, __LINE__, __func__, message.str()); |
| 30 | } |
| 31 | |
| 32 | if ((int)interleaver.get_core().get_size() != N) |
| 33 | { |
| 34 | std::stringstream message; |
| 35 | message << "'interleaver.get_core().get_size()' has to be equal to 'N' ('interleaver.get_core().get_size()' = " |
| 36 | << interleaver.get_core().get_size() << ", 'N' = " << N << ")."; |
| 37 | throw spu::tools::length_error(__FILE__, __LINE__, __func__, message.str()); |
| 38 | } |
| 39 | |
| 40 | for (auto k = 0; k < this->K; k++) |
| 41 | this->info_bits_pos[k] = rep_count * k; |
| 42 | |
| 43 | this->set_n_frames(this->interleaver->get_n_frames()); |
| 44 | } |
| 45 | |
| 46 | template<typename B> |
| 47 | Encoder_RA<B>* |
nothing calls this directly
no test coverage detected