public final ClusNode getTree(int fold) { int idx = Arrays.binarySearch(m_Folds, fold); ClusNode node = m_Nodes[idx]; if (node.hasBestTest() && node.atBottomLevel()) { OptXValSplit split = null; int nb = getNbChildren(); for (int i = 0; i < nb; i++) { OptXValSplit msplit = (OptXValSplit) getChild(i); if (msplit.contains(fold)) { split = msplit; break; } } int arity = node.updateArity(); for (int i = 0; i < arity; i++) { OptXValNode subnode = (OptXValNode) split.getChild(i); node.setChild(subnode.getTree(fold), i); } } return node; }