fn _validate_consistency(&self, index: Index, node_counter: &mut usize) {
        let node = &self.nodes[index];

        // increment the node counter
        *node_counter += 1;

        for (_, child_node) in self.child_iter(index) {
            // are all children of this node contained in the MBR of this node?
            assert_eq!(
                node.get_region().contains_region(child_node.get_region()),
                Ok(true)
            );

            // does every child have its parent attribute set correctly?
            assert_eq!(child_node.get_parent(), Some(index));
        }

        // validate all children of this node
        for child_index in node.child_index_iter() {
            self._validate_consistency(child_index, node_counter);
        }
    }
/// Recursively validates that the children of each node are contained in the MBR
/// of their parent.
Recursively validates that the children of each node are contained in the MBR
of their parent.
Recursively validates that the children of each node are contained in the MBR of their parent .
fn _validate_consistency(&self, index: Index, node_counter: &mut usize) {
        let node = &self.nodes[index];
        // increment the node counter
        *node_counter += 1;
        for (_, child_node) in self.child_iter(index) {
            // are all children of this node contained in the MBR of this node?
            assert_eq!(
                node.get_region().contains_region(child_node.get_region()),
                Ok(true)
            );
            // does every child have its parent attribute set correctly?
            assert_eq!(child_node.get_parent(), Some(index));
        }
        // validate all children of this node
        for child_index in node.child_index_iter() {
            self._validate_consistency(child_index, node_counter);
        }
    }
fn _validate_consistency ( & self , index : Index , node_counter : & mut usize ) { let node = & self . nodes [ index ] ; // increment the node counter * node_counter += 1 ; for ( _ , child_node ) in self . child_iter ( index ) { // are all children of this node contained in the MBR of this node? assert_eq ! ( node get_region ( ) contains_region ( child_node get_region ( ) ) Ok ( true ) ) ; // does every child have its parent attribute set correctly? assert_eq ! ( child_node get_parent ( ) Some ( index ) ) ; } // validate all children of this node for child_index in node . child_index_iter ( ) { self . _validate_consistency ( child_index , node_counter ) ; } }
Recursively validates that the children of each node are contained in the MBR
of their parent.
Recursively validates that the children of each node are contained in the MBR of their parent .
&self
index
Index
node_counter
&mut usize
&self
index
Index
node_counter
&mut usize