Macaulay2 Engine
Loading...
Searching...
No Matches

◆ debug_check() [2/2]

template<typename Key>
int F4MonomialLookupTableT< Key >::debug_check ( mi_node * p,
const mi_node * up ) const
private

Definition at line 450 of file f4-monlookup.cpp.

457{
458 mi_node *q;
459 // First check the node 'p' itself
460 assert(p != nullptr);
461 assert(p->var >= 0);
462 if (up != nullptr) assert(p->var < up->var);
463 assert(p->header == p);
464 assert(p->tag == mi_node::node);
465 assert(p->down() == up);
466 assert(p->left != nullptr);
467 assert(p->right != nullptr);
468
469 // Now loop through each element in left/right chain, checking that
470 // v, e, left, right values are consistent.
471 for (q = p->left; q != p; q = q->left)
472 {
473 assert(q->left != nullptr);
474 assert(q->right != nullptr);
475 assert(q->header == p);
476 assert(q->right->left == q);
477 assert(q->left->right == q);
478 assert(q->var == p->var);
479 assert((q->right == p) || (q->exp < q->right->exp));
480 assert(q->exp >= 0);
481 }
482
483 // Now loop through again, this time descending into nodes
484 int c = 0;
485 for (q = p->right; q != p; q = q->right)
486 if (q->tag == mi_node::node)
487 c += debug_check(q->down(), q);
488 else
489 c++;
490 return c;
491}

References debug_check(), F4MonomialLookupTableT< Key >::mi_node::down, F4MonomialLookupTableT< Key >::mi_node::exp, F4MonomialLookupTableT< Key >::mi_node::header, F4MonomialLookupTableT< Key >::mi_node::left, F4MonomialLookupTableT< Key >::mi_node::node, p, F4MonomialLookupTableT< Key >::mi_node::right, F4MonomialLookupTableT< Key >::mi_node::tag, and F4MonomialLookupTableT< Key >::mi_node::var.

Referenced by debug_check(), and debug_check().