property galois.BCH.c : int

The first consecutive power \(c\) of \(\alpha\) that defines the roots \(\alpha^c, \dots, \alpha^{c+d-2}\) of the generator polynomial \(g(x)\).

Examples

Construct a binary narrow-sense \(\textrm{BCH}(15, 7)\) code with first consecutive root \(\alpha\).

In [1]: bch = galois.BCH(15, 7); bch
Out[1]: <BCH Code: [15, 7, 5] over GF(2)>

In [2]: bch.c
Out[2]: 1

In [3]: bch.roots[0] == bch.alpha ** bch.c
Out[3]: True

Construct a binary non-narrow-sense \(\textrm{BCH}(15, 7)\) code with first consecutive root \(\alpha^3\). Notice the design distance of this code is only 3.

In [4]: bch = galois.BCH(15, 7, c=3); bch
Out[4]: <BCH Code: [15, 7, 3] over GF(2)>

In [5]: bch.c
Out[5]: 3

In [6]: bch.roots[0] == bch.alpha ** bch.c
Out[6]: True