Class DistanceFunctionFactory
java.lang.Object
kieker.analysis.generic.clustering.mtree.DistanceFunctionFactory
Some pre-defined implementations of distance
functions.
- Since:
- 2.0.0
- Author:
- Eduardo R. D'Avila
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAn interface to represent coordinates in Euclidean spaces. -
Field Summary
FieldsModifier and TypeFieldDescriptionA distance function object that calculates the distance between two euclidean coordinates.static final IDistanceFunction<List<Double>>A distance function object that calculates the distance between two coordinates represented by lists ofDoubles.static final IDistanceFunction<List<Integer>>A distance function object that calculates the distance between two coordinates represented by lists ofIntegers. -
Method Summary
Modifier and TypeMethodDescriptionstatic <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
-