MCPcopy Create free account
hub / github.com/Tencent/embedx / CheckDistribution

Function CheckDistribution

src/sampler/sampling/sampling_validator.cc:35–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33constexpr int ROUND_TO_VALID = 5;
34
35bool CheckDistribution(const vec_pair_t& distribution) {
36 set_int_t nodes;
37 for (const auto& pair : distribution) {
38 if (nodes.count(pair.first)) {
39 DXERROR("Duplicate node: %" PRIu64 " in distribution.", pair.first);
40 return false;
41 } else {
42 nodes.emplace(pair.first);
43 }
44 }
45
46 return !nodes.empty();
47}
48
49void DrawKHypothesis(int k, const vec_pair_t& ground_truth_distribution,
50 vec_pair_t* distribution_to_validate) {

Callers 1

TestMethod · 0.85

Calls 1

emplaceMethod · 0.80

Tested by 1

TestMethod · 0.68