| 4 | #include "Tools/Code/Polar/fb_assert.h" |
| 5 | |
| 6 | void |
| 7 | aff3ct::tools::fb_assert(const std::vector<bool>& frozen_bits, const int K, const int N) |
| 8 | { |
| 9 | if (frozen_bits.size() != (size_t)N) |
| 10 | { |
| 11 | std::stringstream message; |
| 12 | message << "The frozen_bits size is invalid ('N' = " << N << ", 'Size' = " << frozen_bits.size() << ")."; |
| 13 | throw spu::tools::runtime_error(__FILE__, __LINE__, __func__, message.str()); |
| 14 | } |
| 15 | |
| 16 | auto k = 0; |
| 17 | for (auto i = 0; i < N; i++) |
| 18 | if (frozen_bits[i] == 0) k++; |
| 19 | |
| 20 | if (K != k) |
| 21 | { |
| 22 | std::stringstream message; |
| 23 | message << "The number of information bits in the frozen_bits is invalid ('K' = " << K << ", 'k' = " << k |
| 24 | << ")."; |
| 25 | throw spu::tools::runtime_error(__FILE__, __LINE__, __func__, message.str()); |
| 26 | } |
| 27 | } |
nothing calls this directly
no outgoing calls
no test coverage detected