You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by al...@apache.org on 2024/10/21 22:17:54 UTC
(datasketches-cpp) 01/01: non-modifying merge
This is an automated email from the ASF dual-hosted git repository.
alsay pushed a commit to branch tdigest_const_merge
in repository https://gitbox.apache.org/repos/asf/datasketches-cpp.git
commit 67da6a9325a2967a0b53eb5cd9fb67f46ab9a2b3
Author: AlexanderSaydakov <Al...@users.noreply.github.com>
AuthorDate: Mon Oct 21 15:17:48 2024 -0700
non-modifying merge
---
tdigest/include/tdigest.hpp | 2 +-
tdigest/include/tdigest_impl.hpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tdigest/include/tdigest.hpp b/tdigest/include/tdigest.hpp
index 38f3b1a..bb4f737 100644
--- a/tdigest/include/tdigest.hpp
+++ b/tdigest/include/tdigest.hpp
@@ -115,7 +115,7 @@ public:
* Merge the given t-Digest into this one
* @param other t-Digest to merge
*/
- void merge(tdigest& other);
+ void merge(const tdigest& other);
/**
* Process buffered values and merge centroids if needed
diff --git a/tdigest/include/tdigest_impl.hpp b/tdigest/include/tdigest_impl.hpp
index afc64ef..165bda6 100644
--- a/tdigest/include/tdigest_impl.hpp
+++ b/tdigest/include/tdigest_impl.hpp
@@ -44,7 +44,7 @@ void tdigest<T, A>::update(T value) {
}
template<typename T, typename A>
-void tdigest<T, A>::merge(tdigest& other) {
+void tdigest<T, A>::merge(const tdigest& other) {
if (other.is_empty()) return;
vector_centroid tmp(buffer_.get_allocator());
tmp.reserve(buffer_.size() + centroids_.size() + other.buffer_.size() + other.centroids_.size());
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org