public class Cluster extends Object
| Modifier and Type | Field and Description |
|---|---|
double |
distanceBetween
The distance between left and right sub-clusters.
|
Cluster |
left
The left sub-cluster.
|
int |
level
The level from the root.
|
Cluster |
right
The right sub-cluster.
|
| Constructor and Description |
|---|
Cluster()
Constructor.
|
Cluster(String key)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Double |
distanceTo(Cluster otherCluster,
HashMap<String,HashMap<String,Double>> data,
CosineDistanceMatrix distanceMatrix,
LinkageCriterion criterion)
Compute the distance between words clusters.
|
boolean |
equals(Object obj) |
int |
hashCode() |
boolean |
isTerminal()
Returns true if left and right sub-nodes of this node are NULLs.
|
void |
merge(Cluster left,
Cluster right,
Double distance)
Merging together clusters.
|
String |
toNewick()
Returns the NEWICK format representation of this node cluster.
|
String |
toString() |
public Cluster left
public Cluster right
public int level
public double distanceBetween
public Cluster()
public Cluster(String key)
key - The single name of the cluster.public void merge(Cluster left, Cluster right, Double distance)
left - the left cluster.right - the right cluster.distance - the distance between clusters.public Double distanceTo(Cluster otherCluster, HashMap<String,HashMap<String,Double>> data, CosineDistanceMatrix distanceMatrix, LinkageCriterion criterion)
otherCluster - the other cluster.data - this cluster.distanceMatrix - the pre-computed distance matrix.criterion - the linkage criterion.public String toNewick()
public boolean isTerminal()
Copyright © 2021. All rights reserved.