|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jebl.evolution.trees.ClusteringTreeBuilder<T>
public abstract class ClusteringTreeBuilder<T extends Tree>
An abstract base class for clustering algorithms from pairwise distances
Field Summary | |
---|---|
protected int[] |
alias
|
protected int |
besti
|
protected int |
bestj
|
protected Node[] |
clusters
|
protected double[][] |
distance
|
protected DistanceMatrix |
distanceMatrix
|
protected int |
minimumTaxa
|
protected Node |
newCluster
|
protected int |
numClusters
|
protected int[] |
tipCount
|
Constructor Summary | |
---|---|
protected |
ClusteringTreeBuilder(DistanceMatrix distanceMatrix,
int minimumTaxa)
Constructor |
Method Summary | |
---|---|
void |
addProgressListener(ProgressListener listener)
|
T |
build()
|
protected abstract Node |
createExternalNode(Taxon taxon)
|
protected abstract Node |
createInternalNode(Node[] nodes,
double[] distances)
|
protected void |
findNextPair()
Find next two clusters to join. |
protected void |
finish()
|
void |
fireSetProgress(double fractionCompleted)
|
static ClusteringTreeBuilder |
getBuilder(TreeBuilderFactory.Method method,
DistanceMatrix distances)
A factory method to create a ClusteringTreeBuilder |
protected double |
getDist(int a,
int b)
|
protected abstract T |
getTree()
|
protected void |
init(DistanceMatrix distanceMatrix)
|
protected abstract double[] |
joinClusters()
Inform derived class that clusters besti,bestj are being joinded into a new cluster. |
protected void |
newCluster()
|
void |
removeProgressListener(ProgressListener listener)
|
protected abstract double |
updatedDistance(int k)
compute updated distance between the new cluster (besti,bestj) to any other cluster k. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final DistanceMatrix distanceMatrix
protected int numClusters
protected Node[] clusters
protected Node newCluster
protected int besti
protected int bestj
protected int[] tipCount
protected int[] alias
protected double[][] distance
protected int minimumTaxa
Constructor Detail |
---|
protected ClusteringTreeBuilder(DistanceMatrix distanceMatrix, int minimumTaxa) throws IllegalArgumentException
distanceMatrix
- minimumTaxa
-
IllegalArgumentException
Method Detail |
---|
public T build()
build
in interface TreeBuilder<T extends Tree>
public void addProgressListener(ProgressListener listener)
addProgressListener
in interface TreeBuilder<T extends Tree>
public void removeProgressListener(ProgressListener listener)
removeProgressListener
in interface TreeBuilder<T extends Tree>
public void fireSetProgress(double fractionCompleted)
public static ClusteringTreeBuilder getBuilder(TreeBuilderFactory.Method method, DistanceMatrix distances)
method
- build method to use.distances
- Pre computed pairwise distances.
protected abstract T getTree()
protected abstract Node createExternalNode(Taxon taxon)
protected abstract Node createInternalNode(Node[] nodes, double[] distances)
protected abstract double[] joinClusters()
protected abstract double updatedDistance(int k)
protected double getDist(int a, int b)
protected void init(DistanceMatrix distanceMatrix)
protected void findNextPair()
protected void newCluster()
protected void finish()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |