Skip to content

Commit e88f9cb

Browse files
committed
Fix to string
1 parent ae79be5 commit e88f9cb

6 files changed

Lines changed: 18 additions & 15 deletions

File tree

ddsketch/include/ddsketch.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class DDSketch {
6161
static DDSketch deserialize(std::istream& is);
6262
int get_serialized_size_bytes() const;
6363

64-
template<class A>
64+
template<class A = std::allocator<char>>
6565
string<A> to_string() const;
6666
bool operator==(const DDSketch<Store, Mapping>& other) const;
6767
protected:

ddsketch/include/ddsketch_impl.hpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -252,13 +252,14 @@ template<class A>
252252
string<A> DDSketch<Store, Mapping>::to_string() const {
253253
std::ostringstream os;
254254
os << "### ddsketch summary:" << std::endl;
255-
os << " Index mapping :" << std::endl;
256-
os << index_mapping.to_string() << std::endl;
257-
os << " Positive store :" << std::endl;
258-
os << positive_store.to_string() << std::endl;
259-
os << " Negative store :" << std::endl;
260-
os << negative_store.to_string() << std::endl;
261-
os << " Zero count :" << zero_count << std::endl;
255+
os << " Index mapping " << std::endl;
256+
os << index_mapping.to_string();
257+
os << " Positive store " << std::endl;
258+
os << positive_store.to_string();
259+
os << " Negative store " << std::endl;
260+
os << negative_store.to_string();
261+
os << " Zero count " << zero_count << std::endl;
262+
os << "### End ddsketch summary" << std::endl;
262263
return os.str();
263264

264265
}

ddsketch/include/dense_store_impl.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,10 +447,10 @@ int DenseStore<Derived, Allocator>::get_serialized_size_bytes_common() const {
447447
template<class Derived, typename Allocator>
448448
string<Allocator> DenseStore<Derived, Allocator>::to_string() const {
449449
std::ostringstream os;
450-
os << " Type : dense store " << std::endl;
451-
os << " Bins number : " << bins.size() << std::endl;
452-
os << " Min index : " << min_index << std::endl;
453-
os << " Max index : " << max_index << std::endl;
450+
os << " Type : dense store " << std::endl;
451+
os << " Bins number :" << bins.size() << std::endl;
452+
os << " Min index :" << min_index << std::endl;
453+
os << " Max index :" << max_index << std::endl;
454454
return os.str();
455455
}
456456
}

ddsketch/include/log_like_index_mapping.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class LogLikeIndexMapping : public IndexMapping<Derived> {
4040
double max_indexable_value() const;
4141
void serialize(std::ostream& os) const;
4242

43-
template<class A>
43+
template<class A = std::allocator<char>>
4444
string<A> to_string() const;
4545

4646
bool operator==(const LogLikeIndexMapping<Derived>& other) const;

ddsketch/include/sparse_store_impl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ int SparseStore<Allocator>::get_serialized_size_bytes() const {
232232
template<typename Allocator>
233233
string<Allocator> SparseStore<Allocator>::to_string() const {
234234
std::ostringstream os;
235-
os << " Type : sparse store" << std::endl;
236-
os << " Bins number : " << bins.size() << std::endl;
235+
os << " Type : sparse store" << std::endl;
236+
os << " Bins number : " << bins.size() << std::endl;
237237
return os.str();
238238
}
239239

ddsketch/test/DDSketchTest.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,5 +581,7 @@ TEST_CASE("quantile", "[ddsketch]") {
581581

582582
// std::cout << ddsketch.get_quantile(0.5) << std::endl;
583583
// std::cout << ddsketch.get_rank(4) << std::endl;
584+
585+
std::cout << ddsketch.to_string();
584586
}
585587
} /* namespace datasketches */

0 commit comments

Comments
 (0)