/** * Deletes the specified node from the tree.The child of this node becomes child * of its parent. * If the node has more than one child, nothing have to be done. * * @param node: the node, that has to be deleted * @param tree: the tree, from that the tree has to be deleted */ public static void pruneInnerNode(TreeNode node, Tree tree) { pruneInnerNode(node, tree, true, false); }
public static void pruneInnerNode(TreeNode node, Tree tree, boolean sumEdgeWeight) { pruneInnerNode(node, tree, sumEdgeWeight, false); }
public static void pruneDegreeOneNodes(Tree tree, boolean sumEdgeWeight, boolean useParentWeight) { for (int i = 0; i < tree.getMaxIndex(); i++) { TreeNode n = tree.getVertex(i); if (n == null) { continue; } //prune the node, if it is not null pruneInnerNode(n, tree, sumEdgeWeight, useParentWeight); } }
supertree.removeVertex(cladeToCheck); } else { TreeUtils.pruneInnerNode(cladeToCheck, supertree, false);
supertree.removeVertex(cladeNodeToCheck); } else { TreeUtils.pruneInnerNode(cladeNodeToCheck, supertree, false);