|
| gf2m_poly (const galois_field< T > *const gf, std::vector< T > &&coefs) |
| Construct a new polynomial over GF(2^m).
|
|
template<typename Y > |
| gf2m_poly (const galois_field< T > *const gf, const gf2_poly< Y > &gf2_poly) |
| Construct a polynomial over GF(2^m) from a polynomial over GF(2).
|
|
gf2m_poly< T > | operator+ (const gf2m_poly< T > &x) const |
| GF(2^m) polynomial addition.
|
|
gf2m_poly< T > | operator* (T x) const |
| Multiplication by a scalar.
|
|
gf2m_poly< T > | operator* (const gf2m_poly< T > &x) const |
| Multiplication by another GF(2^m) polynomial.
|
|
bool | operator== (const gf2m_poly< T > &x) const |
| Equal comparator.
|
|
T | operator[] (uint32_t index) const |
| Access a polynomial coefficient.
|
|
T | eval (T x) const |
| Evaluate the polynomial for a given GF(2^m) element.
|
|
T | eval_by_exp (uint32_t i) const |
| Evaluate the polynomial for an element alpha^i given by its exponent i.
|
|
std::vector< uint32_t > | search_roots_in_exp_range (uint32_t i_start, uint32_t i_end, uint32_t max_roots=std::numeric_limits< uint32_t >::max()) const |
| Search roots by evaluating the polynomial for elements in a given range.
|
|
const std::vector< T > & | get_poly () const |
| Get the polynomial coefficients.
|
|
int | degree () const |
| Get the polynomial degree.
|
|
gf2_poly< T > | to_gf2_poly () const |
| Convert the polynomial to a GF(2) polynomial.
|
|
template<typename T>
class gr::dvbs2rx::gf2m_poly< T >
Polynomial over GF(2^m).
A polynomial whose coefficients are elements from a GF(2^m) extension field.
- Template Parameters
-
T | Type used to represent each polynomial coefficient as a GF(2^m) element. |
template<typename T >
std::vector< uint32_t > gr::dvbs2rx::gf2m_poly< T >::search_roots_in_exp_range |
( |
uint32_t |
i_start, |
|
|
uint32_t |
i_end, |
|
|
uint32_t |
max_roots = std::numeric_limits< uint32_t >::max() |
|
) |
| const |
Search roots by evaluating the polynomial for elements in a given range.
Evaluates the polynomial for all alpha^i with i varying in [i_start, i_end] and returns the elements for which the polynomial evaluates to zero (the roots) given by their exponents. For instance, if alpha^2 and alpha^3 are roots of the polynomial, this function returns the vector [2, 3].
The implementation does not simply rely on the eval() or eval_by_exp() functions. Instead, it is optimized by leveraging the fact that the evaluation is for a contiguous range of exponents. Hence, when searching for polynomial roots in GF(2^m), it is preferable to use this function instead of manually calling the eval() or eval_by_exp() functions.
- Parameters
-
i_start | Exponent of element alpha^i_start at the start of the range. |
i_end | Exponent of element alpha^i_end at the end of the range. |
max_roots | Maximum number of roots to be returned. When defined, the search is stopped earlier as soon as this number of roots is found. |
- Returns
- std::vector<uint32_t> Vector with the exponents associated with the GF(2^m) roots found in the range.