Commit 9fc77606 authored by Kevin JOLY's avatar Kevin JOLY

Trailing whitespaces

parent 650da479
#include "CDecoder_MS_fixed_reds.h"
CDecoder_MS_fixed_reds::CDecoder_MS_fixed_reds()
CDecoder_MS_fixed_reds::CDecoder_MS_fixed_reds()
{
const size_t nb_edges = _M;
const size_t nb_rows = _K;
const size_t nb_rows = _K;
const size_t nb_cols = _N;
size_t row;
size_t vn_slot_offset, cn_slot_offset;
......@@ -29,7 +29,7 @@ CDecoder_MS_fixed_reds::CDecoder_MS_fixed_reds()
/* The following line is quite problematic. We assume that all CNs
* have the same degree like it is the case with a DVB-S2 LDPC code.
* (excluding the last CN, but it's not a problem here).
*
*
* What if the code has variable degree per CN ?
*/
row = edge_idx / cn_deg_max; // Also indicates the current CN
......@@ -43,7 +43,7 @@ CDecoder_MS_fixed_reds::CDecoder_MS_fixed_reds()
std::cout << "offset out of bound" << std::endl;
break;
}
}
}
while(p_cn_addr[vn_idx*vn_deg_max + cn_slot_offset] != NULL) {
cn_slot_offset++;
if(cn_slot_offset == vn_deg_max) {
......@@ -52,22 +52,22 @@ CDecoder_MS_fixed_reds::CDecoder_MS_fixed_reds()
}
}
p_vn_addr[row*cn_deg_max + vn_slot_offset] =
p_vn_addr[row*cn_deg_max + vn_slot_offset] =
&var_msgs[vn_idx*vn_deg_max + cn_slot_offset];
p_cn_addr[vn_idx*vn_deg_max + cn_slot_offset] =
p_cn_addr[vn_idx*vn_deg_max + cn_slot_offset] =
&check_msgs[row*cn_deg_max + vn_slot_offset];
}
}
CDecoder_MS_fixed_reds::~CDecoder_MS_fixed_reds()
CDecoder_MS_fixed_reds::~CDecoder_MS_fixed_reds()
{
delete p_vn_addr;
delete p_cn_addr;
}
void CDecoder_MS_fixed_reds::decode(
char var_nodes[],
char Rprime_fix[],
char var_nodes[],
char Rprime_fix[],
int nombre_iterations)
{
char *llr_vn = var_nodes;
......@@ -101,7 +101,7 @@ void CDecoder_MS_fixed_reds::decode(
* the last one. */
cn_deg = cn_idx == (nb_cn-1) ? DEG_2 : cn_deg_max;
/* We compute a different estimate (the message sent), for each
/* We compute a different estimate (the message sent), for each
* neighbouring VN */
for(size_t edge_idx = 0; edge_idx < cn_deg; edge_idx++) {
char sign = -1;
......@@ -127,9 +127,9 @@ void CDecoder_MS_fixed_reds::decode(
int estimate_acc = llr_vn[vn_idx];
for(
size_t edge_idx = 0;
edge_idx < vn_deg_max && p_cn_addr[vn_idx*vn_deg_max + edge_idx] != NULL;
edge_idx++)
size_t edge_idx = 0;
edge_idx < vn_deg_max && p_cn_addr[vn_idx*vn_deg_max + edge_idx] != NULL;
edge_idx++)
{
estimate_acc += *p_cn_addr[vn_idx*vn_deg_max + edge_idx];
}
......@@ -139,9 +139,9 @@ void CDecoder_MS_fixed_reds::decode(
else vn[vn_idx] = (char)estimate_acc;
for(
size_t edge_idx = 0;
edge_idx < vn_deg_max && p_cn_addr[vn_idx*vn_deg_max + edge_idx] != NULL;
edge_idx++)
size_t edge_idx = 0;
edge_idx < vn_deg_max && p_cn_addr[vn_idx*vn_deg_max + edge_idx] != NULL;
edge_idx++)
{
int msg = *p_cn_addr[vn_idx*vn_deg_max + edge_idx];
int vn_msg = estimate_acc - msg;
......@@ -157,4 +157,4 @@ void CDecoder_MS_fixed_reds::decode(
for(size_t vn_idx = 0; vn_idx < nb_vn; vn_idx++) {
Rprime_fix[vn_idx] = vn[vn_idx] > threshold ? 1 : 0;
}
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment