mirror of
https://github.com/aicodix/code.git
synced 2026-04-27 14:30:36 +00:00
moved runtime assert for radius T to compile time
This commit is contained in:
parent
961e5b19fa
commit
8c2e824b4e
1 changed files with 1 additions and 1 deletions
|
|
@ -18,6 +18,7 @@ class ShortBCHCodeDecoder
|
|||
short par[W];
|
||||
static_assert(N < 8 * sizeof(err[0]), "codeword type not wide enough");
|
||||
static_assert(P < 8 * sizeof(par[0]), "parity type not wide enough");
|
||||
static_assert(T > 0 && T <= 4, "unsupported radius T");
|
||||
static int modgen(int inp, int gen)
|
||||
{
|
||||
for (int i = K-1; i >= 0; --i) {
|
||||
|
|
@ -40,7 +41,6 @@ public:
|
|||
for (int i = 0; i < W; ++i)
|
||||
par[i] = modgen(i << P, generator);
|
||||
err[0] = 0;
|
||||
assert(T > 0 && T <= 4);
|
||||
for (int a = 1<<(N-1); T >= 1 && a; a >>= 1) {
|
||||
err[modgen(a, generator)] = a;
|
||||
for (int b = a >> 1; T >= 2 && b; b >>= 1) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue