com.sun.labs.minion.clustering
Class ClusterUtil
java.lang.Object
com.sun.labs.minion.clustering.ClusterUtil
public class ClusterUtil
- extends java.lang.Object
A set of utility methods for clustering operations.
Method Summary |
static double[] |
add(double[] p1,
double[] p2)
Adds p2 to p1, returning p1. |
static double[] |
div(double[] p,
double d)
|
static boolean |
equal(double[] p1,
double[] p2)
|
static double |
euclideanDistance(double[] p1,
double[] p2)
Computes the Euclidean distance between two points. |
protected void |
finalize()
|
static double[] |
normalize(double[] p)
|
static double[] |
normalizedRandomPoint(int d)
|
static double[] |
randomPoint(int d)
|
static java.lang.String |
toString(double[] p)
|
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClusterUtil
public ClusterUtil()
add
public static double[] add(double[] p1,
double[] p2)
- Adds p2 to p1, returning p1.
div
public static double[] div(double[] p,
double d)
randomPoint
public static double[] randomPoint(int d)
normalizedRandomPoint
public static double[] normalizedRandomPoint(int d)
normalize
public static double[] normalize(double[] p)
euclideanDistance
public static double euclideanDistance(double[] p1,
double[] p2)
- Computes the Euclidean distance between two points.
toString
public static java.lang.String toString(double[] p)
equal
public static boolean equal(double[] p1,
double[] p2)
finalize
protected void finalize()
throws java.lang.Throwable
- Overrides:
finalize
in class java.lang.Object
- Throws:
java.lang.Throwable