-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uint32_t weight in tdigest<float> + cross-language test #424
Conversation
Pull Request Test Coverage Report for Build 8056069290Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can improve one test slightly and I think we need to fix the weight type, unless the intent is to cast it into a floating-point type
tdigest/include/tdigest.hpp
Outdated
void add(const centroid& other) { | ||
weight_ += other.weight_; | ||
mean_ += (other.mean_ - mean_) * other.weight_ / weight_; | ||
} | ||
T get_mean() const { return mean_; } | ||
uint64_t get_weight() const { return weight_; } | ||
T get_weight() const { return weight_; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return type W?
tdigest/test/tdigest_test.cpp
Outdated
REQUIRE(bytes.size() == static_cast<size_t>(s.tellg())); | ||
|
||
REQUIRE(deserialized_td1.get_k() == deserialized_td2.get_k()); | ||
REQUIRE(deserialized_td1.get_total_weight() == deserialized_td2.get_total_weight()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This never actually checks that the weight is 0 or that is_empty()
returns true, only that they're equivalent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
generate files for Java