messif.pivotselection
Class ClusterPivotChooser.Pair

java.lang.Object
  extended by messif.pivotselection.ClusterPivotChooser.Pair
All Implemented Interfaces:
java.lang.Comparable<ClusterPivotChooser.Pair>
Enclosing class:
ClusterPivotChooser

protected class ClusterPivotChooser.Pair
extends java.lang.Object
implements java.lang.Comparable<ClusterPivotChooser.Pair>

Class encapsulating two clusters and the diameters of a cluster that would be produced be merging these clusters.


Field Summary
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 Summary
ClusterPivotChooser.Pair(ClusterPivotChooser.Cluster cluster1, ClusterPivotChooser.Cluster cluster2, ClusterPivotChooser.PrecomputedDistances pd)
          Creates a new pair of two cluster.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cluster1

protected ClusterPivotChooser.Cluster cluster1
Cluster id


cluster2

protected ClusterPivotChooser.Cluster cluster2
Cluster id


radius

protected float radius
Covering radius of a cluster if cluster1 and cluster2 were merged.

Constructor Detail

ClusterPivotChooser.Pair

public ClusterPivotChooser.Pair(ClusterPivotChooser.Cluster cluster1,
                                ClusterPivotChooser.Cluster cluster2,
                                ClusterPivotChooser.PrecomputedDistances pd)
Creates a new pair of two cluster. It also computes the radius of the cluster that would result from merging the passed clusters.

Parameters:
cluster1 - the first cluster
cluster2 - the second cluster
pd - cache of precomputed distances between all pairs of objects
Method Detail

compareTo

public int compareTo(ClusterPivotChooser.Pair o)
Specified by:
compareTo in interface java.lang.Comparable<ClusterPivotChooser.Pair>

getClusteroid

public LocalAbstractObject getClusteroid()
Clusteroid of the cluster that would be formed by merging the two clusters passed to the constructor.

Returns:
clusteroid of the merged cluster

getRadius

public float getRadius()
Radius of the cluster that would result from merging the clusters of this pair.

Returns:
radius of the merged cluster

getFirstCluster

public ClusterPivotChooser.Cluster getFirstCluster()
Returns the first cluster in this pair

Returns:
the first cluster

getSecondCluster

public ClusterPivotChooser.Cluster getSecondCluster()
Returns the second cluster in this pair

Returns:
the second cluster

update

public 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.

Parameters:
pd - cache of precomputed distances between all pairs of objects