public class SynchronizedCluster<T extends DoubleVector> extends Object implements Cluster<T>
Clusters.| Constructor and Description |
|---|
SynchronizedCluster(Cluster<T> cluster)
Creates a synchronized accessor to
cluster. |
| Modifier and Type | Method and Description |
|---|---|
void |
addVector(T vector,
int id)
|
T |
centroid()
Returns an immutable view of the centroid for this
Cluster. |
double |
compareWithVector(T vector)
Returns the similarity between this
Cluster and vector. |
BitSet |
dataPointIds()
Returns the set of identifiers for all data points assigned to this
cluster.
|
List<T> |
dataPointValues()
Returns the set of stored data points, if any, for this cluster.
|
void |
merge(Cluster<T> other)
|
int |
size()
Returns the total number of points assigned to this
Cluster. |
public void addVector(T vector, int id)
addVector in interface Cluster<T extends DoubleVector>public double compareWithVector(T vector)
Cluster and vector.compareWithVector in interface Cluster<T extends DoubleVector>public T centroid()
Cluster.centroid in interface Cluster<T extends DoubleVector>public List<T> dataPointValues()
dataPointValues in interface Cluster<T extends DoubleVector>public BitSet dataPointIds()
dataPointIds in interface Cluster<T extends DoubleVector>public void merge(Cluster<T> other)
other Cluster with this Cluster.
This Cluster will absorb all data points from other and
update the centroid and data point assignments as needed.merge in interface Cluster<T extends DoubleVector>public int size()
Cluster.size in interface Cluster<T extends DoubleVector>Copyright © 2012. All Rights Reserved.