public class EfficientTreeUtils
extends java.lang.Object
Constructor and Description |
---|
EfficientTreeUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Iterable<java.lang.Integer> |
getAllNodes(EfficientTree tree) |
static java.lang.Iterable<java.lang.Integer> |
getAllNodes(EfficientTree tree,
int child) |
static int |
getChildNumberWith(EfficientTree tree,
int parent,
int grandChild) |
static int |
getChildWith(EfficientTree tree,
int parent,
int grandChild) |
static int |
getLowestCommonParent(EfficientTree tree,
int nodeA,
int nodeB) |
static int |
getParent(EfficientTree tree,
int node)
Returns the parent of node.
|
static boolean |
isConsistent(EfficientTree tree) |
static boolean |
isParentOf(EfficientTree tree,
int parent,
int child) |
static void |
removeChild(EfficientTree tree,
int parent,
int child)
Remove a child of a node.
|
static void |
replaceNodeWithTau(EfficientTree tree,
int node)
Replace a node and all of its children by a single tau.
|
public static boolean isConsistent(EfficientTree tree)
public static int getParent(EfficientTree tree, int node)
node
- public static void removeChild(EfficientTree tree, int parent, int child)
parent
- child
- public static void replaceNodeWithTau(EfficientTree tree, int node)
tree
- node
- public static boolean isParentOf(EfficientTree tree, int parent, int child)
parent
- child
- public static int getChildWith(EfficientTree tree, int parent, int grandChild)
parent
- grandChild
- public static int getChildNumberWith(EfficientTree tree, int parent, int grandChild)
parent
- grandChild
- public static int getLowestCommonParent(EfficientTree tree, int nodeA, int nodeB)
tree
- nodeA
- nodeB
- public static java.lang.Iterable<java.lang.Integer> getAllNodes(EfficientTree tree)
public static java.lang.Iterable<java.lang.Integer> getAllNodes(EfficientTree tree, int child)