public class LongTupleDistanceFunctions extends Object
DistanceFunctions for LongTuples| Modifier and Type | Method and Description |
|---|---|
static Comparator<LongTuple> |
byDistanceComparator(LongTuple reference,
java.util.function.ToDoubleBiFunction<? super LongTuple,? super LongTuple> distanceFunction)
Returns a new comparator that compares
LongTuple instances
by their distance to the given reference, according to the given
distance function. |
static DistanceFunction<LongTuple> |
chebyshev()
Returns a
DistanceFunction that computes the
Chebyshev distance |
static DistanceFunction<LongTuple> |
euclidean()
Returns a
DistanceFunction that computes the
Euclidean distance |
static DistanceFunction<LongTuple> |
euclideanSquared()
Returns a
DistanceFunction that computes the
squared Euclidean distance |
static DistanceFunction<LongTuple> |
manhattan()
Returns a
DistanceFunction that computes the
Manhattan distance |
static DistanceFunction<LongTuple> |
wrappedChebyshev(LongTuple size)
Returns a
DistanceFunction that computes the
Chebyshev distance of LongTuples when they are interpreted
as points on a sphere with the given size (that is, circumference). |
static DistanceFunction<LongTuple> |
wrappedEuclidean(LongTuple size)
Returns a
DistanceFunction that computes the
Euclidean distance of LongTuples when they are interpreted
as points on a sphere with the given size (that is, circumference). |
static DistanceFunction<LongTuple> |
wrappedEuclideanSquared(LongTuple size)
Returns a
DistanceFunction that computes the squared
Euclidean distance of LongTuples when they are interpreted
as points on a sphere with the given size (that is, circumference). |
static DistanceFunction<LongTuple> |
wrappedManhattan(LongTuple size)
Returns a
DistanceFunction that computes the
Manhattan distance of LongTuples when they are interpreted
as points on a sphere with the given size (that is, circumference). |
public static Comparator<LongTuple> byDistanceComparator(LongTuple reference, java.util.function.ToDoubleBiFunction<? super LongTuple,? super LongTuple> distanceFunction)
LongTuple 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<LongTuple> euclidean()
DistanceFunction that computes the
Euclidean distanceDistanceFunctionpublic static DistanceFunction<LongTuple> euclideanSquared()
DistanceFunction that computes the
squared Euclidean distanceDistanceFunctionpublic static DistanceFunction<LongTuple> wrappedEuclidean(LongTuple size)
DistanceFunction that computes the
Euclidean distance of LongTuples when they are interpreted
as points on a sphere with the given size (that is, circumference).size - The size of the sphereDistanceFunctionpublic static DistanceFunction<LongTuple> wrappedEuclideanSquared(LongTuple size)
DistanceFunction that computes the squared
Euclidean distance of LongTuples when they are interpreted
as points on a sphere with the given size (that is, circumference).size - The size of the sphereDistanceFunctionpublic static DistanceFunction<LongTuple> manhattan()
DistanceFunction that computes the
Manhattan distanceDistanceFunctionpublic static DistanceFunction<LongTuple> wrappedManhattan(LongTuple size)
DistanceFunction that computes the
Manhattan distance of LongTuples when they are interpreted
as points on a sphere with the given size (that is, circumference).size - The size of the sphereDistanceFunctionpublic static DistanceFunction<LongTuple> chebyshev()
DistanceFunction that computes the
Chebyshev distanceDistanceFunctionpublic static DistanceFunction<LongTuple> wrappedChebyshev(LongTuple size)
DistanceFunction that computes the
Chebyshev distance of LongTuples 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.