diff --git a/pac_encoder.hh b/pac_encoder.hh index 1c6ce4e..6b642d1 100644 --- a/pac_encoder.hh +++ b/pac_encoder.hh @@ -26,7 +26,7 @@ class PACEncoder return output; } public: - void operator()(TYPE *codeword, const TYPE *message, const int *rank_map, int mesg_bits, int level) + void operator()(TYPE *codeword, const TYPE *message, const uint8_t *rank_map, int mesg_bits, int level) { int length = 1 << level; int state = 0; diff --git a/pac_list_decoder.hh b/pac_list_decoder.hh index 74ec39e..ec8eb60 100644 --- a/pac_list_decoder.hh +++ b/pac_list_decoder.hh @@ -18,7 +18,7 @@ struct PACListTree typedef typename PH::PATH PATH; typedef typename PH::MAP MAP; static const int N = 1 << M; - static MAP decode(PATH *metric, TYPE *message, MAP *maps, int *count, int *state, TYPE *hard, TYPE *soft, const int *rank, int frozen) + static MAP decode(PATH *metric, TYPE *message, MAP *maps, int *count, int *state, TYPE *hard, TYPE *soft, const uint8_t *rank, int frozen) { for (int i = 0; i < N/2; ++i) soft[i+N/2] = PH::prod(soft[i+N], soft[i+N/2+N]); @@ -97,7 +97,7 @@ struct PACListTree *hard = hrd; return map; } - static MAP decode(PATH *metric, TYPE *message, MAP *maps, int *count, int *state, TYPE *hard, TYPE *soft, const int *rank, int frozen) + static MAP decode(PATH *metric, TYPE *message, MAP *maps, int *count, int *state, TYPE *hard, TYPE *soft, const uint8_t *rank, int frozen) { soft[1] = PH::prod(soft[2], soft[3]); MAP lmap, rmap; @@ -118,7 +118,7 @@ struct PACListTree template class PACListDecoder { - static_assert(MAX_M >= 5 && MAX_M <= 16); + static_assert(MAX_M >= 5 && MAX_M <= 8); typedef PolarHelper PH; typedef typename TYPE::value_type VALUE; typedef typename PH::PATH PATH; @@ -128,7 +128,7 @@ class PACListDecoder TYPE hard[MAX_N]; MAP maps[MAX_N]; public: - void operator()(int *rank, TYPE *message, const VALUE *codeword, const int *rank_map, int mesg_bits, int level) + void operator()(int *rank, TYPE *message, const VALUE *codeword, const uint8_t *rank_map, int mesg_bits, int level) { assert(level <= MAX_M); PATH metric[TYPE::SIZE]; @@ -149,14 +149,6 @@ public: case 6: PACListTree::decode(metric, message, maps, &count, state, hard, soft, rank_map, frozen); break; case 7: PACListTree::decode(metric, message, maps, &count, state, hard, soft, rank_map, frozen); break; case 8: PACListTree::decode(metric, message, maps, &count, state, hard, soft, rank_map, frozen); break; - case 9: PACListTree::decode(metric, message, maps, &count, state, hard, soft, rank_map, frozen); break; - case 10: PACListTree::decode(metric, message, maps, &count, state, hard, soft, rank_map, frozen); break; - case 11: PACListTree::decode(metric, message, maps, &count, state, hard, soft, rank_map, frozen); break; - case 12: PACListTree::decode(metric, message, maps, &count, state, hard, soft, rank_map, frozen); break; - case 13: PACListTree::decode(metric, message, maps, &count, state, hard, soft, rank_map, frozen); break; - case 14: PACListTree::decode(metric, message, maps, &count, state, hard, soft, rank_map, frozen); break; - case 15: PACListTree::decode(metric, message, maps, &count, state, hard, soft, rank_map, frozen); break; - case 16: PACListTree::decode(metric, message, maps, &count, state, hard, soft, rank_map, frozen); break; default: assert(false); } diff --git a/tests/pac_list_regression_test.cc b/tests/pac_list_regression_test.cc index 113e923..3985fa7 100644 --- a/tests/pac_list_regression_test.cc +++ b/tests/pac_list_regression_test.cc @@ -20,7 +20,7 @@ Copyright 2025 Ahmet Inan int main() { - const int MAX_M = 10; + const int MAX_M = 8; const int MAX_N = 1 << MAX_M; const int M = 7; const int N = 1 << M; @@ -52,7 +52,7 @@ int main() auto rel_seq = new int[MAX_N]; (*construct)(rel_seq, MAX_M); delete construct; - auto rank_map = new int[N]; + auto rank_map = new uint8_t[N]; for (int i = 0, j = 0; i < MAX_N && j < N; ++i) { int index = rel_seq[i]; if (index < N)