diff --git a/osd.hh b/osd.hh index 27bc9b3..dfbc0c1 100644 --- a/osd.hh +++ b/osd.hh @@ -8,6 +8,7 @@ Copyright 2020 Ahmet Inan #include #include "bitman.hh" +#include "sort.hh" namespace CODE { @@ -104,6 +105,7 @@ class OrderedStatisticsDecoder int8_t codeword[W], candidate[W]; int8_t softperm[W]; int16_t perm[W]; + MergeSort sort; void row_echelon() { for (int k = 0; k < K; ++k) { @@ -173,7 +175,7 @@ public: perm[i] = i; for (int i = 0; i < N; ++i) softperm[i] = std::abs(std::max(soft[i], -127)); - std::sort(perm, perm+N, [this](int a, int b){ return softperm[a] > softperm[b]; }); + sort(perm, N, [this](int a, int b){ return softperm[a] > softperm[b]; }); for (int j = 0; j < K; ++j) for (int i = 0; i < N; ++i) G[W*j+i] = genmat[N*j+perm[i]]; @@ -247,6 +249,7 @@ class OrderedStatisticsListDecoder int8_t softperm[W]; int16_t perm[W]; int score[L], cperm[L]; + MergeSort sort; void row_echelon() { for (int k = 0; k < K; ++k) { @@ -332,7 +335,7 @@ public: perm[i] = i; for (int i = 0; i < N; ++i) softperm[i] = std::abs(std::max(soft[i], -127)); - std::sort(perm, perm+N, [this](int a, int b){ return softperm[a] > softperm[b]; }); + sort(perm, N, [this](int a, int b){ return softperm[a] > softperm[b]; }); for (int j = 0; j < K; ++j) for (int i = 0; i < N; ++i) G[W*j+i] = genmat[N*j+perm[i]]; diff --git a/tests/osd_regression_test.cc b/tests/osd_regression_test.cc index 020b491..33a59d4 100644 --- a/tests/osd_regression_test.cc +++ b/tests/osd_regression_test.cc @@ -7,7 +7,6 @@ Copyright 2020 Ahmet Inan #include #include #include -#include #include #include "osd.hh" #include "galois_field.hh" diff --git a/tests/osld_regression_test.cc b/tests/osld_regression_test.cc index 444cbbd..4feb0d3 100644 --- a/tests/osld_regression_test.cc +++ b/tests/osld_regression_test.cc @@ -7,7 +7,6 @@ Copyright 2024 Ahmet Inan #include #include #include -#include #include #include "osd.hh" #include "galois_field.hh"