Lines Matching refs:depth

124 // E.g., if, in a particular instantiation, the maximum number of nodes in a tree instance is 1,000,000, the maximum depth should be 28.
165 // Initialize depth to invalid value, to indicate iterator is
167 Iterator() { depth = ~0U; }
182 depth = ~0U;
203 depth = d;
210 depth = d;
227 depth = ~0U;
232 if (depth != ~0U)
233 path_h[depth] = h;
234 depth++;
245 depth = ~0U;
250 if (depth != ~0U)
251 path_h[depth] = h;
252 depth++;
259 if (depth == ~0U)
262 return depth == 0 ? tree_->abs.root : path_h[depth - 1];
267 if (depth != ~0U) {
271 if (depth == 0) {
272 depth = ~0U;
275 depth--;
276 } while (branch[depth]);
278 branch[depth] = true;
279 path_h[depth++] = h;
284 branch[depth] = false;
285 path_h[depth++] = h;
293 if (depth != ~0U) {
297 if (depth == 0) {
298 depth = ~0U;
301 depth--;
302 } while (!branch[depth]);
304 branch[depth] = false;
305 path_h[depth++] = h;
310 branch[depth] = true;
311 path_h[depth++] = h;
331 // Zero-based depth of path into tree.
332 unsigned depth;
353 // less from the node at depth N, if true branch greater.
356 // If rem[N] is true, then for the current subtree at depth N, it's
361 unsigned depth = 0;
381 rem[depth] = !!(num_sub & 1);
382 branch[depth++] = false;
412 while (depth) {
413 depth--;
414 if (!branch[depth])
425 // num_sub = 2 * (num_sub - rem[depth]) + rem[depth] + 1
427 num_sub += 1 - rem[depth];
453 branch[depth] = true;
454 num_sub += rem[depth++];
607 // Zero-based depth in tree.
608 unsigned depth = 0, unbal_depth = 0;
624 unbal_depth = depth;
632 branch[depth++] = cmp > 0;
641 depth = unbal_depth;
646 cmp = branch[depth++] ? 1 : -1;
662 cmp = branch[depth++] ? 1 : -1;
677 depth = unbal_depth - 1;
678 cmp = branch[depth] ? 1 : -1;
757 // Zero-based depth in tree.
758 unsigned depth = 0, rm_depth;
780 branch[depth++] = cmp > 0;
785 rm_depth = depth;
796 branch[depth] = false;
800 branch[depth] = true;
803 depth++;
812 branch[depth] = false;
815 branch[depth] = true;
817 depth++;
840 // from a depth of 2 to 1. If "path" is the node to be removed, we
853 depth = rm_depth - 1;
854 if (branch[depth])
866 depth = 0;
868 if (branch[depth++]) {
902 cmp = branch[--depth] ? 1 : -1;