From d710125be2958f0b76c2601c357966fd74263c87 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Tue, 23 Apr 2024 13:24:50 -0400 Subject: BSMTriespline: updated to use a rangecount query --- benchmarks/include/triespline_bsm.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/benchmarks/include/triespline_bsm.h b/benchmarks/include/triespline_bsm.h index 9613a62..4276074 100644 --- a/benchmarks/include/triespline_bsm.h +++ b/benchmarks/include/triespline_bsm.h @@ -34,6 +34,7 @@ public: /* return an empty result set if q is invalid */ if (q == nullptr) { + rs.push_back({0, 0}); return rs; } @@ -41,15 +42,18 @@ public: size_t idx = lower_bound(parms->lower_bound); + size_t cnt = 0; while (idx < m_data.size() && m_data[idx].first < parms->upper_bound) { - rs.emplace_back(m_data[idx++]); + cnt++; } + rs.push_back({cnt, 0}); + return std::move(rs); } std::vector query_merge(std::vector &rsa, std::vector &rsb) { - rsa.insert(rsa.end(), rsb.begin(), rsb.end()); + rsa[0].first += rsb[0].first; return std::move(rsa); } @@ -57,10 +61,8 @@ public: return m_data.size(); } - ~BSMTrieSpline() = default; - private: std::vector m_data; K m_max_key; -- cgit v1.2.3