Skip to content

Commit 6a099b4

Browse files
author
Alexandre Marquet
committed
Fix backward iteration of log_bcjr.
1 parent 8b902e7 commit 6a099b4

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

log_bcjr.cc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ log_bcjr::compute_bw_metrics(const std::vector<float> &G,
147147
//Loop
148148
for(size_t i=0 ; i < d_I ; ++i) {
149149
*B_curr = max_star(*B_curr,
150-
B_next[(d_S-1)-*NS_it] + G_k[(d_S-1)-*OS_it]);
150+
B_next[(d_S-1)-*NS_it] + G_k[(d_O-1)-*OS_it]);
151151

152152
//Update PS/PI iterators
153153
++NS_it;
@@ -175,6 +175,14 @@ log_bcjr::compute_app(const std::vector<float> &A, const std::vector<float> &B,
175175
std::vector<float>::const_iterator A_it = A.begin();
176176
std::vector<float>::const_iterator B_it = B.begin() + d_S;
177177

178+
//std::vector<float>::const_iterator it1 = A.begin();
179+
//std::vector<float>::const_iterator it2 = B.begin();
180+
//while(it1 != A.end()) {
181+
// std::cout << "A " << *it1 << "\tB " << *it2 << std::endl;
182+
// ++it1; ++it2;
183+
//}
184+
//std::cout << std::endl;
185+
178186
out.reserve(d_S*d_I*K);
179187

180188
for(std::vector<float>::const_iterator G_k = G.begin() ;
@@ -191,6 +199,8 @@ log_bcjr::compute_app(const std::vector<float> &A, const std::vector<float> &B,
191199

192200
//Update backward iterator
193201
B_it += d_S;
202+
203+
//std::cout << "---------------------------------------------------" << std::endl;
194204
}
195205
}
196206

log_bcjr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <stdexcept>
2929
#include <cmath>
3030
#include <cfloat>
31+
//#include <iostream>
3132

3233
/*!
3334
* \brief <+description+>

0 commit comments

Comments
 (0)