/** * Verifies the structure of the tree (does bounds checking on each node) * @return true if the structure of the tree * is correct. */ public boolean isCorrect() { for (int n = 0; n < size; n++) { INDArray point = data.slice(index[n]); if (!boundary.contains(point)) return false; } if (!isLeaf()) { boolean correct = true; for (int i = 0; i < numChildren; i++) correct = correct && children[i].isCorrect(); return correct; } return true; }