| 11 | |
| 12 | template<typename B, typename R> |
| 13 | Decoder_RA<B, R>::Decoder_RA(const int& K, const int& N, const Interleaver<R>& interleaver, int max_iter) |
| 14 | : Decoder_SIHO<B, R>(K, N) |
| 15 | , rep_count(N / K) |
| 16 | , max_iter(max_iter) |
| 17 | , Fw(N) |
| 18 | , Bw(N) |
| 19 | , Tu(N) |
| 20 | , Td(N) |
| 21 | , Wu(N) |
| 22 | , Wd(N) |
| 23 | , U(K) |
| 24 | , Xd(2) |
| 25 | , Xu(2) |
| 26 | , interleaver(interleaver.clone()) |
| 27 | { |
| 28 | const std::string name = "Decoder_RA"; |
| 29 | this->set_name(name); |
| 30 | for (auto& t : this->tasks) |
| 31 | t->set_replicability(true); |
| 32 | |
| 33 | if (max_iter <= 0) |
| 34 | { |
| 35 | std::stringstream message; |
| 36 | message << "'max_iter' has to be greater than 0 ('max_iter' = " << max_iter << ")."; |
| 37 | throw spu::tools::invalid_argument(__FILE__, __LINE__, __func__, message.str()); |
| 38 | } |
| 39 | |
| 40 | if (N % K) |
| 41 | { |
| 42 | std::stringstream message; |
| 43 | message << "'K' has to be a multiple of 'N' ('K' = " << K << ", 'N' = " << N << ")."; |
| 44 | throw spu::tools::invalid_argument(__FILE__, __LINE__, __func__, message.str()); |
| 45 | } |
| 46 | |
| 47 | if ((int)interleaver.get_core().get_size() != N) |
| 48 | { |
| 49 | std::stringstream message; |
| 50 | message << "'interleaver.get_core().get_size()' has to be equal to 'N' ('interleaver.get_core().get_size()' = " |
| 51 | << interleaver.get_core().get_size() << ", 'N' = " << N << ")."; |
| 52 | throw spu::tools::length_error(__FILE__, __LINE__, __func__, message.str()); |
| 53 | } |
| 54 | |
| 55 | Xd[0].resize(N); |
| 56 | Xd[1].resize(N); |
| 57 | Xu[0].resize(N); |
| 58 | Xu[1].resize(N); |
| 59 | |
| 60 | this->set_n_frames(interleaver.get_n_frames()); |
| 61 | } |
| 62 | |
| 63 | template<typename B, typename R> |
| 64 | Decoder_RA<B, R>* |
nothing calls this directly
no test coverage detected