rssoft  0.0.0
Reed-Solomon codes library with soft decision decoding
/shared/development/google_code/rssoft/library/lib/ReliabilityMatrix.h
Go to the documentation of this file.
00001 /*
00002  Copyright 2013 Edouard Griffiths <f4exb at free dot fr>
00003 
00004  This file is part of RSSoft. A Reed-Solomon Soft Decoding library
00005 
00006  This program is free software; you can redistribute it and/or modify
00007  it under the terms of the GNU General Public License as published by
00008  the Free Software Foundation; either version 2 of the License, or
00009  (at your option) any later version.
00010 
00011  This program is distributed in the hope that it will be useful,
00012  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  GNU General Public License for more details.
00015 
00016  You should have received a copy of the GNU General Public License
00017  along with this program; if not, write to the Free Software
00018  Foundation, Inc., 51 Franklin Street, Boston, MA  02110-1301  USA
00019 
00020  Reliability Matrix class. 
00021  Analog data is entered first then the normalization method is called to get the actual reliability data (probabilities).
00022 
00023  */
00024 
00025 #ifndef __RELIABILITY_MATRIX_H__
00026 #define __RELIABILITY_MATRIX_H__
00027 
00028 #include <iostream>
00029 
00030 namespace rssoft
00031 {
00032 
00036 class ReliabilityMatrix
00037 {
00038 public:
00044         ReliabilityMatrix(unsigned int nb_symbols_log2, unsigned int message_length);
00045     
00049     ReliabilityMatrix(const ReliabilityMatrix& relmat);
00050 
00054         ~ReliabilityMatrix();
00055 
00060         void enter_symbol_data(float *symbol_data);
00061 
00067         void enter_symbol_data(unsigned int message_symbol_index, float *symbol_data);
00068     
00072     void enter_erasure();
00073 
00077     void enter_erasure(unsigned int message_symbol_index);
00078 
00082         void normalize();
00083 
00087         void reset_message_symbol_count()
00088         {
00089                 _message_symbol_count = 0;
00090         }
00091 
00095         unsigned int get_nb_symbols_log2() const
00096         {
00097                 return _nb_symbols_log2;
00098         }
00099 
00103         unsigned int get_nb_symbols() const
00104         {
00105                 return _nb_symbols;
00106         }
00107 
00111         unsigned int get_message_length() const
00112         {
00113                 return _message_length;
00114         }
00115 
00119         float& operator()(unsigned int i_row, unsigned int i_col)
00120         {
00121                 return _matrix[_nb_symbols*i_col + i_row];
00122         }
00123     
00127         const float& operator()(unsigned int i_row, unsigned int i_col) const
00128         {
00129                 return _matrix[_nb_symbols*i_col + i_row];
00130         }
00131     
00135     const float *get_raw_matrix() const
00136     {
00137         return _matrix;
00138     }
00139     
00143     float find_max(unsigned int& i_row, unsigned int& i_col) const;
00144 
00148         friend std::ostream& operator <<(std::ostream& os, const ReliabilityMatrix& matrix);
00149     
00150 
00151 protected:
00152         unsigned int _nb_symbols_log2;
00153         unsigned int _nb_symbols;
00154         unsigned int _message_length;
00155         unsigned int _message_symbol_count; 
00156         float *_matrix; 
00157 };
00158 
00159 
00160 }
00161 
00162 #endif // __RELIABILITY_MATRIX_H__
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines