diff options
| author | Douglas Rumbaugh <dbr4@psu.edu> | 2024-04-23 13:24:50 -0400 |
|---|---|---|
| committer | Douglas Rumbaugh <dbr4@psu.edu> | 2024-04-23 13:24:50 -0400 |
| commit | d710125be2958f0b76c2601c357966fd74263c87 (patch) | |
| tree | 2b6c852d4ceacd41054bfe4e064e32ca0bee3d04 /benchmarks | |
| parent | fb08023dea10c9a7673ceb2c8ef67718937717b8 (diff) | |
| download | dynamic-extension-d710125be2958f0b76c2601c357966fd74263c87.tar.gz | |
BSMTriespline: updated to use a rangecount query
Diffstat (limited to 'benchmarks')
| -rw-r--r-- | benchmarks/include/triespline_bsm.h | 10 |
1 files 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<R> query_merge(std::vector<R> &rsa, std::vector<R> &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<R> m_data; K m_max_key; |