GNU Radio's DVBS2RX Package
gr::dvbs2rx::gf2_poly< T > Class Template Reference

Polynomial over GF(2). More...

#include <gf.h>

Public Member Functions

 gf2_poly (const T &coefs)
 Construct a new GF(2) polynomial object.
 
gf2_poly< T > operator+ (const gf2_poly< T > &x) const
 GF(2) polynomial addition.
 
gf2_poly< T > operator* (bool x) const
 Multiplication by a GF(2) scalar.
 
gf2_poly< T > operator* (const gf2_poly< T > &x) const
 Multiplication by another GF(2) polynomial.
 
bool operator== (const gf2_poly< T > &x) const
 Equal comparator.
 
const T & get_poly () const
 Get the polynomial coefficients.
 
int degree () const
 Get the polynomial degree.
 
bool is_zero () const
 Test if the polynomial is the zero polynomial.
 

Detailed Description

template<typename T>
class gr::dvbs2rx::gf2_poly< T >

Polynomial over GF(2).

A polynomial whose coefficients are elements from GF(2), i.e., binary.

Template Parameters
TType whose bits represent the binary polynomial coefficients.

Constructor & Destructor Documentation

◆ gf2_poly()

template<typename T >
gr::dvbs2rx::gf2_poly< T >::gf2_poly ( const T & coefs)

Construct a new GF(2) polynomial object.

Parameters
coefsBinary coefficients.

Member Function Documentation

◆ degree()

template<typename T >
int gr::dvbs2rx::gf2_poly< T >::degree ( ) const
inline

Get the polynomial degree.

Returns
int Degree.
Note
By convention, the zero polynomial has degree -1.

Referenced by gr::dvbs2rx::build_gf2_poly_rem_lut(), gr::dvbs2rx::gf2m_poly< T >::gf2m_poly(), and gr::dvbs2rx::operator%().

◆ get_poly()

template<typename T >
const T & gr::dvbs2rx::gf2_poly< T >::get_poly ( ) const
inline

Get the polynomial coefficients.

Returns
T storage of polynomial coefficients.

Referenced by gr::dvbs2rx::gf2m_poly< T >::gf2m_poly(), gr::dvbs2rx::operator%(), gr::dvbs2rx::gf2_poly< T >::operator+(), and gr::dvbs2rx::gf2_poly< T >::operator==().

◆ is_zero()

template<typename T >
bool gr::dvbs2rx::gf2_poly< T >::is_zero ( ) const
inline

Test if the polynomial is the zero polynomial.

Returns
true if the polynomial is zero and false otherwise.

◆ operator*() [1/2]

template<typename T >
gf2_poly< T > gr::dvbs2rx::gf2_poly< T >::operator* ( bool x) const
inline

Multiplication by a GF(2) scalar.

Parameters
xBinary scalar to multiply.
Returns
gf2_poly Multiplication result.

◆ operator*() [2/2]

template<typename T >
gf2_poly< T > gr::dvbs2rx::gf2_poly< T >::operator* ( const gf2_poly< T > & x) const

Multiplication by another GF(2) polynomial.

Parameters
xPolynomial to multiply.
Returns
gf2_poly Multiplication result.

◆ operator+()

template<typename T >
gf2_poly< T > gr::dvbs2rx::gf2_poly< T >::operator+ ( const gf2_poly< T > & x) const
inline

GF(2) polynomial addition.

Parameters
xPolynomial to add.
Returns
gf2_poly Addition result.

References gr::dvbs2rx::gf2_poly< T >::get_poly().

◆ operator==()

template<typename T >
bool gr::dvbs2rx::gf2_poly< T >::operator== ( const gf2_poly< T > & x) const
inline

Equal comparator.

Parameters
xThe other GF(2^m) polynomial.
Returns
bool Whether they are equal.

References gr::dvbs2rx::gf2_poly< T >::get_poly().


The documentation for this class was generated from the following file: