223 size_t leaveCount = 0;
224 typedef std::pair<const CellType*, size_t> Pair;
225 std::vector<Pair> stack;
226 stack.push_back(Pair(
Root(), 0));
229 Pair p = stack.back();
233 levelSum += p.second;
238 for (
unsigned int i = 0; i < CellType::NChildren; ++i)
241 stack.push_back(Pair(&((*p.first)[i]), p.second + 1));
244 return double(levelSum) / double(leaveCount);
260 std::vector<std::pair<const CellType*, size_t>> stack;
261 stack.push_back(std::make_pair(
Root(),
size_t(0)));
264 std::pair<const CellType*, size_t>
c = stack.back();
272 for (
unsigned int i = 0; i < Cell::NChildren; ++i)
275 stack.push_back(std::make_pair(&((*
c.first)[i]),
c.second + 1));
280 stack.push_back(std::make_pair(
Root(),
size_t(0)));
283 std::pair<const CellType*, size_t>
c = stack.back();
291 for (
unsigned int i = 0; i < Cell::NChildren; ++i)
294 stack.push_back(std::make_pair(&((*
c.first)[i]),
c.second + 1));