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 interface
DistanceFunctionFactory.IEuclideanCoordinate
An interface to represent coordinates in Euclidean spaces. -
Field Summary
Fields Modifier and Type Field Description static IDistanceFunction<DistanceFunctionFactory.IEuclideanCoordinate>
EUCLIDEAN
A distance function object that calculates the distance between two euclidean coordinates.static IDistanceFunction<java.util.List<java.lang.Double>>
EUCLIDEAN_DOUBLE_LIST
A distance function object that calculates the distance between two coordinates represented by lists ofDouble
s.static IDistanceFunction<java.util.List<java.lang.Integer>>
EUCLIDEAN_INTEGER_LIST
A distance function object that calculates the distance between two coordinates represented by lists ofInteger
s. -
Method Summary
Modifier and Type Method Description static <D> IDistanceFunction<D>
cached(IDistanceFunction<D> distanceFunction)
Creates a cached version of a distance function.static double
euclidean(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 ofInteger
s. -
EUCLIDEAN_DOUBLE_LIST
A distance function object that calculates the distance between two coordinates represented by lists ofDouble
s.
-
-
Method Details
-
cached
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.- 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
-