property galois.ReedSolomon.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 narrow-sense $$\textrm{RS}(15, 9)$$ code over $$\mathrm{GF}(2^4)$$ with first consecutive root $$\alpha$$.

In : rs = galois.ReedSolomon(15, 9); rs
Out: <Reed-Solomon Code: [15, 9, 7] over GF(2^4)>

In : rs.c
Out: 1

In : rs.roots == rs.alpha ** rs.c
Out: True

In : rs.generator_poly
Out: Poly(x^6 + 7x^5 + 9x^4 + 3x^3 + 12x^2 + 10x + 12, GF(2^4))


Construct a narrow-sense $$\textrm{RS}(15, 9)$$ code over $$\mathrm{GF}(2^4)$$ with first consecutive root $$\alpha^3$$. Notice the design distance is the same, however the generator polynomial is different.

In : rs = galois.ReedSolomon(15, 9, c=3); rs
Out: <Reed-Solomon Code: [15, 9, 7] over GF(2^4)>

In : rs.c
Out: 3

In : rs.roots == rs.alpha ** rs.c
Out: True

In : rs.generator_poly
Out: Poly(x^6 + 15x^5 + 8x^4 + 7x^3 + 9x^2 + 3x + 8, GF(2^4))