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 2020/11/03 22:49:12 UTC
[incubator-datasketches-cpp] branch req_sketch updated: better
to_string
This is an automated email from the ASF dual-hosted git repository.
alsay pushed a commit to branch req_sketch
in repository https://gitbox.apache.org/repos/asf/incubator-datasketches-cpp.git
The following commit(s) were added to refs/heads/req_sketch by this push:
new befb0ca better to_string
befb0ca is described below
commit befb0caa870e14651e4888f9029039be5b1a10db
Author: AlexanderSaydakov <Al...@users.noreply.github.com>
AuthorDate: Tue Nov 3 14:48:59 2020 -0800
better to_string
---
req/include/req_sketch_impl.hpp | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/req/include/req_sketch_impl.hpp b/req/include/req_sketch_impl.hpp
index f8f592a..86a6ae3 100755
--- a/req/include/req_sketch_impl.hpp
+++ b/req/include/req_sketch_impl.hpp
@@ -152,13 +152,14 @@ string<A> req_sketch<T, H, C, S, A>::to_string(bool print_levels, bool print_ite
std::basic_ostringstream<char, std::char_traits<char>, AllocChar<A>> os;
os << "### REQ sketch summary:" << std::endl;
os << " K : " << k_ << std::endl;
- os << " N : " << n_ << std::endl;
+ os << " High Rank Acc : " << (H ? "true" : "false") << std::endl;
os << " Empty : " << (is_empty() ? "true" : "false") << std::endl;
os << " Estimation mode: " << (is_estimation_mode() ? "true" : "false") << std::endl;
- os << " Levels : " << compactors_.size() << std::endl;
os << " Sorted : " << (compactors_[0].is_sorted() ? "true" : "false") << std::endl;
- os << " Capacity items : " << max_nom_size_ << std::endl;
+ os << " N : " << n_ << std::endl;
+ os << " Levels : " << compactors_.size() << std::endl;
os << " Retained items : " << num_retained_ << std::endl;
+ os << " Capacity items : " << max_nom_size_ << std::endl;
// os << " Storage bytes : " << get_serialized_size_bytes() << std::endl;
// if (!is_empty()) {
// os << " Min value : " << *min_value_ << std::endl;
@@ -179,6 +180,14 @@ string<A> req_sketch<T, H, C, S, A>::to_string(bool print_levels, bool print_ite
if (print_items) {
os << "### REQ sketch data:" << std::endl;
+ unsigned level = 0;
+ for (const auto& compactor: compactors_) {
+ os << " level " << level << ": " << std::endl;
+ for (const auto& item: compactor.get_items()) {
+ os << " " << item << std::endl;
+ }
+ ++level;
+ }
os << "### End sketch data" << std::endl;
}
return os.str();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org