moved ML method to bottom

This commit is contained in:
Ahmet Inan 2020-06-09 14:47:01 +02:00
commit e0423da509

View file

@ -60,24 +60,6 @@ public:
}
int operator()(const int8_t *code)
{
// maximum likelihood
if (0) {
int word = 0, best = -1, next = -1;
for (int msg = 0; msg < W; ++msg) {
int enc = (msg << P) | par[msg];
int met = metric(code, enc);
if (met > best) {
next = best;
best = met;
word = enc;
} else if (met > next) {
next = met;
}
}
if (best == next)
return -1;
return word;
}
int cw = 0;
for (int i = 0; i < N; ++i)
cw |= (code[i] < 0) << i;
@ -139,6 +121,20 @@ public:
}
}
}
// maximum likelihood
if (0) {
for (int msg = 0; msg < W; ++msg) {
int enc = (msg << P) | par[msg];
int met = metric(code, enc);
if (met > best) {
next = best;
best = met;
word = enc;
} else if (word != enc && met > next) {
next = met;
}
}
}
if (best == next)
return -1;
return word;