root/doc/html/ldpc_8h-source.html @ 353

Revision 353, 71.7 kB (checked in by smidl, 16 years ago)

doc

RevLine 
[353]1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
3<title>mixpp: ldpc.h Source File</title>
4<link href="tabs.css" rel="stylesheet" type="text/css">
5<link href="doxygen.css" rel="stylesheet" type="text/css">
6</head><body>
7<!-- Generated by Doxygen 1.5.8 -->
8<script type="text/javascript">
9<!--
10function changeDisplayState (e){
11  var num=this.id.replace(/[^[0-9]/g,'');
12  var button=this.firstChild;
13  var sectionDiv=document.getElementById('dynsection'+num);
14  if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
15    sectionDiv.style.display='block';
16    button.src='open.gif';
17  }else{
18    sectionDiv.style.display='none';
19    button.src='closed.gif';
20  }
21}
22function initDynSections(){
23  var divs=document.getElementsByTagName('div');
24  var sectionCounter=1;
25  for(var i=0;i<divs.length-1;i++){
26    if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
27      var header=divs[i];
28      var section=divs[i+1];
29      var button=header.firstChild;
30      if (button!='IMG'){
31        divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
32        button=document.createElement('img');
33        divs[i].insertBefore(button,divs[i].firstChild);
34      }
35      header.style.cursor='pointer';
36      header.onclick=changeDisplayState;
37      header.id='dynheader'+sectionCounter;
38      button.src='closed.gif';
39      section.id='dynsection'+sectionCounter;
40      section.style.display='none';
41      section.style.marginLeft='14px';
42      sectionCounter++;
43    }
44  }
45}
46window.onload = initDynSections;
47-->
48</script>
49<div class="navigation" id="top">
50  <div class="tabs">
51    <ul>
52      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
53      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
54      <li><a href="modules.html"><span>Modules</span></a></li>
55      <li><a href="annotated.html"><span>Classes</span></a></li>
56      <li class="current"><a href="files.html"><span>Files</span></a></li>
57    </ul>
58  </div>
59  <div class="tabs">
60    <ul>
61      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
62      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
63    </ul>
64  </div>
65<h1>ldpc.h</h1><a href="ldpc_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001
66<a name="l00029"></a>00029 <span class="preprocessor">#ifndef LDPC_H</span>
67<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#define LDPC_H</span>
68<a name="l00031"></a>00031 <span class="preprocessor"></span>
69<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;iostream&gt;</span>
70<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;<a class="code" href="gf2mat_8h.html" title="Definition of a class for algebra on GF(2) (binary) matrices.">itpp/base/gf2mat.h</a>&gt;</span>
71<a name="l00034"></a>00034 <span class="preprocessor">#include &lt;<a class="code" href="random_8h.html" title="Definition of classes for random number generators.">itpp/base/random.h</a>&gt;</span>
72<a name="l00035"></a>00035 <span class="preprocessor">#include &lt;<a class="code" href="sort_8h.html" title="Sorting functions.">itpp/base/sort.h</a>&gt;</span>
73<a name="l00036"></a>00036 <span class="preprocessor">#include &lt;<a class="code" href="llr_8h.html" title="Class for numerically efficient log-likelihood algebra.">itpp/comm/llr.h</a>&gt;</span>
74<a name="l00037"></a>00037 <span class="preprocessor">#include &lt;<a class="code" href="channel__code_8h.html" title="Channel Code class virtual interface.">itpp/comm/channel_code.h</a>&gt;</span>
75<a name="l00038"></a>00038
76<a name="l00039"></a>00039 <span class="keyword">namespace </span>itpp
77<a name="l00040"></a>00040 {
78<a name="l00041"></a>00041
79<a name="l00042"></a>00042 <span class="comment">// ---------------------------------------------------------------------------</span>
80<a name="l00043"></a>00043 <span class="comment">// LDPC_Parity</span>
81<a name="l00044"></a>00044 <span class="comment">// ---------------------------------------------------------------------------</span>
82<a name="l00045"></a>00045
83<a name="l00070"></a><a class="code" href="classitpp_1_1LDPC__Parity.html">00070</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1LDPC__Parity.html" title="LDPC parity check matrix generic class.">LDPC_Parity</a>
84<a name="l00071"></a>00071 {
85<a name="l00072"></a>00072   <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classitpp_1_1LDPC__Code.html" title="Low-density parity check (LDPC) codec.">LDPC_Code</a>;
86<a name="l00073"></a>00073 <span class="keyword">public</span>:
87<a name="l00075"></a><a class="code" href="classitpp_1_1LDPC__Parity.html#3ae2282a30cfe515f65b1f176857e235">00075</a>   <a class="code" href="classitpp_1_1LDPC__Parity.html#3ae2282a30cfe515f65b1f176857e235" title="Default constructor.">LDPC_Parity</a>(): <a class="code" href="classitpp_1_1LDPC__Parity.html#74998d26a4dd6057f3a8be6ac4f2c5c1" title="Flag that indicates proper initialization.">init_flag</a>(false) {}
88<a name="l00076"></a>00076
89<a name="l00078"></a>00078   <a class="code" href="classitpp_1_1LDPC__Parity.html#3ae2282a30cfe515f65b1f176857e235" title="Default constructor.">LDPC_Parity</a>(<span class="keywordtype">int</span> <a class="code" href="classitpp_1_1LDPC__Parity.html#82403ae65de864fdbe4fcdd4d83caff2" title="Number of check nodes.">ncheck</a>, <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1LDPC__Parity.html#7e8697111c53562022e2f367593366c7" title="Number of variable nodes.">nvar</a>);
90<a name="l00079"></a>00079
91<a name="l00091"></a>00091   <a class="code" href="classitpp_1_1LDPC__Parity.html#3ae2282a30cfe515f65b1f176857e235" title="Default constructor.">LDPC_Parity</a>(<span class="keyword">const</span> std::string&amp; filename, <span class="keyword">const</span> std::string&amp; format);
92<a name="l00092"></a>00092
93<a name="l00094"></a>00094   <a class="code" href="classitpp_1_1LDPC__Parity.html#3ae2282a30cfe515f65b1f176857e235" title="Default constructor.">LDPC_Parity</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1GF2mat__sparse__alist.html" title="Parameterized &amp;quot;alist&amp;quot; representation of sparse GF(2) matrix.">GF2mat_sparse_alist</a>&amp; alist);
94<a name="l00095"></a>00095
95<a name="l00097"></a><a class="code" href="classitpp_1_1LDPC__Parity.html#ce714f0d15ba9b6056792fa1dde5d4ff">00097</a>   <span class="keyword">virtual</span> <a class="code" href="classitpp_1_1LDPC__Parity.html#ce714f0d15ba9b6056792fa1dde5d4ff" title="Virtual destructor.">~LDPC_Parity</a>() {}
96<a name="l00098"></a>00098
97<a name="l00100"></a>00100   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Parity.html#f43eb94744828d0203ecef66f10ea252" title="Initialize an empty matrix of size ncheck x nvar.">initialize</a>(<span class="keywordtype">int</span> <a class="code" href="classitpp_1_1LDPC__Parity.html#82403ae65de864fdbe4fcdd4d83caff2" title="Number of check nodes.">ncheck</a>, <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1LDPC__Parity.html#7e8697111c53562022e2f367593366c7" title="Number of variable nodes.">nvar</a>);
98<a name="l00101"></a>00101
99<a name="l00103"></a><a class="code" href="classitpp_1_1LDPC__Parity.html#5943f4ca9d8b00dca5fd85f603b4b1c0">00103</a>   <a class="code" href="classitpp_1_1Sparse__Mat.html">GF2mat_sparse</a> <a class="code" href="classitpp_1_1LDPC__Parity.html#5943f4ca9d8b00dca5fd85f603b4b1c0" title="Get the parity check matrix, optionally its transposed form.">get_H</a>(<span class="keywordtype">bool</span> transpose = <span class="keyword">false</span>)<span class="keyword"> const </span>{
100<a name="l00104"></a>00104     <span class="keywordflow">return</span> (<a class="code" href="group__matrix__functions.html#g22c587fbc615e295f2b881c2e5025006" title="Transposition of the matrix m returning the transposed matrix in out.">transpose</a> ? <a class="code" href="classitpp_1_1LDPC__Parity.html#0355499a802f0aeb3cb1b5f720fdc924" title="The transposed parity check matrix.">Ht</a> : <a class="code" href="classitpp_1_1LDPC__Parity.html#f51c1108ec92883ef46a55083e7263ec" title="The parity check matrix.">H</a>);
101<a name="l00105"></a>00105   }
102<a name="l00106"></a>00106
103<a name="l00108"></a><a class="code" href="classitpp_1_1LDPC__Parity.html#b033b6ca4ab2b951cc503e05d6c9a61b">00108</a>   <a class="code" href="classitpp_1_1Sparse__Vec.html">Sparse_Vec&lt;bin&gt;</a> <a class="code" href="classitpp_1_1LDPC__Parity.html#b033b6ca4ab2b951cc503e05d6c9a61b" title="Get a specific column from the matrix.">get_col</a>(<span class="keywordtype">int</span> c)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1LDPC__Parity.html#f51c1108ec92883ef46a55083e7263ec" title="The parity check matrix.">H</a>.<a class="code" href="classitpp_1_1Sparse__Mat.html#9b9759f1df3016d2004ee6a0d347d0ca" title="Returns column c of the Sparse_Mat in the Sparse_Vec v.">get_col</a>(c); }
104<a name="l00109"></a>00109
105<a name="l00111"></a><a class="code" href="classitpp_1_1LDPC__Parity.html#2740d5f207c00bbcfcd610d9aa96527e">00111</a>   <a class="code" href="classitpp_1_1Sparse__Vec.html">Sparse_Vec&lt;bin&gt;</a> <a class="code" href="classitpp_1_1LDPC__Parity.html#2740d5f207c00bbcfcd610d9aa96527e" title="Get a specific row from the matrix.">get_row</a>(<span class="keywordtype">int</span> r)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1LDPC__Parity.html#0355499a802f0aeb3cb1b5f720fdc924" title="The transposed parity check matrix.">Ht</a>.<a class="code" href="classitpp_1_1Sparse__Mat.html#9b9759f1df3016d2004ee6a0d347d0ca" title="Returns column c of the Sparse_Mat in the Sparse_Vec v.">get_col</a>(r); }
106<a name="l00112"></a>00112
107<a name="l00114"></a><a class="code" href="classitpp_1_1LDPC__Parity.html#7e63f3e0488b7c8b0402b7ca2b659f14">00114</a>   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1LDPC__Parity.html#7e63f3e0488b7c8b0402b7ca2b659f14" title="Get the number of variable nodes (number of columns).">get_nvar</a>()<span class="keyword"> const </span>{
108<a name="l00115"></a>00115     <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>(<a class="code" href="classitpp_1_1LDPC__Parity.html#f51c1108ec92883ef46a55083e7263ec" title="The parity check matrix.">H</a>.<a class="code" href="classitpp_1_1Sparse__Mat.html#18ab90bb7cd0db31722374889e3d74c8" title="Returns the number of columns of the sparse matrix.">cols</a>() == <a class="code" href="classitpp_1_1LDPC__Parity.html#7e8697111c53562022e2f367593366c7" title="Number of variable nodes.">nvar</a>,
109<a name="l00116"></a>00116                     <span class="stringliteral">"LDPC_Parity::get_nvar(): Internal error"</span>);
110<a name="l00117"></a>00117     <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>(<a class="code" href="classitpp_1_1LDPC__Parity.html#0355499a802f0aeb3cb1b5f720fdc924" title="The transposed parity check matrix.">Ht</a>.<a class="code" href="classitpp_1_1Sparse__Mat.html#98f82f4aca56a2b8083df057f0c5c359" title="Returns the number of rows of the sparse matrix.">rows</a>() == <a class="code" href="classitpp_1_1LDPC__Parity.html#7e8697111c53562022e2f367593366c7" title="Number of variable nodes.">nvar</a>,
111<a name="l00118"></a>00118                     <span class="stringliteral">"LDPC_Parity::get_nvar(): Internal error"</span>);
112<a name="l00119"></a>00119     <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1LDPC__Parity.html#7e8697111c53562022e2f367593366c7" title="Number of variable nodes.">nvar</a>;
113<a name="l00120"></a>00120   }
114<a name="l00121"></a>00121
115<a name="l00123"></a><a class="code" href="classitpp_1_1LDPC__Parity.html#187f147ffeca6c2744235cbf27ce22f3">00123</a>   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1LDPC__Parity.html#187f147ffeca6c2744235cbf27ce22f3" title="Get the number of check nodes (number of rows).">get_ncheck</a>()<span class="keyword"> const </span>{
116<a name="l00124"></a>00124     <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>(<a class="code" href="classitpp_1_1LDPC__Parity.html#f51c1108ec92883ef46a55083e7263ec" title="The parity check matrix.">H</a>.<a class="code" href="classitpp_1_1Sparse__Mat.html#98f82f4aca56a2b8083df057f0c5c359" title="Returns the number of rows of the sparse matrix.">rows</a>() == <a class="code" href="classitpp_1_1LDPC__Parity.html#82403ae65de864fdbe4fcdd4d83caff2" title="Number of check nodes.">ncheck</a>,
117<a name="l00125"></a>00125                     <span class="stringliteral">"LDPC_Parity::get_ncheck(): Internal error"</span>);
118<a name="l00126"></a>00126     <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>(<a class="code" href="classitpp_1_1LDPC__Parity.html#0355499a802f0aeb3cb1b5f720fdc924" title="The transposed parity check matrix.">Ht</a>.<a class="code" href="classitpp_1_1Sparse__Mat.html#18ab90bb7cd0db31722374889e3d74c8" title="Returns the number of columns of the sparse matrix.">cols</a>() == <a class="code" href="classitpp_1_1LDPC__Parity.html#82403ae65de864fdbe4fcdd4d83caff2" title="Number of check nodes.">ncheck</a>,
119<a name="l00127"></a>00127                     <span class="stringliteral">"LDPC_Parity::get_ncheck(): Internal error"</span>);
120<a name="l00128"></a>00128     <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1LDPC__Parity.html#82403ae65de864fdbe4fcdd4d83caff2" title="Number of check nodes.">ncheck</a>;
121<a name="l00129"></a>00129   }
122<a name="l00130"></a>00130
123<a name="l00132"></a>00132   <span class="keywordtype">void</span> <span class="keyword">set</span>(<span class="keywordtype">int</span> i, <span class="keywordtype">int</span> j, <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> value);
124<a name="l00133"></a>00133
125<a name="l00135"></a><a class="code" href="classitpp_1_1LDPC__Parity.html#c70ddfe8b703d1eb4d22a19f10f0e8c9">00135</a>   <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> <span class="keyword">get</span>(<span class="keywordtype">int</span> i, <span class="keywordtype">int</span> j) <span class="keyword">const</span> {
126<a name="l00136"></a>00136     <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>(<a class="code" href="classitpp_1_1LDPC__Parity.html#f51c1108ec92883ef46a55083e7263ec" title="The parity check matrix.">H</a>(i, j) == <a class="code" href="classitpp_1_1LDPC__Parity.html#0355499a802f0aeb3cb1b5f720fdc924" title="The transposed parity check matrix.">Ht</a>(j, i), <span class="stringliteral">"LDPC_Parity::get(): Internal error"</span>);
127<a name="l00137"></a>00137     <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1LDPC__Parity.html#f51c1108ec92883ef46a55083e7263ec" title="The parity check matrix.">H</a>(i, j);
128<a name="l00138"></a>00138   }
129<a name="l00139"></a>00139
130<a name="l00141"></a><a class="code" href="classitpp_1_1LDPC__Parity.html#2b2923d5f0ffafe41a427326f34c8784">00141</a>   <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> <a class="code" href="classitpp_1_1LDPC__Parity.html#2b2923d5f0ffafe41a427326f34c8784" title="Get element (i,j) of the parity check matrix.">operator()</a>(<span class="keywordtype">int</span> i, <span class="keywordtype">int</span> j)<span class="keyword"> const </span>{
131<a name="l00142"></a>00142     <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>(<a class="code" href="classitpp_1_1LDPC__Parity.html#f51c1108ec92883ef46a55083e7263ec" title="The parity check matrix.">H</a>(i, j) == <a class="code" href="classitpp_1_1LDPC__Parity.html#0355499a802f0aeb3cb1b5f720fdc924" title="The transposed parity check matrix.">Ht</a>(j, i),
132<a name="l00143"></a>00143                     <span class="stringliteral">"LDPC_Parity::operator(): Internal error"</span>);
133<a name="l00144"></a>00144     <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1LDPC__Parity.html#f51c1108ec92883ef46a55083e7263ec" title="The parity check matrix.">H</a>(i, j);
134<a name="l00145"></a>00145   }
135<a name="l00146"></a>00146
136<a name="l00148"></a>00148   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Parity.html#d4241825bc40f746ad885be000522f52" title="Display some information about the matrix.">display_stats</a>() <span class="keyword">const</span>;
137<a name="l00149"></a>00149
138<a name="l00151"></a><a class="code" href="classitpp_1_1LDPC__Parity.html#35bd2abd71714312866811d3255d68c8">00151</a>   <span class="keywordtype">double</span> <a class="code" href="classitpp_1_1LDPC__Parity.html#35bd2abd71714312866811d3255d68c8" title="Get the code rate.">get_rate</a>()<span class="keyword"> const </span>{
139<a name="l00152"></a>00152     <span class="keywordflow">return</span> (1.0 - static_cast&lt;double&gt;(<a class="code" href="classitpp_1_1LDPC__Parity.html#82403ae65de864fdbe4fcdd4d83caff2" title="Number of check nodes.">ncheck</a>) / <a class="code" href="classitpp_1_1LDPC__Parity.html#7e8697111c53562022e2f367593366c7" title="Number of variable nodes.">nvar</a>);
140<a name="l00153"></a>00153   }
141<a name="l00154"></a>00154
142<a name="l00156"></a>00156   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Parity.html#4e1fd0b2147b5d486e24538615e1fbf4" title="Import matrix from GF2mat_sparse_alist format.">import_alist</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1GF2mat__sparse__alist.html" title="Parameterized &amp;quot;alist&amp;quot; representation of sparse GF(2) matrix.">GF2mat_sparse_alist</a>&amp; H_alist);
143<a name="l00157"></a>00157
144<a name="l00159"></a>00159   <a class="code" href="classitpp_1_1GF2mat__sparse__alist.html" title="Parameterized &amp;quot;alist&amp;quot; representation of sparse GF(2) matrix.">GF2mat_sparse_alist</a> <a class="code" href="classitpp_1_1LDPC__Parity.html#811f5be45f91edf337d1ec48a125f2a7" title="Export matrix to GF2mat_sparse_alist format.">export_alist</a>() <span class="keyword">const</span>;
145<a name="l00160"></a>00160
146<a name="l00162"></a>00162   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Parity.html#0a8956859defe1d19e79441b9da281b3" title="Load matrix from alist_file text file in alist format.">load_alist</a>(<span class="keyword">const</span> std::string&amp; alist_file);
147<a name="l00163"></a>00163
148<a name="l00165"></a>00165   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Parity.html#f653d919cb8c3d08e2d700809155999a" title="Save matrix to alist_file text file in alist format.">save_alist</a>(<span class="keyword">const</span> std::string&amp; alist_file) <span class="keyword">const</span>;
149<a name="l00166"></a>00166
150<a name="l00167"></a>00167 <span class="keyword">protected</span>:
151<a name="l00169"></a><a class="code" href="classitpp_1_1LDPC__Parity.html#74998d26a4dd6057f3a8be6ac4f2c5c1">00169</a>   <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1LDPC__Parity.html#74998d26a4dd6057f3a8be6ac4f2c5c1" title="Flag that indicates proper initialization.">init_flag</a>;
152<a name="l00171"></a><a class="code" href="classitpp_1_1LDPC__Parity.html#0114010da4b27165cfc748f23d15edeb">00171</a>   <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1LDPC__Parity.html#0114010da4b27165cfc748f23d15edeb" title="Maximum node degree class can handle.">Nmax</a> = 200;
153<a name="l00173"></a><a class="code" href="classitpp_1_1LDPC__Parity.html#f51c1108ec92883ef46a55083e7263ec">00173</a>   <a class="code" href="classitpp_1_1Sparse__Mat.html">GF2mat_sparse</a> <a class="code" href="classitpp_1_1LDPC__Parity.html#f51c1108ec92883ef46a55083e7263ec" title="The parity check matrix.">H</a>;
154<a name="l00175"></a><a class="code" href="classitpp_1_1LDPC__Parity.html#0355499a802f0aeb3cb1b5f720fdc924">00175</a>   <a class="code" href="classitpp_1_1Sparse__Mat.html">GF2mat_sparse</a> <a class="code" href="classitpp_1_1LDPC__Parity.html#0355499a802f0aeb3cb1b5f720fdc924" title="The transposed parity check matrix.">Ht</a>;
155<a name="l00177"></a><a class="code" href="classitpp_1_1LDPC__Parity.html#7e8697111c53562022e2f367593366c7">00177</a>   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1LDPC__Parity.html#7e8697111c53562022e2f367593366c7" title="Number of variable nodes.">nvar</a>;
156<a name="l00179"></a><a class="code" href="classitpp_1_1LDPC__Parity.html#82403ae65de864fdbe4fcdd4d83caff2">00179</a>   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1LDPC__Parity.html#82403ae65de864fdbe4fcdd4d83caff2" title="Number of check nodes.">ncheck</a>;
157<a name="l00181"></a><a class="code" href="classitpp_1_1LDPC__Parity.html#d57f9e546f3a50b1dd84a587e36562fc">00181</a>   ivec <a class="code" href="classitpp_1_1LDPC__Parity.html#d57f9e546f3a50b1dd84a587e36562fc" title="Actual number of ones in each column.">sumX1</a>;
158<a name="l00183"></a><a class="code" href="classitpp_1_1LDPC__Parity.html#4c4347f86ad11c0f303f52a5134e851c">00183</a>   ivec <a class="code" href="classitpp_1_1LDPC__Parity.html#4c4347f86ad11c0f303f52a5134e851c" title="Actual number of ones in each row.">sumX2</a>;
159<a name="l00184"></a>00184
160<a name="l00200"></a>00200   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1LDPC__Parity.html#2849e24a0089c0b62105b8bbc4072d0e" title="Check for cycles of length L.">check_for_cycles</a>(<span class="keywordtype">int</span> L) <span class="keyword">const</span>;
161<a name="l00201"></a>00201
162<a name="l00245"></a>00245   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1LDPC__Parity.html#d30f8e78f5e951be44660d0750b70cb6" title="Check for connectivity between nodes.">check_connectivity</a>(<span class="keywordtype">int</span> from_m, <span class="keywordtype">int</span> from_n, <span class="keywordtype">int</span> to_m, <span class="keywordtype">int</span> to_n,
163<a name="l00246"></a>00246                          <span class="keywordtype">int</span> g, <span class="keywordtype">int</span> L) <span class="keyword">const</span>;
164<a name="l00247"></a>00247
165<a name="l00248"></a>00248   <span class="comment">//      inline int get_cmax() const {   return (max(sumX1));  }</span>
166<a name="l00249"></a>00249   <span class="comment">//      inline int get_vmax() const {   return (max(sumX2));  }</span>
167<a name="l00250"></a>00250   <span class="comment">//      ivec get_coldegree() const;</span>
168<a name="l00251"></a>00251   <span class="comment">//      ivec get_rowdegree() const;</span>
169<a name="l00252"></a>00252 };
170<a name="l00253"></a>00253
171<a name="l00254"></a>00254
172<a name="l00255"></a>00255 <span class="comment">// ----------------------------------------------------------------------</span>
173<a name="l00256"></a>00256 <span class="comment">// LDPC_Parity_Unstructured</span>
174<a name="l00257"></a>00257 <span class="comment">// ----------------------------------------------------------------------</span>
175<a name="l00258"></a>00258
176<a name="l00274"></a><a class="code" href="classitpp_1_1LDPC__Parity__Unstructured.html">00274</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1LDPC__Parity__Unstructured.html" title="Pure abstract class for unstructured LDPC matrices.">LDPC_Parity_Unstructured</a> : <span class="keyword">public</span> <a class="code" href="classitpp_1_1LDPC__Parity.html" title="LDPC parity check matrix generic class.">LDPC_Parity</a>
177<a name="l00275"></a>00275 {
178<a name="l00276"></a>00276 <span class="keyword">public</span>:
179<a name="l00278"></a>00278   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Parity__Unstructured.html#dfc18dacad1de210bb284afbf4dd6de2" title="Display some information about the matrix.">display_stats</a>() <span class="keyword">const</span> = 0;
180<a name="l00279"></a>00279
181<a name="l00298"></a>00298   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1LDPC__Parity__Unstructured.html#32dc0098889fb7cbe925122a220ba504" title="Remove cycles (loops) from unstructured parity check matrix.">cycle_removal_MGW</a>(<span class="keywordtype">int</span> L);
182<a name="l00299"></a>00299
183<a name="l00300"></a>00300 <span class="keyword">protected</span>:
184<a name="l00302"></a>00302   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Parity__Unstructured.html#65d83d2aa65aa098b10341da4adba70e" title="Generate a random parity check matrix.">generate_random_H</a>(<span class="keyword">const</span> ivec&amp; C, <span class="keyword">const</span> ivec&amp; R, <span class="keyword">const</span> ivec&amp; cycopt);
185<a name="l00303"></a>00303
186<a name="l00317"></a>00317   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Parity__Unstructured.html#143f0a5c1def918e21fe30bcd5af176c" title="Compute target number of columns (C) and rows (R) with a specific number of ones...">compute_CR</a>(<span class="keyword">const</span> vec&amp; var_deg, <span class="keyword">const</span> vec&amp; chk_deg, <span class="keyword">const</span> <span class="keywordtype">int</span> Nvar,
187<a name="l00318"></a>00318                   ivec &amp;C, ivec &amp;R);
188<a name="l00319"></a>00319
189<a name="l00320"></a>00320 };
190<a name="l00321"></a>00321
191<a name="l00322"></a>00322
192<a name="l00323"></a>00323 <span class="comment">// ----------------------------------------------------------------------</span>
193<a name="l00324"></a>00324 <span class="comment">// LDPC_Parity_Irregular</span>
194<a name="l00325"></a>00325 <span class="comment">// ----------------------------------------------------------------------</span>
195<a name="l00326"></a>00326
196<a name="l00331"></a><a class="code" href="classitpp_1_1LDPC__Parity__Irregular.html">00331</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1LDPC__Parity__Irregular.html" title="Irregular LDPC code generator class.">LDPC_Parity_Irregular</a> : <span class="keyword">public</span> <a class="code" href="classitpp_1_1LDPC__Parity__Unstructured.html" title="Pure abstract class for unstructured LDPC matrices.">LDPC_Parity_Unstructured</a>
197<a name="l00332"></a>00332 {
198<a name="l00333"></a>00333 <span class="keyword">public</span>:
199<a name="l00335"></a><a class="code" href="classitpp_1_1LDPC__Parity__Irregular.html#4c1ead5bc73b40163e533d54277fdeec">00335</a>   <a class="code" href="classitpp_1_1LDPC__Parity__Irregular.html#4c1ead5bc73b40163e533d54277fdeec" title="Default constructor.">LDPC_Parity_Irregular</a>() {}
200<a name="l00337"></a>00337   <a class="code" href="classitpp_1_1LDPC__Parity__Irregular.html#4c1ead5bc73b40163e533d54277fdeec" title="Default constructor.">LDPC_Parity_Irregular</a>(<span class="keywordtype">int</span> Nvar, <span class="keyword">const</span> vec&amp; var_deg, <span class="keyword">const</span> vec&amp; chk_deg,
201<a name="l00338"></a>00338                         <span class="keyword">const</span> std::string&amp; method = <span class="stringliteral">"rand"</span>,
202<a name="l00339"></a>00339                         <span class="keyword">const</span> ivec&amp; options = <span class="stringliteral">"200 6"</span>);
203<a name="l00340"></a>00340
204<a name="l00379"></a>00379   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Parity__Irregular.html#c441e868691b1e6d634ee09db6228274" title="Generate an irregular LDPC code.">generate</a>(<span class="keywordtype">int</span> Nvar, <span class="keyword">const</span> vec&amp; var_deg, <span class="keyword">const</span> vec&amp; chk_deg,
205<a name="l00380"></a>00380                 <span class="keyword">const</span> std::string&amp; method = <span class="stringliteral">"rand"</span>,
206<a name="l00381"></a>00381                 <span class="keyword">const</span> ivec&amp; options = <span class="stringliteral">"200 6"</span>);
207<a name="l00382"></a>00382
208<a name="l00384"></a><a class="code" href="classitpp_1_1LDPC__Parity__Irregular.html#e8161a5209869b9623fde53cf30527c5">00384</a>   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Parity__Irregular.html#e8161a5209869b9623fde53cf30527c5" title="Display some information about the matrix.">display_stats</a>()<span class="keyword"> const </span>{ <a class="code" href="classitpp_1_1LDPC__Parity__Irregular.html#e8161a5209869b9623fde53cf30527c5" title="Display some information about the matrix.">LDPC_Parity::display_stats</a>(); }
209<a name="l00385"></a>00385 };
210<a name="l00386"></a>00386
211<a name="l00387"></a>00387
212<a name="l00388"></a>00388 <span class="comment">// ----------------------------------------------------------------------</span>
213<a name="l00389"></a>00389 <span class="comment">// LDPC_Parity_Regular</span>
214<a name="l00390"></a>00390 <span class="comment">// ----------------------------------------------------------------------</span>
215<a name="l00391"></a>00391
216<a name="l00396"></a><a class="code" href="classitpp_1_1LDPC__Parity__Regular.html">00396</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1LDPC__Parity__Regular.html" title="Regular LDPC code generator class.">LDPC_Parity_Regular</a> : <span class="keyword">public</span> <a class="code" href="classitpp_1_1LDPC__Parity__Unstructured.html" title="Pure abstract class for unstructured LDPC matrices.">LDPC_Parity_Unstructured</a>
217<a name="l00397"></a>00397 {
218<a name="l00398"></a>00398 <span class="keyword">public</span>:
219<a name="l00400"></a><a class="code" href="classitpp_1_1LDPC__Parity__Regular.html#aa40e6cf74fee6374fd9f220ad05246e">00400</a>   <a class="code" href="classitpp_1_1LDPC__Parity__Regular.html#aa40e6cf74fee6374fd9f220ad05246e" title="Default constructor.">LDPC_Parity_Regular</a>() {}
220<a name="l00402"></a>00402   <a class="code" href="classitpp_1_1LDPC__Parity__Regular.html#aa40e6cf74fee6374fd9f220ad05246e" title="Default constructor.">LDPC_Parity_Regular</a>(<span class="keywordtype">int</span> Nvar, <span class="keywordtype">int</span> k, <span class="keywordtype">int</span> l,
221<a name="l00403"></a>00403                       <span class="keyword">const</span> std::string&amp; method = <span class="stringliteral">"rand"</span>,
222<a name="l00404"></a>00404                       <span class="keyword">const</span> ivec&amp; options = <span class="stringliteral">"200 6"</span>);
223<a name="l00405"></a>00405
224<a name="l00424"></a>00424   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Parity__Regular.html#abff119396a06dd6ab69d54d83fec234" title="Generate a (k,l) regular LDPC code.">generate</a>(<span class="keywordtype">int</span> Nvar, <span class="keywordtype">int</span> k, <span class="keywordtype">int</span> l,
225<a name="l00425"></a>00425                 <span class="keyword">const</span> std::string&amp; method = <span class="stringliteral">"rand"</span>,
226<a name="l00426"></a>00426                 <span class="keyword">const</span> ivec&amp; options = <span class="stringliteral">"200 6"</span>);
227<a name="l00427"></a>00427
228<a name="l00429"></a><a class="code" href="classitpp_1_1LDPC__Parity__Regular.html#d82cdfa215699c583a1d7cb3bb0de691">00429</a>   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Parity__Regular.html#d82cdfa215699c583a1d7cb3bb0de691" title="Display some information about the matrix.">display_stats</a>()<span class="keyword"> const </span>{ <a class="code" href="classitpp_1_1LDPC__Parity__Regular.html#d82cdfa215699c583a1d7cb3bb0de691" title="Display some information about the matrix.">LDPC_Parity::display_stats</a>(); }
229<a name="l00430"></a>00430 };
230<a name="l00431"></a>00431
231<a name="l00432"></a>00432 <span class="comment">// ----------------------------------------------------------------------</span>
232<a name="l00433"></a>00433 <span class="comment">// BLDPC_Parity</span>
233<a name="l00434"></a>00434 <span class="comment">// ----------------------------------------------------------------------</span>
234<a name="l00435"></a>00435
235<a name="l00460"></a><a class="code" href="classitpp_1_1BLDPC__Parity.html">00460</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1BLDPC__Parity.html" title="Block LDPC code parity-check matrix.">BLDPC_Parity</a> : <span class="keyword">public</span> <a class="code" href="classitpp_1_1LDPC__Parity.html" title="LDPC parity check matrix generic class.">LDPC_Parity</a>
236<a name="l00461"></a>00461 {
237<a name="l00462"></a>00462 <span class="keyword">public</span>:
238<a name="l00464"></a><a class="code" href="classitpp_1_1BLDPC__Parity.html#978c70b8b4124c0510d2dfc070dd6e82">00464</a>   <a class="code" href="classitpp_1_1BLDPC__Parity.html#978c70b8b4124c0510d2dfc070dd6e82" title="Default constructor.">BLDPC_Parity</a>(): <a class="code" href="classitpp_1_1LDPC__Parity.html" title="LDPC parity check matrix generic class.">LDPC_Parity</a>(), Z(0), H_b(), H_b_valid(false) {}
239<a name="l00465"></a>00465
240<a name="l00467"></a>00467   <a class="code" href="classitpp_1_1BLDPC__Parity.html#978c70b8b4124c0510d2dfc070dd6e82" title="Default constructor.">BLDPC_Parity</a>(<span class="keyword">const</span> imat &amp;base_matrix, <span class="keywordtype">int</span> exp_factor);
241<a name="l00468"></a>00468
242<a name="l00470"></a>00470   <a class="code" href="classitpp_1_1BLDPC__Parity.html#978c70b8b4124c0510d2dfc070dd6e82" title="Default constructor.">BLDPC_Parity</a>(<span class="keyword">const</span> std::string &amp;filename, <span class="keywordtype">int</span> exp_factor);
243<a name="l00471"></a>00471
244<a name="l00473"></a>00473   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1BLDPC__Parity.html#a1edcf49d02cacb3bdaf54f601c47669" title="Create BLDPC matrix from base matrix by expansion.">expand_base</a>(<span class="keyword">const</span> imat &amp;base_matrix, <span class="keywordtype">int</span> exp_factor);
245<a name="l00474"></a>00474
246<a name="l00476"></a>00476   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1BLDPC__Parity.html#94ae6cb70587c0c88245a3099b0e4cea" title="Get expansion factor.">get_exp_factor</a>() <span class="keyword">const</span>;
247<a name="l00477"></a>00477
248<a name="l00479"></a>00479   imat <a class="code" href="classitpp_1_1BLDPC__Parity.html#c29ad2dde5079ba1ed4e6458910ad5bf" title="Get base matrix.">get_base_matrix</a>() <span class="keyword">const</span>;
249<a name="l00480"></a>00480
250<a name="l00482"></a><a class="code" href="classitpp_1_1BLDPC__Parity.html#9ded50ca311c3f700b7a29e053504149">00482</a>   <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1BLDPC__Parity.html#9ded50ca311c3f700b7a29e053504149" title="Verify initialisation.">is_valid</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> H_b_valid &amp;&amp; <a class="code" href="classitpp_1_1LDPC__Parity.html#74998d26a4dd6057f3a8be6ac4f2c5c1" title="Flag that indicates proper initialization.">init_flag</a>; }
251<a name="l00483"></a>00483
252<a name="l00485"></a>00485   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1BLDPC__Parity.html#bd076d732938ec9ba76ad353923f11ad" title="Set expansion factor.">set_exp_factor</a>(<span class="keywordtype">int</span> exp_factor);
253<a name="l00486"></a>00486
254<a name="l00488"></a>00488   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1BLDPC__Parity.html#a2f3e9cbbe2c72fbb3c9e34d6aa5e7e9" title="Load base matrix from a text file.">load_base_matrix</a>(<span class="keyword">const</span> std::string &amp;filename);
255<a name="l00489"></a>00489
256<a name="l00491"></a>00491   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1BLDPC__Parity.html#6acad3c27780ede38f88499c454bcec2" title="Save base matrix to a text file.">save_base_matrix</a>(<span class="keyword">const</span> std::string &amp;filename) <span class="keyword">const</span>;
257<a name="l00492"></a>00492
258<a name="l00493"></a>00493 <span class="keyword">private</span>:
259<a name="l00494"></a>00494   <span class="keywordtype">int</span> Z;   
260<a name="l00495"></a>00495   imat H_b;   
261<a name="l00496"></a>00496   <span class="keywordtype">bool</span> H_b_valid; 
262<a name="l00497"></a>00497
263<a name="l00499"></a>00499   <span class="keywordtype">void</span> calculate_base_matrix();
264<a name="l00500"></a>00500 };
265<a name="l00501"></a>00501
266<a name="l00502"></a>00502
267<a name="l00503"></a>00503 <span class="comment">// ----------------------------------------------------------------------</span>
268<a name="l00504"></a>00504 <span class="comment">// LDPC_Generator</span>
269<a name="l00505"></a>00505 <span class="comment">// ----------------------------------------------------------------------</span>
270<a name="l00506"></a>00506
271<a name="l00522"></a><a class="code" href="classitpp_1_1LDPC__Generator.html">00522</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1LDPC__Generator.html" title="LDPC Generator pure virtual base class.">LDPC_Generator</a>
272<a name="l00523"></a>00523 {
273<a name="l00524"></a>00524   <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classitpp_1_1LDPC__Code.html" title="Low-density parity check (LDPC) codec.">LDPC_Code</a>;
274<a name="l00525"></a>00525 <span class="keyword">public</span>:
275<a name="l00527"></a><a class="code" href="classitpp_1_1LDPC__Generator.html#da814d8755e0487539ff726361e8ee99">00527</a>   <a class="code" href="classitpp_1_1LDPC__Generator.html#da814d8755e0487539ff726361e8ee99" title="Default constructor.">LDPC_Generator</a>(<span class="keyword">const</span> std::string&amp; type_in = <span class="stringliteral">""</span>): <a class="code" href="classitpp_1_1LDPC__Generator.html#269fad976f1590c09c5331b2cb7407bc" title="True if generator is initialized.">init_flag</a>(false),
276<a name="l00528"></a>00528       <a class="code" href="classitpp_1_1LDPC__Generator.html#3a3ee287a74880985500b0470c10393f" title="Generator type.">type</a>(type_in) {}
277<a name="l00530"></a><a class="code" href="classitpp_1_1LDPC__Generator.html#65679f09648fe18f850e156aa1cff432">00530</a>   <span class="keyword">virtual</span> <a class="code" href="classitpp_1_1LDPC__Generator.html#65679f09648fe18f850e156aa1cff432" title="Virtual destructor.">~LDPC_Generator</a>() {}
278<a name="l00531"></a>00531
279<a name="l00533"></a>00533   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Generator.html#c0b88b84513103f2d1c19d62284648c2" title="Generator specific encode function.">encode</a>(<span class="keyword">const</span> bvec &amp;input, bvec &amp;output) = 0;
280<a name="l00534"></a>00534
281<a name="l00536"></a><a class="code" href="classitpp_1_1LDPC__Generator.html#08a7401d1e74e5bf7125315690714a1b">00536</a>   std::string <a class="code" href="classitpp_1_1LDPC__Generator.html#08a7401d1e74e5bf7125315690714a1b" title="Return generator type.">get_type</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1LDPC__Generator.html#3a3ee287a74880985500b0470c10393f" title="Generator type.">type</a>; }
282<a name="l00537"></a>00537
283<a name="l00538"></a>00538 <span class="keyword">protected</span>:
284<a name="l00539"></a><a class="code" href="classitpp_1_1LDPC__Generator.html#269fad976f1590c09c5331b2cb7407bc">00539</a>   <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1LDPC__Generator.html#269fad976f1590c09c5331b2cb7407bc" title="True if generator is initialized.">init_flag</a>
285<a name="l00540"></a><a class="code" href="classitpp_1_1LDPC__Generator.html#3a3ee287a74880985500b0470c10393f">00540</a>   std::string <a class="code" href="classitpp_1_1LDPC__Generator.html#3a3ee287a74880985500b0470c10393f" title="Generator type.">type</a>
286<a name="l00541"></a>00541
287<a name="l00543"></a>00543   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Generator.html#6dc3ede11c56d04304c480b04507b8e5" title="Save generator data to a file.">save</a>(<span class="keyword">const</span> std::string&amp; filename) <span class="keyword">const</span> = 0;
288<a name="l00545"></a>00545   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Generator.html#8973051cc4b7073f84b2e3607c8ba837" title="Read generator data from a file.">load</a>(<span class="keyword">const</span> std::string&amp; filename) = 0;
289<a name="l00546"></a>00546 };
290<a name="l00547"></a>00547
291<a name="l00548"></a>00548
292<a name="l00549"></a>00549 <span class="comment">// ----------------------------------------------------------------------</span>
293<a name="l00550"></a>00550 <span class="comment">// LDPC_Generator_Systematic</span>
294<a name="l00551"></a>00551 <span class="comment">// ----------------------------------------------------------------------</span>
295<a name="l00552"></a>00552
296<a name="l00564"></a><a class="code" href="classitpp_1_1LDPC__Generator__Systematic.html">00564</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1LDPC__Generator__Systematic.html" title="Systematic LDPC Generator class.">LDPC_Generator_Systematic</a> : <span class="keyword">public</span> <a class="code" href="classitpp_1_1LDPC__Generator.html" title="LDPC Generator pure virtual base class.">LDPC_Generator</a>
297<a name="l00565"></a>00565 {
298<a name="l00566"></a>00566 <span class="keyword">public</span>:
299<a name="l00568"></a><a class="code" href="classitpp_1_1LDPC__Generator__Systematic.html#2ae4b407f208eb9c5f25ad7070455cb9">00568</a>   <a class="code" href="classitpp_1_1LDPC__Generator__Systematic.html#2ae4b407f208eb9c5f25ad7070455cb9" title="Default constructor.">LDPC_Generator_Systematic</a>(): <a class="code" href="classitpp_1_1LDPC__Generator.html" title="LDPC Generator pure virtual base class.">LDPC_Generator</a>(<span class="stringliteral">"systematic"</span>), G() {}
300<a name="l00570"></a>00570   <a class="code" href="classitpp_1_1LDPC__Generator__Systematic.html#2ae4b407f208eb9c5f25ad7070455cb9" title="Default constructor.">LDPC_Generator_Systematic</a>(<a class="code" href="classitpp_1_1LDPC__Parity.html" title="LDPC parity check matrix generic class.">LDPC_Parity</a>* <span class="keyword">const</span> H,
301<a name="l00571"></a>00571                             <span class="keywordtype">bool</span> natural_ordering = <span class="keyword">false</span>,
302<a name="l00572"></a>00572                             <span class="keyword">const</span> ivec&amp; ind = <span class="stringliteral">""</span>);
303<a name="l00573"></a>00573
304<a name="l00575"></a><a class="code" href="classitpp_1_1LDPC__Generator__Systematic.html#49202667fe5764c29fc2a2c92af46797">00575</a>   <span class="keyword">virtual</span> <a class="code" href="classitpp_1_1LDPC__Generator__Systematic.html#49202667fe5764c29fc2a2c92af46797" title="Virtual destructor.">~LDPC_Generator_Systematic</a>() {}
305<a name="l00576"></a>00576
306<a name="l00578"></a>00578   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Generator__Systematic.html#9d76bceeb0ce1dc6fda83abacd5583a1" title="Generator specific encode function.">encode</a>(<span class="keyword">const</span> bvec &amp;input, bvec &amp;output);
307<a name="l00579"></a>00579
308<a name="l00613"></a>00613   ivec <a class="code" href="classitpp_1_1LDPC__Generator__Systematic.html#4d57d681c7b574e63542cb5fc22d190f" title="Construct systematic generator matrix.">construct</a>(<a class="code" href="classitpp_1_1LDPC__Parity.html" title="LDPC parity check matrix generic class.">LDPC_Parity</a>* <span class="keyword">const</span> H, <span class="keywordtype">bool</span> natural_ordering = <span class="keyword">false</span>,
309<a name="l00614"></a>00614                  <span class="keyword">const</span> ivec&amp; ind = <span class="stringliteral">""</span>);
310<a name="l00615"></a>00615
311<a name="l00616"></a>00616 <span class="keyword">protected</span>:
312<a name="l00618"></a>00618   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Generator__Systematic.html#d43ea5930f83bc13c4bd30bccde35c18" title="Save generator data to a file.">save</a>(<span class="keyword">const</span> std::string&amp; filename) <span class="keyword">const</span>;
313<a name="l00620"></a>00620   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Generator__Systematic.html#d36ad875dce9351e322075d4d0d548e2" title="Read generator data from a file.">load</a>(<span class="keyword">const</span> std::string&amp; filename);
314<a name="l00621"></a>00621
315<a name="l00622"></a>00622 <span class="keyword">private</span>:
316<a name="l00623"></a>00623   <a class="code" href="classitpp_1_1GF2mat.html" title="Class for dense GF(2) matrices.">GF2mat</a> G; <span class="comment">// the matrix is stored in transposed form</span>
317<a name="l00624"></a>00624 };
318<a name="l00625"></a>00625
319<a name="l00626"></a>00626
320<a name="l00627"></a>00627 <span class="comment">// ----------------------------------------------------------------------</span>
321<a name="l00628"></a>00628 <span class="comment">// BLDPC_Generator</span>
322<a name="l00629"></a>00629 <span class="comment">// ----------------------------------------------------------------------</span>
323<a name="l00630"></a>00630
324<a name="l00638"></a><a class="code" href="classitpp_1_1BLDPC__Generator.html">00638</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1BLDPC__Generator.html" title="Block LDPC Generator class.">BLDPC_Generator</a> : <span class="keyword">public</span> <a class="code" href="classitpp_1_1LDPC__Generator.html" title="LDPC Generator pure virtual base class.">LDPC_Generator</a>
325<a name="l00639"></a>00639 {
326<a name="l00640"></a>00640 <span class="keyword">public</span>:
327<a name="l00642"></a><a class="code" href="classitpp_1_1BLDPC__Generator.html#99a98629158668fc1dd4b6fd4949a66a">00642</a>   <a class="code" href="classitpp_1_1BLDPC__Generator.html#99a98629158668fc1dd4b6fd4949a66a" title="Default constructor.">BLDPC_Generator</a>(<span class="keyword">const</span> std::string <a class="code" href="classitpp_1_1LDPC__Generator.html#3a3ee287a74880985500b0470c10393f" title="Generator type.">type</a> = <span class="stringliteral">"BLDPC"</span>):
328<a name="l00643"></a>00643       <a class="code" href="classitpp_1_1LDPC__Generator.html" title="LDPC Generator pure virtual base class.">LDPC_Generator</a>(<a class="code" href="classitpp_1_1LDPC__Generator.html#3a3ee287a74880985500b0470c10393f" title="Generator type.">type</a>), <a class="code" href="classitpp_1_1BLDPC__Generator.html#4cb9d76420526cf025f5bf2a16a7d488" title="Preprocessed parity check matrix.">H_enc</a>(), <a class="code" href="classitpp_1_1BLDPC__Generator.html#aa2d7c7becef8f6271d836f69c15b11c" title="Codeword length = H_enc.cols().">N</a>(0), <a class="code" href="classitpp_1_1BLDPC__Generator.html#8b4eda3b4e9141f31b5dbee0b2006c48" title="Number of parity check bits = H_enc.rows().">M</a>(0), <a class="code" href="classitpp_1_1BLDPC__Generator.html#d44f2281b0499b4e1ad7e6569fd00f40" title="Number of information bits = N-M.">K</a>(0), <a class="code" href="classitpp_1_1BLDPC__Generator.html#70567e717dfc33ba053896b6936116a8" title="Expansion factor.">Z</a>(0) {}
329<a name="l00645"></a>00645   <a class="code" href="classitpp_1_1BLDPC__Generator.html#99a98629158668fc1dd4b6fd4949a66a" title="Default constructor.">BLDPC_Generator</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1BLDPC__Parity.html" title="Block LDPC code parity-check matrix.">BLDPC_Parity</a>* <span class="keyword">const</span> H,
330<a name="l00646"></a>00646                   <span class="keyword">const</span> std::string <a class="code" href="classitpp_1_1LDPC__Generator.html#3a3ee287a74880985500b0470c10393f" title="Generator type.">type</a> = <span class="stringliteral">"BLDPC"</span>);
331<a name="l00647"></a>00647
332<a name="l00649"></a><a class="code" href="classitpp_1_1BLDPC__Generator.html#56757cc11a4f2737df2cf7144edfeb9d">00649</a>   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1BLDPC__Generator.html#56757cc11a4f2737df2cf7144edfeb9d" title="Get expansion factor.">get_exp_factor</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1BLDPC__Generator.html#70567e717dfc33ba053896b6936116a8" title="Expansion factor.">Z</a>; }
333<a name="l00650"></a>00650
334<a name="l00652"></a>00652   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1BLDPC__Generator.html#f6fdf4df53cb36c1753c5a37d205aaff" title="Generator specific encode function.">encode</a>(<span class="keyword">const</span> bvec &amp;input, bvec &amp;output);
335<a name="l00653"></a>00653
336<a name="l00655"></a>00655   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1BLDPC__Generator.html#3c3fd4be8398563cf3bf8d216905bce8" title="Construct the BLDPC generator.">construct</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1BLDPC__Parity.html" title="Block LDPC code parity-check matrix.">BLDPC_Parity</a>* <span class="keyword">const</span> H);
337<a name="l00656"></a>00656
338<a name="l00657"></a>00657 <span class="keyword">protected</span>:
339<a name="l00659"></a>00659   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1BLDPC__Generator.html#132ce5aa532f32d05281871f3bc1aa58" title="Save generator data to a file.">save</a>(<span class="keyword">const</span> std::string &amp;filename) <span class="keyword">const</span>;
340<a name="l00661"></a>00661   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1BLDPC__Generator.html#a22307edd5abe03e750382514dcef7c0" title="Read generator data from a file.">load</a>(<span class="keyword">const</span> std::string &amp;filename);
341<a name="l00662"></a>00662
342<a name="l00663"></a><a class="code" href="classitpp_1_1BLDPC__Generator.html#4cb9d76420526cf025f5bf2a16a7d488">00663</a>   <a class="code" href="classitpp_1_1GF2mat.html" title="Class for dense GF(2) matrices.">GF2mat</a> <a class="code" href="classitpp_1_1BLDPC__Generator.html#4cb9d76420526cf025f5bf2a16a7d488" title="Preprocessed parity check matrix.">H_enc</a>
343<a name="l00664"></a><a class="code" href="classitpp_1_1BLDPC__Generator.html#aa2d7c7becef8f6271d836f69c15b11c">00664</a>   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1BLDPC__Generator.html#aa2d7c7becef8f6271d836f69c15b11c" title="Codeword length = H_enc.cols().">N</a>;   
344<a name="l00665"></a><a class="code" href="classitpp_1_1BLDPC__Generator.html#8b4eda3b4e9141f31b5dbee0b2006c48">00665</a>   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1BLDPC__Generator.html#8b4eda3b4e9141f31b5dbee0b2006c48" title="Number of parity check bits = H_enc.rows().">M</a>;       
345<a name="l00666"></a><a class="code" href="classitpp_1_1BLDPC__Generator.html#d44f2281b0499b4e1ad7e6569fd00f40">00666</a>   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1BLDPC__Generator.html#d44f2281b0499b4e1ad7e6569fd00f40" title="Number of information bits = N-M.">K</a>;   
346<a name="l00667"></a><a class="code" href="classitpp_1_1BLDPC__Generator.html#70567e717dfc33ba053896b6936116a8">00667</a>   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1BLDPC__Generator.html#70567e717dfc33ba053896b6936116a8" title="Expansion factor.">Z</a>;   
347<a name="l00668"></a>00668 };
348<a name="l00669"></a>00669
349<a name="l00670"></a>00670
350<a name="l00671"></a>00671 <span class="comment">// ----------------------------------------------------------------------</span>
351<a name="l00672"></a>00672 <span class="comment">// LDPC_Code</span>
352<a name="l00673"></a>00673 <span class="comment">// ----------------------------------------------------------------------</span>
353<a name="l00674"></a>00674
354<a name="l00722"></a><a class="code" href="classitpp_1_1LDPC__Code.html">00722</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1LDPC__Code.html" title="Low-density parity check (LDPC) codec.">LDPC_Code</a> : <span class="keyword">public</span> <a class="code" href="classitpp_1_1Channel__Code.html" title="Generic Channel Code class.">Channel_Code</a>
355<a name="l00723"></a>00723 {
356<a name="l00724"></a>00724 <span class="keyword">public</span>:
357<a name="l00726"></a>00726   <a class="code" href="classitpp_1_1LDPC__Code.html#67225734edb76c509e25eb5c03504bb7" title="Default constructor.">LDPC_Code</a>();
358<a name="l00727"></a>00727
359<a name="l00734"></a>00734   <a class="code" href="classitpp_1_1LDPC__Code.html#67225734edb76c509e25eb5c03504bb7" title="Default constructor.">LDPC_Code</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1LDPC__Parity.html" title="LDPC parity check matrix generic class.">LDPC_Parity</a>* <span class="keyword">const</span> H, <a class="code" href="classitpp_1_1LDPC__Generator.html" title="LDPC Generator pure virtual base class.">LDPC_Generator</a>* <span class="keyword">const</span> <a class="code" href="classitpp_1_1LDPC__Code.html#8e0a35c62e26fe98fe3a0b1fbdbb4ac0" title="Generator object pointer.">G</a> = 0);
360<a name="l00735"></a>00735
361<a name="l00741"></a>00741   <a class="code" href="classitpp_1_1LDPC__Code.html#67225734edb76c509e25eb5c03504bb7" title="Default constructor.">LDPC_Code</a>(<span class="keyword">const</span> std::string&amp; filename, <a class="code" href="classitpp_1_1LDPC__Generator.html" title="LDPC Generator pure virtual base class.">LDPC_Generator</a>* <span class="keyword">const</span> <a class="code" href="classitpp_1_1LDPC__Code.html#8e0a35c62e26fe98fe3a0b1fbdbb4ac0" title="Generator object pointer.">G</a> = 0);
362<a name="l00742"></a>00742
363<a name="l00744"></a><a class="code" href="classitpp_1_1LDPC__Code.html#1cef517f16fd7731457d5b5cd5002222">00744</a>   <span class="keyword">virtual</span> <a class="code" href="classitpp_1_1LDPC__Code.html#1cef517f16fd7731457d5b5cd5002222" title="Destructor.">~LDPC_Code</a>() {}
364<a name="l00745"></a>00745
365<a name="l00746"></a>00746
366<a name="l00754"></a>00754   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Code.html#cb246790e35667c0fa2f72cde8204044" title="Set the codec, from a parity check matrix and optionally a generator.">set_code</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1LDPC__Parity.html" title="LDPC parity check matrix generic class.">LDPC_Parity</a>* <span class="keyword">const</span> H, <a class="code" href="classitpp_1_1LDPC__Generator.html" title="LDPC Generator pure virtual base class.">LDPC_Generator</a>* <span class="keyword">const</span> <a class="code" href="classitpp_1_1LDPC__Code.html#8e0a35c62e26fe98fe3a0b1fbdbb4ac0" title="Generator object pointer.">G</a> = 0);
367<a name="l00755"></a>00755
368<a name="l00769"></a>00769   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Code.html#eb77df900d57a21f4e58d61b89021137" title="Set the codec, by reading from a saved file.">load_code</a>(<span class="keyword">const</span> std::string&amp; filename, <a class="code" href="classitpp_1_1LDPC__Generator.html" title="LDPC Generator pure virtual base class.">LDPC_Generator</a>* <span class="keyword">const</span> <a class="code" href="classitpp_1_1LDPC__Code.html#8e0a35c62e26fe98fe3a0b1fbdbb4ac0" title="Generator object pointer.">G</a> = 0);
369<a name="l00770"></a>00770
370<a name="l00779"></a>00779   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Code.html#11d57db70a6f26d1e61645bd4d46d2be" title="Save the codec to a file.">save_code</a>(<span class="keyword">const</span> std::string&amp; filename) <span class="keyword">const</span>;
371<a name="l00780"></a>00780
372<a name="l00781"></a>00781
373<a name="l00790"></a>00790   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Code.html#1dc075d2037b99063e56c6367125f7c1" title="Set the decoding method.">set_decoding_method</a>(<span class="keyword">const</span> std::string&amp; method);
374<a name="l00791"></a>00791
375<a name="l00805"></a>00805   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Code.html#e0973ce52201a50b152fc12d0ea2bede" title="Set the decoding loop exit conditions.">set_exit_conditions</a>(<span class="keywordtype">int</span> <a class="code" href="classitpp_1_1LDPC__Code.html#bb224992cccd0175c11dd347052736d4" title="Maximum number of iterations.">max_iters</a>,
376<a name="l00806"></a>00806                            <span class="keywordtype">bool</span> syndr_check_each_iter = <span class="keyword">true</span>,
377<a name="l00807"></a>00807                            <span class="keywordtype">bool</span> syndr_check_at_start = <span class="keyword">false</span>);
378<a name="l00808"></a>00808
379<a name="l00810"></a>00810   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Code.html#4219bb70addf01ce19c014c69704b735" title="Set LLR calculation unit.">set_llrcalc</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1LLR__calc__unit.html" title="Log-likelihood algebra calculation unit.">LLR_calc_unit</a>&amp; <a class="code" href="classitpp_1_1LDPC__Code.html#50db4abe3af5c9e57ccf8c2a8f488433" title="LLR calculation unit.">llrcalc</a>);
380<a name="l00811"></a>00811
381<a name="l00812"></a>00812
382<a name="l00813"></a>00813   <span class="comment">// ------------ Encoding  ---------------------</span>
383<a name="l00814"></a>00814
384<a name="l00824"></a>00824   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Code.html#640c68e85d0df3b607b96f7d3787e5a8" title="Encode codeword.">encode</a>(<span class="keyword">const</span> bvec &amp;input, bvec &amp;output);
385<a name="l00826"></a>00826   <span class="keyword">virtual</span> bvec <a class="code" href="classitpp_1_1LDPC__Code.html#640c68e85d0df3b607b96f7d3787e5a8" title="Encode codeword.">encode</a>(<span class="keyword">const</span> bvec &amp;input);
386<a name="l00827"></a>00827
387<a name="l00828"></a>00828
388<a name="l00829"></a>00829   <span class="comment">// ------------ Decoding  ---------------------</span>
389<a name="l00830"></a>00830
390<a name="l00832"></a><a class="code" href="classitpp_1_1LDPC__Code.html#99fb8f359baa6fb4aaa1e8e46dcd5281">00832</a>   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Code.html#99fb8f359baa6fb4aaa1e8e46dcd5281" title="Inherited from the base class - not implemented here.">decode</a>(<span class="keyword">const</span> bvec &amp;, bvec &amp;) {
391<a name="l00833"></a>00833     <a class="code" href="group__errorhandlingfunc.html#g22d38e98332f9edff88cc501463eedce" title="Abort unconditionally.">it_error</a>(<span class="stringliteral">"LDPC_Code::decode(): Hard input decoding not implemented"</span>);
392<a name="l00834"></a>00834   }
393<a name="l00836"></a><a class="code" href="classitpp_1_1LDPC__Code.html#1afefa2e0da0e129c5bf90c230726211">00836</a>   <span class="keyword">virtual</span> bvec <a class="code" href="classitpp_1_1LDPC__Code.html#1afefa2e0da0e129c5bf90c230726211" title="Inherited from the base class - not implemented here.">decode</a>(<span class="keyword">const</span> bvec &amp;) {
394<a name="l00837"></a>00837     <a class="code" href="group__errorhandlingfunc.html#g22d38e98332f9edff88cc501463eedce" title="Abort unconditionally.">it_error</a>(<span class="stringliteral">"LDPC_Code::decode(): Hard input decoding not implemented"</span>);
395<a name="l00838"></a>00838     <span class="keywordflow">return</span> bvec();
396<a name="l00839"></a>00839   }
397<a name="l00840"></a>00840
398<a name="l00842"></a>00842   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Code.html#99fb8f359baa6fb4aaa1e8e46dcd5281" title="Inherited from the base class - not implemented here.">decode</a>(<span class="keyword">const</span> vec &amp;llr_in, bvec &amp;syst_bits);
399<a name="l00844"></a>00844   <span class="keyword">virtual</span> bvec <a class="code" href="classitpp_1_1LDPC__Code.html#99fb8f359baa6fb4aaa1e8e46dcd5281" title="Inherited from the base class - not implemented here.">decode</a>(<span class="keyword">const</span> vec &amp;llr_in);
400<a name="l00845"></a>00845
401<a name="l00847"></a>00847   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Code.html#fcddb278cb81265d6354094087dfcaca" title="This function is a wrapper for bp_decode().">decode_soft_out</a>(<span class="keyword">const</span> vec &amp;llr_in, vec &amp;llr_out);
402<a name="l00849"></a>00849   vec <a class="code" href="classitpp_1_1LDPC__Code.html#fcddb278cb81265d6354094087dfcaca" title="This function is a wrapper for bp_decode().">decode_soft_out</a>(<span class="keyword">const</span> vec &amp;llr_in);
403<a name="l00850"></a>00850
404<a name="l00873"></a>00873   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1LDPC__Code.html#d2643b5e6178c9664e4bc34621868f74" title="Belief propagation decoding.">bp_decode</a>(<span class="keyword">const</span> QLLRvec &amp;LLRin, QLLRvec &amp;LLRout);
405<a name="l00874"></a>00874
406<a name="l00883"></a>00883   <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1LDPC__Code.html#a7dda5d95ea5b2e1967f7530089e2686" title="Syndrome check, on QLLR vector.">syndrome_check</a>(<span class="keyword">const</span> QLLRvec &amp;LLR) <span class="keyword">const</span>;
407<a name="l00884"></a>00884
408<a name="l00886"></a>00886   <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1LDPC__Code.html#a7dda5d95ea5b2e1967f7530089e2686" title="Syndrome check, on QLLR vector.">syndrome_check</a>(<span class="keyword">const</span> bvec &amp;b) <span class="keyword">const</span>;
409<a name="l00887"></a>00887
410<a name="l00888"></a>00888   <span class="comment">// ------------ Basic information gathering functions ------</span>
411<a name="l00889"></a>00889
412<a name="l00891"></a><a class="code" href="classitpp_1_1LDPC__Code.html#0b5bb00ac0c304d4d98c3a803238a852">00891</a>   <span class="keywordtype">double</span> <a class="code" href="classitpp_1_1LDPC__Code.html#0b5bb00ac0c304d4d98c3a803238a852" title="Get the coderate.">get_rate</a>()<span class="keyword"> const </span>{
413<a name="l00892"></a>00892     <span class="keywordflow">return</span> (1.0 - static_cast&lt;double&gt;(<a class="code" href="classitpp_1_1LDPC__Code.html#ba49268475773e439d266ff900312060" title="Number of check nodes.">ncheck</a>) / <a class="code" href="classitpp_1_1LDPC__Code.html#67763300074130d403b921e30bc73c18" title="Number of variable nodes.">nvar</a>);
414<a name="l00893"></a>00893   }
415<a name="l00894"></a>00894
416<a name="l00896"></a><a class="code" href="classitpp_1_1LDPC__Code.html#89cbc43a80cb950399b220343a45a551">00896</a>   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1LDPC__Code.html#89cbc43a80cb950399b220343a45a551" title="Get the number of variable nodes.">get_nvar</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1LDPC__Code.html#67763300074130d403b921e30bc73c18" title="Number of variable nodes.">nvar</a>; }
417<a name="l00897"></a>00897
418<a name="l00899"></a><a class="code" href="classitpp_1_1LDPC__Code.html#e29d996569bb6d7c4dd1d515f0575adc">00899</a>   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1LDPC__Code.html#e29d996569bb6d7c4dd1d515f0575adc" title="Get the number of check nodes.">get_ncheck</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1LDPC__Code.html#ba49268475773e439d266ff900312060" title="Number of check nodes.">ncheck</a>; }
419<a name="l00900"></a>00900
420<a name="l00902"></a><a class="code" href="classitpp_1_1LDPC__Code.html#88cda37174caacfb6d0f6f2c5ee46748">00902</a>   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1LDPC__Code.html#88cda37174caacfb6d0f6f2c5ee46748" title="Get the number of information bits per codeword.">get_ninfo</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1LDPC__Code.html#67763300074130d403b921e30bc73c18" title="Number of variable nodes.">nvar</a> - <a class="code" href="classitpp_1_1LDPC__Code.html#ba49268475773e439d266ff900312060" title="Number of check nodes.">ncheck</a>; }
421<a name="l00903"></a>00903
422<a name="l00905"></a><a class="code" href="classitpp_1_1LDPC__Code.html#644fa7036ea884b6157b009377532060">00905</a>   std::string <a class="code" href="classitpp_1_1LDPC__Code.html#644fa7036ea884b6157b009377532060" title="Return the decoding method.">get_decoding_method</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1LDPC__Code.html#fae3d84382be09abb61569fc1dd22023" title="Decoding method.">dec_method</a>; }
423<a name="l00906"></a>00906
424<a name="l00908"></a><a class="code" href="classitpp_1_1LDPC__Code.html#249b1d3890a6d622ea46dbdf303394fe">00908</a>   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1LDPC__Code.html#249b1d3890a6d622ea46dbdf303394fe" title="Get the maximum number of iterations of the decoder.">get_nrof_iterations</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1LDPC__Code.html#bb224992cccd0175c11dd347052736d4" title="Maximum number of iterations.">max_iters</a>; }
425<a name="l00909"></a>00909
426<a name="l00911"></a><a class="code" href="classitpp_1_1LDPC__Code.html#73803c985e4fee2942e280f0598a1308">00911</a>   <a class="code" href="classitpp_1_1LLR__calc__unit.html" title="Log-likelihood algebra calculation unit.">LLR_calc_unit</a> <a class="code" href="classitpp_1_1LDPC__Code.html#73803c985e4fee2942e280f0598a1308" title="Get LLR calculation unit used in decoder.">get_llrcalc</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1LDPC__Code.html#50db4abe3af5c9e57ccf8c2a8f488433" title="LLR calculation unit.">llrcalc</a>; }
427<a name="l00912"></a>00912
428<a name="l00914"></a>00914   <span class="keyword">friend</span> std::ostream &amp;<a class="code" href="classitpp_1_1LDPC__Code.html#98ccdcb0c1e67513c9e65539ef777f96" title="Print some properties of the codec in plain text.">operator&lt;&lt;</a>(std::ostream &amp;os, <span class="keyword">const</span> <a class="code" href="classitpp_1_1LDPC__Code.html" title="Low-density parity check (LDPC) codec.">LDPC_Code</a> &amp;C);
429<a name="l00915"></a>00915
430<a name="l00916"></a>00916 <span class="keyword">protected</span>:
431<a name="l00917"></a><a class="code" href="classitpp_1_1LDPC__Code.html#3c4fd1b5f0853d65d4721aabcb6269a0">00917</a>   <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1LDPC__Code.html#3c4fd1b5f0853d65d4721aabcb6269a0" title="true if parity check matrix is defined">H_defined</a>
432<a name="l00918"></a><a class="code" href="classitpp_1_1LDPC__Code.html#f4ed785144777a683e3403f46a14c8b9">00918</a>   <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1LDPC__Code.html#f4ed785144777a683e3403f46a14c8b9" title="true if generator is defined">G_defined</a>
433<a name="l00919"></a><a class="code" href="classitpp_1_1LDPC__Code.html#67763300074130d403b921e30bc73c18">00919</a>   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1LDPC__Code.html#67763300074130d403b921e30bc73c18" title="Number of variable nodes.">nvar</a>;   
434<a name="l00920"></a><a class="code" href="classitpp_1_1LDPC__Code.html#ba49268475773e439d266ff900312060">00920</a>   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1LDPC__Code.html#ba49268475773e439d266ff900312060" title="Number of check nodes.">ncheck</a>;   
435<a name="l00921"></a><a class="code" href="classitpp_1_1LDPC__Code.html#8e0a35c62e26fe98fe3a0b1fbdbb4ac0">00921</a>   <a class="code" href="classitpp_1_1LDPC__Generator.html" title="LDPC Generator pure virtual base class.">LDPC_Generator</a> *<a class="code" href="classitpp_1_1LDPC__Code.html#8e0a35c62e26fe98fe3a0b1fbdbb4ac0" title="Generator object pointer.">G</a>
436<a name="l00922"></a>00922
437<a name="l00923"></a>00923   <span class="comment">// decoder parameters</span>
438<a name="l00924"></a><a class="code" href="classitpp_1_1LDPC__Code.html#fae3d84382be09abb61569fc1dd22023">00924</a>   std::string <a class="code" href="classitpp_1_1LDPC__Code.html#fae3d84382be09abb61569fc1dd22023" title="Decoding method.">dec_method</a>;
439<a name="l00925"></a><a class="code" href="classitpp_1_1LDPC__Code.html#bb224992cccd0175c11dd347052736d4">00925</a>   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1LDPC__Code.html#bb224992cccd0175c11dd347052736d4" title="Maximum number of iterations.">max_iters</a>
440<a name="l00926"></a><a class="code" href="classitpp_1_1LDPC__Code.html#162ef04a7ab6c84ae7eecddc62652105">00926</a>   <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1LDPC__Code.html#162ef04a7ab6c84ae7eecddc62652105" title="check syndrom after each iteration">psc</a>;   
441<a name="l00927"></a><a class="code" href="classitpp_1_1LDPC__Code.html#64ca9f09f9fe699f0be44b7187f7b54a">00927</a>   <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1LDPC__Code.html#64ca9f09f9fe699f0be44b7187f7b54a" title="check syndrom before first iteration">pisc</a>;   
442<a name="l00928"></a><a class="code" href="classitpp_1_1LDPC__Code.html#50db4abe3af5c9e57ccf8c2a8f488433">00928</a>   <a class="code" href="classitpp_1_1LLR__calc__unit.html" title="Log-likelihood algebra calculation unit.">LLR_calc_unit</a> <a class="code" href="classitpp_1_1LDPC__Code.html#50db4abe3af5c9e57ccf8c2a8f488433" title="LLR calculation unit.">llrcalc</a>;
443<a name="l00929"></a>00929
444<a name="l00931"></a>00931   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Code.html#315028cb705384218de166866966bd8c" title="Function to compute decoder parameterization.">decoder_parameterization</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1LDPC__Parity.html" title="LDPC parity check matrix generic class.">LDPC_Parity</a>* <span class="keyword">const</span> H);
445<a name="l00932"></a>00932
446<a name="l00934"></a>00934   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Code.html#8d5308e5ca059e8b15aaa44402c381ca" title="Function to check the integrity of the parity check matrix and generator.">integrity_check</a>();
447<a name="l00935"></a>00935
448<a name="l00937"></a>00937   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1LDPC__Code.html#91e331956ee790ae2f6f732b9310b0cf" title="Initialize decoder.">setup_decoder</a>();
449<a name="l00938"></a>00938
450<a name="l00939"></a>00939 <span class="keyword">private</span>:
451<a name="l00940"></a>00940   <span class="comment">// Parity check matrix parameterization</span>
452<a name="l00941"></a>00941   ivec C, V, sumX1, sumX2, iind, jind;
453<a name="l00942"></a>00942
454<a name="l00943"></a>00943   <span class="comment">// temporary storage for decoder (memory allocated when codec defined)</span>
455<a name="l00944"></a>00944   QLLRvec mvc, mcv;
456<a name="l00945"></a>00945 };
457<a name="l00946"></a>00946
458<a name="l00947"></a>00947
459<a name="l00952"></a>00952 std::ostream &amp;<a class="code" href="group__fixed.html#g46e967850e616363aeabd2cda5bcc159" title="Set output mode.">operator&lt;&lt;</a>(std::ostream &amp;os, <span class="keyword">const</span> <a class="code" href="classitpp_1_1LDPC__Code.html" title="Low-density parity check (LDPC) codec.">LDPC_Code</a> &amp;C);
460<a name="l00953"></a>00953 }
461<a name="l00954"></a>00954
462<a name="l00955"></a>00955 <span class="preprocessor">#endif</span>
463</pre></div></div>
464<hr size="1"><address style="text-align: right;"><small>Generated on Tue Jun 2 10:02:11 2009 for mixpp by&nbsp;
465<a href="http://www.doxygen.org/index.html">
466<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
467</body>
468</html>
Note: See TracBrowser for help on using the browser.