diff --git a/ldpc_decoder.hh b/ldpc_decoder.hh index fee71c3..32991c0 100644 --- a/ldpc_decoder.hh +++ b/ldpc_decoder.hh @@ -160,6 +160,7 @@ class LDPCDecoder lo[c].shi = shift[c] / W; shift[c] = (shift[c] + 1) % M; } + std::sort(lo, lo + cnt, [](const Loc &a, const Loc &b){ return a.off < b.off; }); TYPE par[2]; if (i) { par[0] = pty[W*(i-1)+j]; diff --git a/ldpc_decoder2.hh b/ldpc_decoder2.hh index 005e41b..c262b62 100644 --- a/ldpc_decoder2.hh +++ b/ldpc_decoder2.hh @@ -223,6 +223,7 @@ public: lo[c].shi = shift[c] / W; shift[c] = (shift[c] + 1) % M; } + std::sort(lo, lo + cnt, [](const Loc &a, const Loc &b){ return a.off < b.off; }); lo += cnt; } }