MCPcopy Create free account
hub / github.com/ColdGrub1384/Pyto / assert_valid

Method assert_valid

site-packages/matplotlib/tri/_tri.cpp:1551–1589  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1549}
1550
1551void
1552TrapezoidMapTriFinder::Node::assert_valid(bool tree_complete) const
1553{
1554#ifndef NDEBUG
1555 // Check parents.
1556 for (Parents::const_iterator it = _parents.begin();
1557 it != _parents.end(); ++it) {
1558 Node* parent = *it;
1559 assert(parent != this && "Cannot be parent of self");
1560 assert(parent->has_child(this) && "Parent missing child");
1561 }
1562
1563 // Check children, and recurse.
1564 switch (_type) {
1565 case Type_XNode:
1566 assert(_union.xnode.left != 0 && "Null left child");
1567 assert(_union.xnode.left->has_parent(this) && "Incorrect parent");
1568 assert(_union.xnode.right != 0 && "Null right child");
1569 assert(_union.xnode.right->has_parent(this) && "Incorrect parent");
1570 _union.xnode.left->assert_valid(tree_complete);
1571 _union.xnode.right->assert_valid(tree_complete);
1572 break;
1573 case Type_YNode:
1574 assert(_union.ynode.below != 0 && "Null below child");
1575 assert(_union.ynode.below->has_parent(this) && "Incorrect parent");
1576 assert(_union.ynode.above != 0 && "Null above child");
1577 assert(_union.ynode.above->has_parent(this) && "Incorrect parent");
1578 _union.ynode.below->assert_valid(tree_complete);
1579 _union.ynode.above->assert_valid(tree_complete);
1580 break;
1581 case Type_TrapezoidNode:
1582 assert(_union.trapezoid != 0 && "Null trapezoid");
1583 assert(_union.trapezoid->trapezoid_node == this &&
1584 "Incorrect trapezoid node");
1585 _union.trapezoid->assert_valid(tree_complete);
1586 break;
1587 }
1588#endif
1589}
1590
1591void
1592TrapezoidMapTriFinder::Node::get_stats(int depth,

Callers 1

initializeMethod · 0.80

Calls 8

assertFunction · 0.85
has_childMethod · 0.80
has_parentMethod · 0.80
get_lower_right_pointMethod · 0.80
get_lower_left_pointMethod · 0.80
get_upper_right_pointMethod · 0.80
get_upper_left_pointMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected