Package org.tinspin.index
Interface PointDistance
-
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface PointDistance
-
-
Field Summary
Fields Modifier and Type Field Description static PointDistanceL1L1/Manhattan/taxi distance.static PointDistanceL2L2/Euclidean distance.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description doubledist(double[] p1, double[] p2)default doubledist(double[] p1, Index.PointEntry<?> entry)static StringgetName(PointDistance fn)static doublel1(double[] p1, double[] p2)Manhattan/Taxi distance / L1.static doublel2(double[] p1, double[] p2)Euclidean distance / L2.
-
-
-
Field Detail
-
L1
static final PointDistance L1
L1/Manhattan/taxi distance.
-
L2
static final PointDistance L2
L2/Euclidean distance.
-
-
Method Detail
-
dist
double dist(double[] p1, double[] p2)
-
dist
default double dist(double[] p1, Index.PointEntry<?> entry)- Parameters:
p1- a pointentry- another point- Returns:
- distance between the points
-
l1
static double l1(double[] p1, double[] p2)Manhattan/Taxi distance / L1.- Parameters:
p1- point 1p2- point 2- Returns:
- distance
-
l2
static double l2(double[] p1, double[] p2)Euclidean distance / L2.- Parameters:
p1- point 1p2- point 2- Returns:
- distance
-
getName
static String getName(PointDistance fn)
-
-