Class DistanceFunctions
- java.lang.Object
-
- moa.clusterers.outliers.utils.mtree.DistanceFunctions
-
public final class DistanceFunctions extends Object
Some pre-defined implementations of distance functions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
DistanceFunctions.EuclideanCoordinate
An interface to represent coordinates in Euclidean spaces.
-
Field Summary
Fields Modifier and Type Field Description static DistanceFunction<DistanceFunctions.EuclideanCoordinate>
EUCLIDEAN
A distance function object that calculates the distance between two euclidean coordinates.static DistanceFunction<List<Double>>
EUCLIDEAN_DOUBLE_LIST
A distance function object that calculates the distance between two coordinates represented by lists ofDouble
s.static DistanceFunction<List<Integer>>
EUCLIDEAN_INTEGER_LIST
A distance function object that calculates the distance between two coordinates represented by lists ofInteger
s.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <Data> DistanceFunction<Data>
cached(DistanceFunction<Data> distanceFunction)
Creates a cached version of a distance function.static double
euclidean(DistanceFunctions.EuclideanCoordinate coord1, DistanceFunctions.EuclideanCoordinate coord2)
Calculates the distance between two euclidean coordinates.
-
-
-
Field Detail
-
EUCLIDEAN
public static final DistanceFunction<DistanceFunctions.EuclideanCoordinate> EUCLIDEAN
A distance function object that calculates the distance between two euclidean coordinates.
-
EUCLIDEAN_INTEGER_LIST
public static final DistanceFunction<List<Integer>> EUCLIDEAN_INTEGER_LIST
A distance function object that calculates the distance between two coordinates represented by lists ofInteger
s.
-
EUCLIDEAN_DOUBLE_LIST
public static final DistanceFunction<List<Double>> EUCLIDEAN_DOUBLE_LIST
A distance function object that calculates the distance between two coordinates represented by lists ofDouble
s.
-
-
Method Detail
-
cached
public static <Data> DistanceFunction<Data> cached(DistanceFunction<Data> distanceFunction)
Creates a cached version of a distance function. This method is used internally byMTree
to create a cached distance function to pass to the split function.- Parameters:
distanceFunction
- The distance function to create a cached version of.- Returns:
- The cached distance function.
-
euclidean
public static double euclidean(DistanceFunctions.EuclideanCoordinate coord1, DistanceFunctions.EuclideanCoordinate coord2)
Calculates the distance between two euclidean coordinates.
-
-