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

Function CountNodes

src/sampler/sampling/sampling_validator.cc:65–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65void CountNodes(const vec_int_t& nodes, const vec_pair_t& distribution,
66 index_map_t* node_count_map) {
67 node_count_map->clear();
68 node_count_map->reserve(distribution.size());
69 for (const auto& pair : distribution) {
70 node_count_map->emplace(pair.first, 0);
71 }
72
73 for (auto node : nodes) {
74 auto it = node_count_map->find(node);
75 if (it != node_count_map->end()) {
76 it->second += 1;
77 }
78 }
79}
80
81// Let Phi(Z_a) be the CDF of the variable x. Find the smallest Z_{a/2}, such
82// that Phi(Z_{a/2}) >= 1 - a/2.

Callers 1

TestMethod · 0.85

Calls 2

emplaceMethod · 0.80
clearMethod · 0.45

Tested by 1

TestMethod · 0.68