private void computeClusterRec(MyPhyloTree n, MyNode v, BitSet cluster, int treeIndex) { if (v.getOutDegree() == 0) cluster.set(taxaOrdering.indexOf(n.getLabel(v))); else { Iterator<MyEdge> it = n.getOutEdges(v); while (it.hasNext()) { MyEdge e = it.next(); HashSet<Integer> indices = (HashSet<Integer>) e.getInfo(); if (indices.contains(treeIndex)) { MyNode c = e.getTarget(); computeClusterRec(n, c, cluster, treeIndex); } } } }
private boolean isClusterNode(MyNode v) { MyEdge outEdge = v.getOutEdges().next(); if (((HashSet<Integer>) outEdge.getInfo()).contains(-1)) return true; return false; }