Galois Field GF(2^m).
More...
#include <gf.h>
|
| galois_field (const gf2_poly< T > &prim_poly) |
| Construct a new Galois field object.
|
|
T | operator[] (uint32_t index) const |
| Get the GF(2^m) element at a given index on the elements table.
|
|
T | get_alpha_i (uint32_t i) const |
| Get the i-th power of the primitive element (alpha^i).
|
|
uint32_t | get_exponent (const T &beta) const |
| Get the exponent i of a given element beta = alpha^i.
|
|
T | multiply (const T &a, const T &b) const |
| Multiply two elements from GF(2^m).
|
|
T | inverse (const T &beta) const |
| Get the inverse beta^-1 from a GF(2^m) element beta.
|
|
T | inverse_by_exp (uint32_t i) const |
| Get the inverse from a GF(2^m) element alpha^i given by its exponent i.
|
|
T | divide (const T &a, const T &b) const |
| Divide two elements from GF(2^m).
|
|
std::set< T > | get_conjugates (const T &beta) const |
| Get the conjugates of element beta.
|
|
gf2_poly< T > | get_min_poly (const T &beta) const |
| Compute the minimal polynomial associated with element beta.
|
|
uint8_t | get_m () const |
| Get the dimension m of the GF(2^m) field.
|
|
template<typename T>
class gr::dvbs2rx::galois_field< T >
Galois Field GF(2^m).
- Template Parameters
-
T | Base type for the field elements. |
- Note
- See the reference implementation at https://github.com/igorauad/bch/blob/master/gf.py.
◆ galois_field()
Construct a new Galois field object.
- Parameters
-
prim_poly | Primitive polynomial that generates the field. |
◆ divide()
Divide two elements from GF(2^m).
- Parameters
-
- Returns
- T Quotient a/b.
◆ get_alpha_i()
Get the i-th power of the primitive element (alpha^i).
- Parameters
-
i | Exponent i of the target element alpha^i for i from 0 to "2**m - 2". |
- Returns
- T Element alpha^i.
- Note
- This function cannot obtain the zero (additive identity) element, given the zero element cannot be expressed as a power of the primitive element. To access the zero element, use the operator[] instead.
◆ get_conjugates()
Get the conjugates of element beta.
- Parameters
-
beta | The element whose conjugates are to be computed. |
- Returns
- std::set<T> The set of distinct conjugates alpha^(i^(2^l)) in GF(2^m) associated with element beta=alpha^i.
◆ get_exponent()
Get the exponent i of a given element beta = alpha^i.
- Parameters
-
beta | Element beta that is a power of the primitive element alpha. |
- Returns
- T Exponent i.
- Note
- This function cannot obtain the exponent of the zero (additive identity) element, given the zero element cannot be expressed as a power of the primitive element alpha. A runtime error exception is raised if beta is the zero element.
◆ get_m()
Get the dimension m of the GF(2^m) field.
- Returns
- uint8_t Dimension m.
◆ get_min_poly()
Compute the minimal polynomial associated with element beta.
Computes the polynomial phi(x) over GF(2) of smallest degree having beta as root. See the notes in the reference Python implementation.
- Parameters
-
- Returns
- gf2_poly Minimal polynomial of beta as a polynomial over GF(2).
◆ inverse()
Get the inverse beta^-1 from a GF(2^m) element beta.
- Parameters
-
- Returns
- T Inverse beta^-1.
◆ inverse_by_exp()
Get the inverse from a GF(2^m) element alpha^i given by its exponent i.
- Parameters
-
i | Exponent i of the element beta = alpha^i to be inverted. |
- Returns
- T Inverse beta^-1.
◆ multiply()
Multiply two elements from GF(2^m).
- Parameters
-
a | First multiplicand. |
b | Second multiplicand. |
- Returns
- T Product a*b.
◆ operator[]()
Get the GF(2^m) element at a given index on the elements table.
- Parameters
-
- Returns
- T GF(2^m) element.
The documentation for this class was generated from the following file: