|
GNU Radio's DVBS2RX Package
|
Polynomial over GF(2^m). More...
#include <gf.h>
Public Member Functions | |
| gf2m_poly (const galois_field< T > *const gf, std::vector< T > &&coefs) | |
| Construct a new polynomial over GF(2^m). More... | |
| 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). More... | |
| gf2m_poly< T > | operator+ (const gf2m_poly< T > &x) const |
| GF(2^m) polynomial addition. More... | |
| gf2m_poly< T > | operator* (T x) const |
| Multiplication by a scalar. More... | |
| gf2m_poly< T > | operator* (const gf2m_poly< T > &x) const |
| Multiplication by another GF(2^m) polynomial. More... | |
| bool | operator== (const gf2m_poly< T > &x) const |
| Equal comparator. More... | |
| T | operator[] (uint32_t index) const |
| Access a polynomial coefficient. More... | |
| T | eval (T x) const |
| Evaluate the polynomial for a given GF(2^m) element. More... | |
| T | eval_by_exp (uint32_t i) const |
| Evaluate the polynomial for an element alpha^i given by its exponent i. More... | |
| 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. More... | |
| const std::vector< T > & | get_poly () const |
| Get the polynomial coefficients. More... | |
| int | degree () const |
| Get the polynomial degree. More... | |
| gf2_poly< T > | to_gf2_poly () const |
| Convert the polynomial to a GF(2) polynomial. More... | |
Polynomial over GF(2^m).
A polynomial whose coefficients are elements from a GF(2^m) extension field.
| T | Type used to represent each polynomial coefficient as a GF(2^m) element. |
| gr::dvbs2rx::gf2m_poly< T >::gf2m_poly | ( | const galois_field< T > *const | gf, |
| std::vector< T > && | coefs | ||
| ) |
Construct a new polynomial over GF(2^m).
| gf | Reference Galois field. |
| coefs | Polynomial coefficients. |
|
inline |
Construct a polynomial over GF(2^m) from a polynomial over GF(2).
| gf | Reference Galois field. |
| gf2_poly | Reference polynomial over GF(2). |
References gr::dvbs2rx::gf2_poly< T >::degree(), gr::dvbs2rx::gf2_poly< T >::get_poly(), and gr::dvbs2rx::is_bit_set().
|
inline |
Get the polynomial degree.
| T gr::dvbs2rx::gf2m_poly< T >::eval | ( | T | x | ) | const |
Evaluate the polynomial for a given GF(2^m) element.
Assuming the underlying polynomial is p(x), this function evaluates p(x) for a given x from GF(2^m).
| x | GF(2^m) value for which the polynomial should be evaluated. |
| T gr::dvbs2rx::gf2m_poly< T >::eval_by_exp | ( | uint32_t | i | ) | const |
Evaluate the polynomial for an element alpha^i given by its exponent i.
Assuming the underlying polynomial is p(x), this function evaluates p(x) for a given x from GF(2^m). The difference to the operator() is that this function takes x by its exponent i. If x = alpha^i, this function takes i as input instead of x.
| i | Exponent of the GF(2^m) value for which the polynomial should be evaluated. |
|
inline |
Get the polynomial coefficients.
Referenced by gr::dvbs2rx::gf2m_poly< T >::operator==().
| gf2m_poly< T > gr::dvbs2rx::gf2m_poly< T >::operator* | ( | const gf2m_poly< T > & | x | ) | const |
Multiplication by another GF(2^m) polynomial.
| x | Polynomial to multiply. |
| gf2m_poly< T > gr::dvbs2rx::gf2m_poly< T >::operator* | ( | T | x | ) | const |
Multiplication by a scalar.
| x | Scalar to multiply. |
| gf2m_poly< T > gr::dvbs2rx::gf2m_poly< T >::operator+ | ( | const gf2m_poly< T > & | x | ) | const |
GF(2^m) polynomial addition.
| x | Polynomial to add. |
|
inline |
Equal comparator.
| x | The other GF(2^m) polynomial. |
References gr::dvbs2rx::gf2m_poly< T >::get_poly().
|
inline |
Access a polynomial coefficient.
| index | Index of the target coefficient. |
| 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.
| 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. |
| gf2_poly< T > gr::dvbs2rx::gf2m_poly< T >::to_gf2_poly | ( | ) | const |
Convert the polynomial to a GF(2) polynomial.
Works when all coefficients of the local polynomial are either unit or zero such that it can be reduced to a polynomial over GF(2). Otherwise, throws runtime error.