MCPcopy Create free account
hub / github.com/brainboxdotcc/DPP / root

Method root

mlspp/src/tree_math.cpp:89–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89NodeIndex
90NodeIndex::root(LeafCount n)
91{
92 if (n.val == 0) {
93 throw std::runtime_error("Root for zero-size tree is undefined");
94 }
95
96 auto w = NodeCount(n);
97 return NodeIndex{ (one << log2(w.val)) - 1 };
98}
99
100bool
101NodeIndex::is_leaf() const

Callers

nothing calls this directly

Calls 2

NodeCountClass · 0.85
log2Function · 0.85

Tested by

no test coverage detected