|
Sautrela | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.gtts.sautrela.vq.Cluster
public class Cluster
A cluster that contains a Collection of multidimensional data. The centroid of the cluster is not changed when data is added or removed. It can be only set in the constructor or updated to the less distorsion point. The distorsion is a dinamic magnitude that depends on the current centroid and all the data contained in the Cluster.
| Constructor Summary | |
|---|---|
Cluster()
Creates a new empty Cluster. |
|
Cluster(double[] centroid)
Creates a new Cluster with a desired centroid. |
|
| Method Summary | |
|---|---|
void |
addData(java.util.Collection<double[]> c)
Adds a Collection of data to this Cluster. |
void |
addData(double[] v)
Adds new data to this Cluster. |
void |
addData(double[] v,
double sqrDist)
Adds new data to this Cluster using a previously obtained square distance. |
double[] |
createSymmetrical(double[] d)
Creates a new symmetrical data respect to the current centroid. |
double[] |
getCentroid()
Returns the current centroid of this Cluster. |
java.util.Collection<double[]> |
getData()
Gets all the data contained in this Cluster. |
double |
getDistance(double[] v)
Computes the Euclidean distance between the current centroid and the given data. |
double |
getDistorsion()
Returns the current distorsion of this Cluster. |
double[] |
getRandomData()
Gets randomly a data out of all data contained in this Cluster. |
double |
getSquareDistance(double[] v)
Computes the square of the Euclidean distance between the current centroid and the given data. |
void |
removeData()
Clears all data contained in this Cluster. |
int |
size()
Returns the amount of data in this Cluster. |
void |
update()
Updates the current centroid in order to get the minimun distorsion. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Cluster()
public Cluster(double[] centroid)
centroid - the initial centroid.| Method Detail |
|---|
public int size()
public double getSquareDistance(double[] v)
v - the data
public double getDistance(double[] v)
v - the data
public void addData(double[] v)
v - data to be added
public void addData(double[] v,
double sqrDist)
v - data to be addedsqrDist - square distance to the centroidpublic void addData(java.util.Collection<double[]> c)
c - data elements to be added.public java.util.Collection<double[]> getData()
public double[] getRandomData()
public void removeData()
public double[] getCentroid()
public double[] createSymmetrical(double[] d)
d - the source data.
public double getDistorsion()
public void update()
|
Sautrela | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||