Package smile.math.distance
Class ChebyshevDistance
java.lang.Object
smile.math.distance.ChebyshevDistance
- All Implemented Interfaces:
Serializable,ToDoubleBiFunction<double[],,double[]> Distance<double[]>,Metric<double[]>
Chebyshev distance (or Tchebychev distance), or L∞ metric
is a metric defined on a vector space where the distance between two vectors
is the greatest of their differences along any coordinate dimension.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubled(double[] x, double[] y) Chebyshev distance between the two arrays of type double.static doubled(float[] x, float[] y) Chebyshev distance between the two arrays of type float.static doubled(int[] x, int[] y) Chebyshev distance between the two arrays of type integer.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface smile.math.distance.Distance
apply, applyAsDouble, D, D
-
Constructor Details
-
ChebyshevDistance
public ChebyshevDistance()Constructor.
-
-
Method Details
-
toString
-
d
public static double d(int[] x, int[] y) Chebyshev distance between the two arrays of type integer.- Parameters:
x- a vector.y- a vector.- Returns:
- the distance.
-
d
public static double d(float[] x, float[] y) Chebyshev distance between the two arrays of type float. NaN will be treated as missing values and will be excluded from the calculation.- Parameters:
x- a vector.y- a vector.- Returns:
- the distance.
-
d
public double d(double[] x, double[] y) Chebyshev distance between the two arrays of type double. NaN will be treated as missing values and will be excluded from the calculation.
-