rssoft  0.0.0
Reed-Solomon codes library with soft decision decoding
rssoft::RS_Encoding Class Reference

Does the Reed-Solomon encoding of a message. his is the genuine, straightforward, non-systematic encoding that takes message symbols to build the successive coefficients of the encoding polynomial. Then this polynomial is evaluated at the evaluation points to make the codeword. More...

#include <RS_Encoding.h>

Collaboration diagram for rssoft::RS_Encoding:

List of all members.

Public Member Functions

 RS_Encoding (const gf::GFq &_gf, unsigned int k, const EvaluationValues &_evaluation_values)
 ~RS_Encoding ()
void run (const std::vector< gf::GFq_Symbol > &message, std::vector< gf::GFq_Symbol > &codeword) const

Protected Attributes

const gf::GFqgf
 Galois Field in use.
unsigned int k
 k as in RS(n,k). n is the "size" of the Galois Field
const EvaluationValuesevaluation_values
 Evaluation X,Y values of the code.

Detailed Description

Does the Reed-Solomon encoding of a message. his is the genuine, straightforward, non-systematic encoding that takes message symbols to build the successive coefficients of the encoding polynomial. Then this polynomial is evaluated at the evaluation points to make the codeword.


Constructor & Destructor Documentation

rssoft::RS_Encoding::RS_Encoding ( const gf::GFq _gf,
unsigned int  k,
const EvaluationValues _evaluation_values 
)

Constructor

Parameters:
_gfGalois Field in use
_kk as in RS(n,k). n is the "size" of the Galois Field
_evaluation_valuesEvaluation X,Y values of the code
                                                                                                      :
        gf(_gf),
        k(_k),
        evaluation_values(_evaluation_values)
{}

Destructor. Nothing special.

{}

Member Function Documentation

void rssoft::RS_Encoding::run ( const std::vector< gf::GFq_Symbol > &  message,
std::vector< gf::GFq_Symbol > &  codeword 
) const

Runs an encoding

Parameters:
messageMessage symbols to be encoded
codewordRS codeword in elements of GFq that will be built
{
        if (message.size() != k)
        {
                throw RSSoft_Exception("Invalid message length");
        }
        else
        {
                std::vector<gf::GFq_Symbol>::const_iterator s_it = message.begin();
                std::vector<gf::GFq_Element> encoding_coefficients;

                for(; s_it != message.end(); ++s_it)
                {
                        encoding_coefficients.push_back(gf::GFq_Element(gf, *s_it));
                }

                gf::GFq_Polynomial encoding_polynomial(gf, encoding_coefficients);
                codeword.clear();
                const std::vector<gf::GFq_Element>& evaluation_points = evaluation_values.get_evaluation_points();
                std::vector<gf::GFq_Element>::const_iterator evp_it = evaluation_points.begin();

                for (; evp_it != evaluation_points.end(); ++evp_it)
                {
                        codeword.push_back(encoding_polynomial(*evp_it).poly());
                }
        }
}

Here is the call graph for this function:


Member Data Documentation

Evaluation X,Y values of the code.

const gf::GFq& rssoft::RS_Encoding::gf [protected]

Galois Field in use.

unsigned int rssoft::RS_Encoding::k [protected]

k as in RS(n,k). n is the "size" of the Galois Field


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines