From 77f27a8c5e1f83a55cd639c50842d0d786585a36 Mon Sep 17 00:00:00 2001 From: Ahmet Inan Date: Wed, 10 Jun 2020 19:53:10 +0200 Subject: [PATCH] made T a template parameter --- short_bch_code_decoder.hh | 4 ++-- tests/short_bch_code_decoder_test.cc | 6 +++--- tests/short_bch_code_regression_test.cc | 2 +- tests/soft_bch_regression_test.cc | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/short_bch_code_decoder.hh b/short_bch_code_decoder.hh index e55d66e..d9ffbac 100644 --- a/short_bch_code_decoder.hh +++ b/short_bch_code_decoder.hh @@ -8,7 +8,7 @@ Copyright 2020 Ahmet Inan namespace CODE { -template +template class ShortBCHCodeDecoder { static const int P = N - K; @@ -35,7 +35,7 @@ class ShortBCHCodeDecoder return sum; } public: - ShortBCHCodeDecoder(int generator, int T) + ShortBCHCodeDecoder(int generator) { for (int i = 0; i < W; ++i) par[i] = modgen(i << P, generator); diff --git a/tests/short_bch_code_decoder_test.cc b/tests/short_bch_code_decoder_test.cc index 8f51a5b..1918590 100644 --- a/tests/short_bch_code_decoder_test.cc +++ b/tests/short_bch_code_decoder_test.cc @@ -17,7 +17,7 @@ int main() if (1) { // Perfect binary Golay code using x^11+x^9+x^7+x^6+x^5+x+1 const int N = 23, K = 12, T = 3, POLY = 0b101011100011; - CODE::ShortBCHCodeDecoder decode(POLY, T); + CODE::ShortBCHCodeDecoder decode(POLY); int target = 0b10101101101111011111001; int damaged = target; typedef std::uniform_int_distribution distribution; @@ -30,7 +30,7 @@ int main() if (1) { // Perfect binary Golay code using x^11+x^10+x^6+x^5+x^4+x^2+1 const int N = 23, K = 12, T = 3, POLY = 0b110001110101; - CODE::ShortBCHCodeDecoder decode(POLY, T); + CODE::ShortBCHCodeDecoder decode(POLY); int target = 0b10101101101100100010101; int damaged = target; typedef std::uniform_int_distribution distribution; @@ -43,7 +43,7 @@ int main() if (1) { // NASA INTRO BCH(15, 5) T=3 const int N = 15, K = 5, T = 3, POLY = 0b10100110111; - CODE::ShortBCHCodeDecoder decode(POLY, T); + CODE::ShortBCHCodeDecoder decode(POLY); int target = 0b110010001111010; int damaged = target; typedef std::uniform_int_distribution distribution; diff --git a/tests/short_bch_code_regression_test.cc b/tests/short_bch_code_regression_test.cc index ca47b9c..8ee5ac7 100644 --- a/tests/short_bch_code_regression_test.cc +++ b/tests/short_bch_code_regression_test.cc @@ -15,7 +15,7 @@ template void bch_test(int trials) { CODE::ShortBCHCodeEncoder encode(POLY); - CODE::ShortBCHCodeDecoder decode(POLY, T); + CODE::ShortBCHCodeDecoder decode(POLY); std::random_device rd; typedef std::default_random_engine generator; typedef std::uniform_int_distribution distribution; diff --git a/tests/soft_bch_regression_test.cc b/tests/soft_bch_regression_test.cc index 2005c4f..14c291b 100644 --- a/tests/soft_bch_regression_test.cc +++ b/tests/soft_bch_regression_test.cc @@ -55,7 +55,7 @@ int popcnt(TYPE x) int main() { CODE::ShortBCHCodeEncoder encode(GEN_POLY); - CODE::ShortBCHCodeDecoder decode(GEN_POLY, RADIUS_T); + CODE::ShortBCHCodeDecoder decode(GEN_POLY); std::random_device rd; std::default_random_engine generator(rd());