mirror of
https://github.com/aicodix/code.git
synced 2026-04-27 14:30:36 +00:00
introduced L constant to play with the number
This commit is contained in:
parent
eccb5ea436
commit
945da60cbd
1 changed files with 7 additions and 6 deletions
|
|
@ -89,19 +89,20 @@ public:
|
|||
}
|
||||
// Chase algorithm
|
||||
if (K > 6) {
|
||||
int worst[T] = { 0 };
|
||||
const int L = T;
|
||||
int worst[L] = { 0 };
|
||||
for (int k = 0; k < N; ++k) {
|
||||
int j = 0;
|
||||
while (j < T && std::abs(code[worst[j]]) < std::abs(code[k]))
|
||||
while (j < L && std::abs(code[worst[j]]) < std::abs(code[k]))
|
||||
++j;
|
||||
for (int i = T-1; i > j; --i)
|
||||
for (int i = L-1; i > j; --i)
|
||||
worst[i] = worst[i-1];
|
||||
if (j < T)
|
||||
if (j < L)
|
||||
worst[j] = k;
|
||||
}
|
||||
for (int j = 1; j < (1 << T); ++j) {
|
||||
for (int j = 1; j < (1 << L); ++j) {
|
||||
int tmp = 0;
|
||||
for (int i = 0; i < T; ++i)
|
||||
for (int i = 0; i < L; ++i)
|
||||
tmp |= ((j>>i)&1) << worst[i];
|
||||
int dec = (*this)(cw ^ tmp);
|
||||
update(dec);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue