Skip to content

Commit 82630e5

Browse files
MaheshGPaiMahesh Pai
authored andcommitted
Provide get_centroids implementation
1 parent 87c9c4a commit 82630e5

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

tdigest/include/tdigest.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ class tdigest {
143143
*/
144144
uint64_t get_total_weight() const;
145145

146+
/**
147+
* @return centroids
148+
*/
149+
vector_centroid get_centroids() const;
150+
146151
/**
147152
* Returns an instance of the allocator for this t-Digest.
148153
* @return allocator

tdigest/include/tdigest_impl.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ uint64_t tdigest<T, A>::get_total_weight() const {
8585
return centroids_weight_ + buffer_.size();
8686
}
8787

88+
template<typename T, typename A>
89+
auto tdigest<T, A>::get_centroids() const -> vector_centroid{
90+
return centroids_;
91+
}
92+
8893
template<typename T, typename A>
8994
A tdigest<T, A>::get_allocator() const {
9095
return buffer_.get_allocator();

0 commit comments

Comments
 (0)