Class DistanceFunctionFactory
java.lang.Object
kieker.analysis.generic.clustering.mtree.DistanceFunctionFactory
public final class DistanceFunctionFactory
extends java.lang.Object
Some pre-defined implementations of distance
functions.
- Since:
- 2.0.0
- Author:
- Eduardo R. D'Avila
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceDistanceFunctionFactory.IEuclideanCoordinateAn interface to represent coordinates in Euclidean spaces. -
Field Summary
Fields Modifier and Type Field Description static IDistanceFunction<DistanceFunctionFactory.IEuclideanCoordinate>EUCLIDEANA distance function object that calculates the distance between two euclidean coordinates.static IDistanceFunction<java.util.List<java.lang.Double>>EUCLIDEAN_DOUBLE_LISTA distance function object that calculates the distance between two coordinates represented by lists ofDoubles.static IDistanceFunction<java.util.List<java.lang.Integer>>EUCLIDEAN_INTEGER_LISTA distance function object that calculates the distance between two coordinates represented by lists ofIntegers. -
Method Summary
Modifier and Type Method Description static <D> IDistanceFunction<D>cached(IDistanceFunction<D> distanceFunction)Creates a cached version of a distance function.static doubleeuclidean(DistanceFunctionFactory.IEuclideanCoordinate coord1, DistanceFunctionFactory.IEuclideanCoordinate coord2)Calculates the distance between two euclidean coordinates.
-
Field Details
-
EUCLIDEAN
A distance function object that calculates the distance between two euclidean coordinates. -
EUCLIDEAN_INTEGER_LIST
A distance function object that calculates the distance between two coordinates represented by lists ofIntegers. -
EUCLIDEAN_DOUBLE_LIST
A distance function object that calculates the distance between two coordinates represented by lists ofDoubles.
-
-
Method Details
-
cached
Creates a cached version of a distance function. This method is used internally byMTreeto create a cached distance function to pass to the split function.- Type Parameters:
D- distance function type- Parameters:
distanceFunction- The distance function to create a cached version of.- Returns:
- The cached distance function.
-
euclidean
public static double euclidean(DistanceFunctionFactory.IEuclideanCoordinate coord1, DistanceFunctionFactory.IEuclideanCoordinate coord2)Calculates the distance between two euclidean coordinates.- Parameters:
coord1- first coordinatecoord2- second coordinate- Returns:
- returns the distance value
-