From 6b5a6ffba93fd4e438747bb87d6e190813ab87dd Mon Sep 17 00:00:00 2001 From: KongDong Date: Sat, 2 Nov 2024 16:15:49 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20linux=E4=B8=8B=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E5=AF=BB=E4=BC=98=E7=B3=BB=E7=BB=9F=E5=B4=A9=E6=BA=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../selector/imp/optimal/OptimalSelectorBase.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hikyuu_cpp/hikyuu/trade_sys/selector/imp/optimal/OptimalSelectorBase.cpp b/hikyuu_cpp/hikyuu/trade_sys/selector/imp/optimal/OptimalSelectorBase.cpp index 5fdf3d3a..d0226aa3 100644 --- a/hikyuu_cpp/hikyuu/trade_sys/selector/imp/optimal/OptimalSelectorBase.cpp +++ b/hikyuu_cpp/hikyuu/trade_sys/selector/imp/optimal/OptimalSelectorBase.cpp @@ -154,9 +154,9 @@ void OptimalSelectorBase::_calculate_single(const vectorempty()) { // 降序排列,相等时取排在候选前面的 - std::sort( + std::stable_sort( selected_sys_list->begin(), selected_sys_list->end(), - [](const SystemWeight& a, const SystemWeight& b) { return a.weight >= b.weight; }); + [](const SystemWeight& a, const SystemWeight& b) { return a.weight > b.weight; }); size_t train_start = train_ranges[i].first; size_t test_start = train_ranges[i].second; @@ -210,9 +210,9 @@ void OptimalSelectorBase::_calculate_parallel(const vectorempty()) { // 降序排列,相等时取排在候选前面的 - std::sort( + std::stable_sort( selected_sys_list->begin(), selected_sys_list->end(), - [](const SystemWeight& a, const SystemWeight& b) { return a.weight >= b.weight; }); + [](const SystemWeight& a, const SystemWeight& b) { return a.weight > b.weight; }); } return selected_sys_list; });