protected class ClusterPivotChooser.Pair extends java.lang.Object implements java.lang.Comparable<ClusterPivotChooser.Pair>
Modifier and Type | Field and Description |
---|---|
protected ClusterPivotChooser.Cluster |
cluster1
Cluster id
|
protected ClusterPivotChooser.Cluster |
cluster2
Cluster id
|
protected float |
radius
Covering radius of a cluster if cluster1 and cluster2 were merged.
|
Constructor and Description |
---|
ClusterPivotChooser.Pair(ClusterPivotChooser.Cluster cluster1,
ClusterPivotChooser.Cluster cluster2,
ClusterPivotChooser.PrecomputedDistances pd)
Creates a new pair of two cluster.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ClusterPivotChooser.Pair o) |
LocalAbstractObject |
getClusteroid()
Clusteroid of the cluster that would be formed by merging the two clusters passed to the constructor.
|
ClusterPivotChooser.Cluster |
getFirstCluster()
Returns the first cluster in this pair
|
float |
getRadius()
Radius of the cluster that would result from merging the clusters of this pair.
|
ClusterPivotChooser.Cluster |
getSecondCluster()
Returns the second cluster in this pair
|
void |
update(ClusterPivotChooser.PrecomputedDistances pd)
Re-initializes the members
clusteroid and radius by computing the covering ball of the cluster formed
by the first and the second cluster of this pair. |
protected ClusterPivotChooser.Cluster cluster1
protected ClusterPivotChooser.Cluster cluster2
protected float radius
public ClusterPivotChooser.Pair(ClusterPivotChooser.Cluster cluster1, ClusterPivotChooser.Cluster cluster2, ClusterPivotChooser.PrecomputedDistances pd)
cluster1
- the first clustercluster2
- the second clusterpd
- cache of precomputed distances between all pairs of objectspublic int compareTo(ClusterPivotChooser.Pair o)
compareTo
in interface java.lang.Comparable<ClusterPivotChooser.Pair>
public LocalAbstractObject getClusteroid()
public float getRadius()
public ClusterPivotChooser.Cluster getFirstCluster()
public ClusterPivotChooser.Cluster getSecondCluster()
public void update(ClusterPivotChooser.PrecomputedDistances pd)
clusteroid
and radius
by computing the covering ball of the cluster formed
by the first and the second cluster of this pair.pd
- cache of precomputed distances between all pairs of objects