mirror of
https://github.com/aicodix/code.git
synced 2026-04-27 14:30:36 +00:00
handle data and parity seperate in both BCH and RS
This commit is contained in:
parent
6b3bc5e534
commit
f545b5d6ab
8 changed files with 145 additions and 105 deletions
|
|
@ -28,7 +28,7 @@ int main()
|
|||
auto val = std::bind(std::uniform_int_distribution<RS::value_type>(0, RS::N), generator);
|
||||
for (int i = 0; i < 2; ++i)
|
||||
code[pos()] = val();
|
||||
decode(code);
|
||||
decode(code, code + RS::K);
|
||||
for (int i = 0; i < RS::N; ++i)
|
||||
assert(code[i] == target[i]);
|
||||
}
|
||||
|
|
@ -51,7 +51,7 @@ int main()
|
|||
auto val = std::bind(std::uniform_int_distribution<RS::value_type>(0, RS::N), generator);
|
||||
for (int i = 0; i < 8; ++i)
|
||||
code[pos()] = val();
|
||||
decode(code);
|
||||
decode(code, code + RS::K);
|
||||
for (int i = 0; i < RS::N; ++i)
|
||||
assert(code[i] == target[i]);
|
||||
}
|
||||
|
|
@ -74,7 +74,7 @@ int main()
|
|||
auto val = std::bind(std::uniform_int_distribution<RS::value_type>(0, RS::N), generator);
|
||||
for (int i = 0; i < 32; ++i)
|
||||
code[pos()] = val();
|
||||
(*decode)(code);
|
||||
(*decode)(code, code + RS::K);
|
||||
for (int i = 0; i < RS::N; ++i)
|
||||
assert(code[i] == target[i]);
|
||||
delete[] target;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue