removed value_type interface on BCH to make room

This commit is contained in:
Ahmet Inan 2018-09-21 08:48:22 +02:00
commit e2b160385e
4 changed files with 4 additions and 16 deletions

View file

@ -62,14 +62,6 @@ public:
corrections_count += !!magnitudes[i];
return corrections_count;
}
int operator()(value_type *code, value_type *erasures = 0, int erasures_count = 0)
{
return (*this)(reinterpret_cast<ValueType *>(code), reinterpret_cast<IndexType *>(erasures), erasures_count);
}
int compute_syndromes(value_type *code, value_type *syndromes)
{
return compute_syndromes(reinterpret_cast<ValueType *>(code), reinterpret_cast<ValueType *>(syndromes));
}
};
}

View file

@ -75,10 +75,6 @@ public:
}
}
}
void operator()(value_type *code)
{
(*this)(reinterpret_cast<ValueType *>(code));
}
};
}

View file

@ -28,7 +28,7 @@ int main()
auto noise = std::bind(distribution, generator);
for (int i = 0; i < 3; ++i)
code[noise()] ^= 1;
decode(code);
decode(reinterpret_cast<GF::ValueType *>(code));
for (int i = 0; i < 15; ++i)
assert(code[i] == target[i]);
}
@ -51,7 +51,7 @@ int main()
auto noise = std::bind(distribution, generator);
for (int i = 0; i < 12; ++i)
code[noise()] ^= 1;
(*decode)(code);
(*decode)(reinterpret_cast<GF::ValueType *>(code));
for (int i = 0; i < 65535; ++i)
assert(code[i] == target[i]);
delete[] target;

View file

@ -19,7 +19,7 @@ int main()
BCH encode({0b10011, 0b11111, 0b00111});
uint8_t code[15] = { 1, 1, 0, 0, 1 };
uint8_t target[15] = { 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0 };
encode(code);
encode(reinterpret_cast<GF::ValueType *>(code));
for (int i = 0; i < 15; ++i)
assert(code[i] == target[i]);
}
@ -36,7 +36,7 @@ int main()
uint16_t parity[192] = { 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0 };
for (int i = 0; i < 192; ++i)
target[65343+i] = parity[i];
(*encode)(code);
(*encode)(reinterpret_cast<GF::ValueType *>(code));
for (int i = 0; i < 65535; ++i)
assert(code[i] == target[i]);
delete[] target;