Class ChebyshevDistance

java.lang.Object
smile.math.distance.ChebyshevDistance
All Implemented Interfaces:
Serializable, ToDoubleBiFunction<double[],double[]>, Distance<double[]>, Metric<double[]>

public class ChebyshevDistance extends Object implements 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
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    d(double[] x, double[] y)
    Chebyshev distance between the two arrays of type double.
    static double
    d(float[] x, float[] y)
    Chebyshev distance between the two arrays of type float.
    static double
    d(int[] x, int[] y)
    Chebyshev distance between the two arrays of type integer.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface smile.math.distance.Distance

    apply, applyAsDouble, D, D
  • Constructor Details

    • ChebyshevDistance

      public ChebyshevDistance()
      Constructor.
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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.
      Specified by:
      d in interface Distance<double[]>
      Parameters:
      x - a vector.
      y - a vector.
      Returns:
      the distance.