IT++ Logo Newcom Logo

itpp::GF Class Reference

Galois Field GF(q). More...

#include <itpp/comm/galois.h>

List of all members.

Public Member Functions

 GF ()
 Constructor.
 GF (int qvalue)
 Constructor.
 GF (int qvalue, int inexp)
 Constructor.
 GF (const GF &ingf)
 Copy constructor.
void set (int qvalue, int inexp)
 GF(q) equals alpha ^ inexp.
void set (int qvalue, const bvec &vectorspace)
 GF(q) equals the element that corresponds to the given vector space.
void set_size (int qvalue)
 set q=2^mvalue
int get_size () const
 Return q.
bvec get_vectorspace () const
 Returns the vector space representation of GF(q).
int get_value () const
 Returns the alpha exponent.
int operator== (const GF &ingf) const
 Equality check.
int operator!= (const GF &ingf) const
 Not-equality check.
void operator= (const GF &ingf)
 GF(q) equals ingf.
void operator= (const int inexp)
 GF(q) equals alpha^inexp.
void operator+= (const GF &ingf)
 sum of two GF(q)
GF operator+ (const GF &ingf) const
 sum of two GF(q)
void operator-= (const GF &ingf)
 Difference of two GF(q), same as sum for q=2^m.
GF operator- (const GF &ingf) const
 Difference of two GF(q), same as sum for q=2^m.
void operator *= (const GF &ingf)
 product of two GF(q)
GF operator * (const GF &ingf) const
 product of two GF(q)
void operator/= (const GF &ingf)
 division of two GF(q)
GF operator/ (const GF &ingf) const
 product of two GF(q)

Friends

std::ostream & operator<< (std::ostream &os, const GF &ingf)
 Output stream for GF(q).


Detailed Description

Galois Field GF(q).

Author:
Tony Ottosson
Galois field GF(q), where q = 2^m. Possible m values is m = 1,2,...,16. Elements are given as exponents of the primitive element alpha. Observe that the zeroth element are given as "-1". ( log(0)=-Inf ).

The following primitve polynomials are used to construct the fields:

As indicated it is possible to use this class for binary elements, that is GF(2). However, this is less efficient in storage (each element take 5 bytes of memory) and in speed. If possible use the class BIN instead. Observe, also that the element "0" is called "-1" and "1" called "0".

Definition at line 76 of file galois.h.


Constructor & Destructor Documentation

itpp::GF::GF (  )  [inline]

Constructor.

Definition at line 79 of file galois.h.

itpp::GF::GF ( int  qvalue  )  [inline]

Constructor.

Definition at line 81 of file galois.h.

References set_size().

itpp::GF::GF ( int  qvalue,
int  inexp 
) [inline]

Constructor.

Definition at line 84 of file galois.h.

itpp::GF::GF ( const GF ingf  )  [inline]

Copy constructor.

Definition at line 86 of file galois.h.

References m, and value.


Member Function Documentation

void itpp::GF::set ( int  qvalue,
int  inexp 
) [inline]

GF(q) equals alpha ^ inexp.

Definition at line 89 of file galois.h.

References it_assert0, and set_size().

Referenced by itpp::Reed_Solomon::encode().

void itpp::GF::set ( int  qvalue,
const bvec &  vectorspace 
) [inline]

GF(q) equals the element that corresponds to the given vector space.

The format is (...,c,b,a), where the element x is given as x=...+c*alpha^2+b*alpha+a.

Definition at line 246 of file galois.h.

References itpp::bin2dec(), it_assert0, and set_size().

void itpp::GF::set_size ( int  qvalue  ) 

set q=2^mvalue

Definition at line 44 of file galois.cpp.

References it_assert, it_error_if, itpp::log2(), itpp::round_i(), itpp::Array< T >::set_size(), itpp::size(), and itpp::Array< T >::size().

Referenced by GF(), and set().

int itpp::GF::get_size (  )  const [inline]

Return q.

Definition at line 100 of file galois.h.

Referenced by itpp::operator *(), itpp::GFX::operator()(), and itpp::operator/().

bvec itpp::GF::get_vectorspace (  )  const [inline]

Returns the vector space representation of GF(q).

The format is (...,c,b,a), where the element x is given as x=...+c*alpha^2+b*alpha+a.

Definition at line 253 of file galois.h.

References itpp::dec2bin().

int itpp::GF::get_value (  )  const [inline]

Returns the alpha exponent.

Definition at line 263 of file galois.h.

int itpp::GF::operator== ( const GF ingf  )  const [inline]

Equality check.

Definition at line 268 of file galois.h.

References m, and value.

int itpp::GF::operator!= ( const GF ingf  )  const [inline]

Not-equality check.

Definition at line 278 of file galois.h.

void itpp::GF::operator= ( const GF ingf  )  [inline]

GF(q) equals ingf.

Definition at line 284 of file galois.h.

References m, and value.

void itpp::GF::operator= ( const int  inexp  )  [inline]

GF(q) equals alpha^inexp.

Definition at line 290 of file galois.h.

References it_assert0.

void itpp::GF::operator+= ( const GF ingf  )  [inline]

sum of two GF(q)

Definition at line 296 of file galois.h.

References it_assert0, m, and value.

GF itpp::GF::operator+ ( const GF ingf  )  const [inline]

sum of two GF(q)

Definition at line 308 of file galois.h.

void itpp::GF::operator-= ( const GF ingf  )  [inline]

Difference of two GF(q), same as sum for q=2^m.

Definition at line 315 of file galois.h.

GF itpp::GF::operator- ( const GF ingf  )  const [inline]

Difference of two GF(q), same as sum for q=2^m.

Definition at line 320 of file galois.h.

void itpp::GF::operator *= ( const GF ingf  )  [inline]

product of two GF(q)

Definition at line 327 of file galois.h.

References it_assert0, m, and value.

GF itpp::GF::operator * ( const GF ingf  )  const [inline]

product of two GF(q)

Definition at line 337 of file galois.h.

void itpp::GF::operator/= ( const GF ingf  )  [inline]

division of two GF(q)

Definition at line 344 of file galois.h.

References it_assert, it_assert0, m, and value.

GF itpp::GF::operator/ ( const GF ingf  )  const [inline]

product of two GF(q)

Definition at line 355 of file galois.h.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const GF ingf 
) [friend]

Output stream for GF(q).

Definition at line 94 of file galois.cpp.


The documentation for this class was generated from the following files:
SourceForge Logo

Generated on Wed Apr 18 11:20:04 2007 for IT++ by Doxygen 1.5.2