mirror of
https://github.com/aicodix/code.git
synced 2026-04-27 14:30:36 +00:00
use constants to avoid mistakes
This commit is contained in:
parent
5719ff8560
commit
f912be0335
7 changed files with 23 additions and 14 deletions
|
|
@ -9,15 +9,18 @@ Copyright 2018 Ahmet Inan <inan@aicodix.de>
|
|||
|
||||
namespace CODE {
|
||||
|
||||
template <int NR, int FCR, typename GF>
|
||||
template <int ROOTS, int FCR, typename GF>
|
||||
class ReedSolomonEncoder
|
||||
{
|
||||
public:
|
||||
typedef typename GF::value_type value_type;
|
||||
typedef typename GF::ValueType ValueType;
|
||||
typedef typename GF::IndexType IndexType;
|
||||
static const int NR = ROOTS;
|
||||
static const int N = GF::N, K = N - NR, NP = NR;
|
||||
private:
|
||||
IndexType generator[NR+1];
|
||||
public:
|
||||
ReedSolomonEncoder()
|
||||
{
|
||||
// $generator = \prod_{i=0}^{NR}(x-pe^{FCR+i})$
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue