mirror of
https://github.com/aicodix/code.git
synced 2026-04-27 14:30:36 +00:00
moved code[j] out of the inner loop
This commit is contained in:
parent
d504673812
commit
8268ba3f85
2 changed files with 12 additions and 6 deletions
|
|
@ -23,12 +23,14 @@ public:
|
|||
int compute_syndromes(ValueType *code, ValueType *syndromes)
|
||||
{
|
||||
// $syndromes_i = code(pe^{FCR+i})$
|
||||
ValueType coeff(code[0]);
|
||||
for (int i = 0; i < NR; ++i)
|
||||
syndromes[i] = code[0];
|
||||
syndromes[i] = coeff;
|
||||
for (int j = 1; j < N; ++j) {
|
||||
ValueType coeff(code[j]);
|
||||
IndexType root(FCR), pe(1);
|
||||
for (int i = 0; i < NR; ++i) {
|
||||
syndromes[i] = fma(root, syndromes[i], code[j]);
|
||||
syndromes[i] = fma(root, syndromes[i], coeff);
|
||||
root *= pe;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue