jmalkin commented on a change in pull request #217:
URL: https://github.com/apache/datasketches-cpp/pull/217#discussion_r635635010
##########
File path: theta/test/theta_jaccard_similarity_test.cpp
##########
@@ -140,4 +179,21 @@ TEST_CASE("theta jaccard: dissimilarity test",
"[theta_sketch]") {
REQUIRE_FALSE(theta_jaccard_similarity::dissimilarity_test(actual, actual,
threshold));
}
+TEST_CASE("theta jaccard: dissimilarity test custom seed", "[theta_sketch]") {
+ const int8_t min_lg_k = 12;
+ const int u1 = 1 << 20;
+ const int u2 = static_cast<int>(u1 * 0.05);
+ const double threshold = 0.061;
+ const uint64_t seed = 1234;
+
+ auto expected =
update_theta_sketch::builder().set_lg_k(min_lg_k).set_seed(seed).build();
+ for (int i = 0; i < u1; ++i) expected.update(i);
+
+ auto actual =
update_theta_sketch::builder().set_lg_k(min_lg_k).set_seed(seed).build();
+ for (int i = 0; i < u2; ++i) actual.update(i);
+
+ REQUIRE(theta_jaccard_similarity::dissimilarity_test(actual, expected,
threshold, seed));
+ REQUIRE_FALSE(theta_jaccard_similarity::dissimilarity_test(actual, actual,
threshold));
Review comment:
should this line have the seed passed in, too?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]