public class IntTupleDistanceFunctions extends Object
DistanceFunctions for IntTuples| Modifier and Type | Method and Description |
|---|---|
static Comparator<IntTuple> |
byDistanceComparator(IntTuple reference,
java.util.function.ToDoubleBiFunction<? super IntTuple,? super IntTuple> distanceFunction)
Returns a new comparator that compares
IntTuple instances
by their distance to the given reference, according to the given
distance function. |
static DistanceFunction<IntTuple> |
chebyshev()
Returns a
DistanceFunction that computes the
Chebyshev distance |
static DistanceFunction<IntTuple> |
euclidean()
Returns a
DistanceFunction that computes the
Euclidean distance |
static DistanceFunction<IntTuple> |
euclideanSquared()
Returns a
DistanceFunction that computes the
squared Euclidean distance |
static DistanceFunction<IntTuple> |
manhattan()
Returns a
DistanceFunction that computes the
Manhattan distance |
static DistanceFunction<IntTuple> |
wrappedChebyshev(IntTuple size)
Returns a
DistanceFunction that computes the
Chebyshev distance of IntTuples when they are interpreted
as points on a sphere with the given size (that is, circumference). |
static DistanceFunction<IntTuple> |
wrappedEuclidean(IntTuple size)
Returns a
DistanceFunction that computes the
Euclidean distance of IntTuples when they are interpreted
as points on a sphere with the given size (that is, circumference). |
static DistanceFunction<IntTuple> |
wrappedEuclideanSquared(IntTuple size)
Returns a
DistanceFunction that computes the squared
Euclidean distance of IntTuples when they are interpreted
as points on a sphere with the given size (that is, circumference). |
static DistanceFunction<IntTuple> |
wrappedManhattan(IntTuple size)
Returns a
DistanceFunction that computes the
Manhattan distance of IntTuples when they are interpreted
as points on a sphere with the given size (that is, circumference). |
public static Comparator<IntTuple> byDistanceComparator(IntTuple reference, java.util.function.ToDoubleBiFunction<? super IntTuple,? super IntTuple> distanceFunction)
IntTuple instances
by their distance to the given reference, according to the given
distance function.
A copy of the given reference point will be stored, so that changes
in the given point will not affect the returned comparator.reference - The reference pointdistanceFunction - The distance functionpublic static DistanceFunction<IntTuple> euclidean()
DistanceFunction that computes the
Euclidean distanceDistanceFunctionpublic static DistanceFunction<IntTuple> euclideanSquared()
DistanceFunction that computes the
squared Euclidean distanceDistanceFunctionpublic static DistanceFunction<IntTuple> wrappedEuclidean(IntTuple size)
DistanceFunction that computes the
Euclidean distance of IntTuples when they are interpreted
as points on a sphere with the given size (that is, circumference).size - The size of the sphereDistanceFunctionpublic static DistanceFunction<IntTuple> wrappedEuclideanSquared(IntTuple size)
DistanceFunction that computes the squared
Euclidean distance of IntTuples when they are interpreted
as points on a sphere with the given size (that is, circumference).size - The size of the sphereDistanceFunctionpublic static DistanceFunction<IntTuple> manhattan()
DistanceFunction that computes the
Manhattan distanceDistanceFunctionpublic static DistanceFunction<IntTuple> wrappedManhattan(IntTuple size)
DistanceFunction that computes the
Manhattan distance of IntTuples when they are interpreted
as points on a sphere with the given size (that is, circumference).size - The size of the sphereDistanceFunctionpublic static DistanceFunction<IntTuple> chebyshev()
DistanceFunction that computes the
Chebyshev distanceDistanceFunctionpublic static DistanceFunction<IntTuple> wrappedChebyshev(IntTuple size)
DistanceFunction that computes the
Chebyshev distance of IntTuples when they are interpreted
as points on a sphere with the given size (that is, circumference).size - The size of the sphereDistanceFunctionCopyright © 2015. All Rights Reserved.