edu.stanford.math.plex4.metric.utility
public class MetricUtility extends java.lang.Object
Constructor and Description |
---|
MetricUtility() |
Modifier and Type | Method and Description |
---|---|
static double[] |
computeCentroid(AbstractObjectMetricSpace<double[]> metricSpace)
This function computes the centroid of the set of points within the metric space.
|
static double[] |
computeMaxima(AbstractObjectMetricSpace<double[]> metricSpace)
This function computes the coordinate-wise maxima of a given Euclidean metric space.
|
static double[] |
computeMinima(AbstractObjectMetricSpace<double[]> metricSpace)
This function computes the coordinate-wise minima of a given Euclidean metric space.
|
static double |
estimateDiameter(AbstractIntMetricSpace metricSpace)
This function performs randomized sampling to find the estimated diameter of the given
metric space.
|
static double |
estimateDiameter(AbstractIntMetricSpace metricSpace,
int trials)
This function estimates the diameter of the supplied metric space.
|
static <T> int[] |
filterByNeighborDistance(AbstractSearchableMetricSpace<T> metricSpace,
int k,
double proportion) |
static double[] |
getAllDistances(AbstractIntMetricSpace metricSpace,
int index) |
static <T> double[] |
getKthNearestNeighborDistances(AbstractSearchableMetricSpace<T> metricSpace,
int k) |
public static double estimateDiameter(AbstractIntMetricSpace metricSpace, int trials)
metricSpace
- the metric space to estimate the diameter oftrials
- the number of random pairs to choosepublic static double estimateDiameter(AbstractIntMetricSpace metricSpace)
metricSpace
- the metric space to estimate the diameter ofpublic static double[] computeMaxima(AbstractObjectMetricSpace<double[]> metricSpace)
metricSpace
- the metric space to compute the maxima forpublic static double[] computeMinima(AbstractObjectMetricSpace<double[]> metricSpace)
metricSpace
- the metric space to compute the minima forpublic static double[] computeCentroid(AbstractObjectMetricSpace<double[]> metricSpace)
metricSpace
- the metric space to compute the centroid ofpublic static double[] getAllDistances(AbstractIntMetricSpace metricSpace, int index)
public static <T> double[] getKthNearestNeighborDistances(AbstractSearchableMetricSpace<T> metricSpace, int k)
public static <T> int[] filterByNeighborDistance(AbstractSearchableMetricSpace<T> metricSpace, int k, double proportion)