![]()  | 
  
  
  
    rssoft
    0.0.0
    
   Reed-Solomon codes library with soft decision decoding 
   | 
  
  
  
 
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>

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::GFq & | gf | 
| Galois Field in use.   | |
| unsigned int | k | 
| k as in RS(n,k). n is the "size" of the Galois Field   | |
| const EvaluationValues & | evaluation_values | 
| Evaluation X,Y values of the code.   | |
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.
| rssoft::RS_Encoding::RS_Encoding | ( | const gf::GFq & | _gf, | 
| unsigned int | k, | ||
| const EvaluationValues & | _evaluation_values | ||
| ) | 
Constructor
| _gf | Galois Field in use | 
| _k | k as in RS(n,k). n is the "size" of the Galois Field | 
| _evaluation_values | Evaluation X,Y values of the code | 
                                                                                                      :
        gf(_gf),
        k(_k),
        evaluation_values(_evaluation_values)
{}
Destructor. Nothing special.
{}
| void rssoft::RS_Encoding::run | ( | const std::vector< gf::GFq_Symbol > & | message, | 
| std::vector< gf::GFq_Symbol > & | codeword | ||
| ) | const | 
Runs an encoding
| message | Message symbols to be encoded | 
| codeword | RS 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());
                }
        }
}

const EvaluationValues& rssoft::RS_Encoding::evaluation_values [protected] | 
        
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