galois.ReedSolomon.__str__() str

A formatted string with relevant properties of the Reed-Solomon code.

Examples

Construct a primitive, narrow-sense \(\textrm{RS}(255, 223)\) code over \(\mathrm{GF}(2^8)\).

In [1]: rs = galois.ReedSolomon(255, 223)

In [2]: print(rs)
Reed-Solomon Code:
  [n, k, d]: [255, 223, 33]
  field: GF(2^8)
  generator_poly: x^32 + 232x^31 + 29x^30 + 189x^29 + 50x^28 + 142x^27 + 246x^26 + 232x^25 + 15x^24 + 43x^23 + 82x^22 + 164x^21 + 238x^20 + x^19 + 158x^18 + 13x^17 + 119x^16 + 158x^15 + 224x^14 + 134x^13 + 227x^12 + 210x^11 + 163x^10 + 50x^9 + 107x^8 + 40x^7 + 27x^6 + 104x^5 + 253x^4 + 24x^3 + 239x^2 + 216x + 45
  is_primitive: True
  is_narrow_sense: True
  is_systematic: True

Construct a non-primitive, narrow-sense \(\textrm{RS}(85, 65)\) code over \(\mathrm{GF}(2^8)\).

In [3]: rs = galois.ReedSolomon(85, 65, field=galois.GF(2**8))

In [4]: print(rs)
Reed-Solomon Code:
  [n, k, d]: [85, 65, 21]
  field: GF(2^8)
  generator_poly: x^20 + 126x^19 + 190x^18 + 191x^17 + 96x^16 + 116x^15 + 137x^14 + 26x^13 + 203x^12 + 23x^11 + 208x^10 + 130x^9 + 104x^8 + 53x^7 + 188x^6 + 94x^5 + 146x^4 + 182x^3 + 210x^2 + 18x + 59
  is_primitive: False
  is_narrow_sense: True
  is_systematic: True