diff --git a/src/core/algorithms/fd/tane/pfdtane.cpp b/src/core/algorithms/fd/tane/pfdtane.cpp index 68c7ccc10..2dfd0a013 100644 --- a/src/core/algorithms/fd/tane/pfdtane.cpp +++ b/src/core/algorithms/fd/tane/pfdtane.cpp @@ -1,5 +1,7 @@ #include "pfdtane.h" +#include + #include "config/error/option.h" #include "config/error_measure/option.h" #include "enums.h" @@ -48,10 +50,10 @@ config::ErrorType PFDTane::CalculatePFDError(model::PositionListIndex const* x_p std::deque xa_index = xa_pli->GetIndex(); std::shared_ptr probing_table_ptr = x_pli->CalculateAndGetProbingTable(); auto const& probing_table = *probing_table_ptr; - std::sort(xa_index.begin(), xa_index.end(), - [&probing_table](Cluster const& a, Cluster const& b) { - return probing_table[a.front()] < probing_table[b.front()]; - }); + std::stable_sort(xa_index.begin(), xa_index.end(), + [&probing_table](Cluster const& a, Cluster const& b) { + return probing_table[a.front()] < probing_table[b.front()]; + }); double sum = 0.0; std::size_t cluster_rows_count = 0; std::deque const& x_index = x_pli->GetIndex(); diff --git a/src/tests/test_pfdtane.cpp b/src/tests/test_pfdtane.cpp index 1721ec7cf..a93c08556 100644 --- a/src/tests/test_pfdtane.cpp +++ b/src/tests/test_pfdtane.cpp @@ -65,9 +65,9 @@ INSTANTIATE_TEST_SUITE_P( PFDTaneTestMiningSuite, TestPFDTaneMining, ::testing::Values( PFDTaneMiningParams(44381, 0.3, +algos::PfdErrorMeasure::per_value, kTestFD), - PFDTaneMiningParams(39491, 0.1, +algos::PfdErrorMeasure::per_value, kIris), + PFDTaneMiningParams(19266, 0.1, +algos::PfdErrorMeasure::per_value, kIris), PFDTaneMiningParams(10695, 0.01, +algos::PfdErrorMeasure::per_value, kIris), - PFDTaneMiningParams(7893, 0.1, +algos::PfdErrorMeasure::per_value, kNeighbors10k), + PFDTaneMiningParams(44088, 0.1, +algos::PfdErrorMeasure::per_value, kNeighbors10k), PFDTaneMiningParams(41837, 0.01, +algos::PfdErrorMeasure::per_value, kNeighbors10k) ));