|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjminhep.cluster.DataPoint
public class DataPoint
Represents an abstraction for a data point in many-dimensional space
| Constructor Summary | |
|---|---|
DataPoint(double[] xx)
Creates a new instance of a data point |
|
DataPoint(double[] xx,
int dim)
Creates a new instance of a data point |
|
| Method Summary | |
|---|---|
void |
assignToCluster(int _clusterNumber)
Assigns the data point to a cluster |
static double |
distance(DataPoint dp1,
DataPoint dp2)
Returns the distance between two data points |
static double |
distanceSqrt(DataPoint dp1,
DataPoint dp2)
Returns the squared distance between two data points |
double |
getAttribute(int index)
Returns the attribute of data point |
int |
getClusterNumber()
Returns the cluster to which the data point belongs |
int |
getDimension()
Get dimension of the point |
static void |
main(String[] args)
Main method -- to test the DataPoint class |
void |
showAttributes()
Print all attributes of a data point |
String |
toString()
Returns a string representation of this DataPoint |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DataPoint(double[] xx,
int dim)
xx - array of dimension dimdim - dimensionpublic DataPoint(double[] xx)
xx - array| Method Detail |
|---|
public int getDimension()
public void assignToCluster(int _clusterNumber)
_clusterNumber - the cluster to which this data point is to be assignedpublic int getClusterNumber()
public double getAttribute(int index)
index - current idex
public void showAttributes()
public static double distance(DataPoint dp1,
DataPoint dp2)
dp1 - the first data pointdp2 - the second data point
public static double distanceSqrt(DataPoint dp1,
DataPoint dp2)
dp1 - the first data pointdp2 - the second data point
public String toString()
toString in class Objectpublic static void main(String[] args)
args - command line arguments
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||