Class ChebyshevDistance

java.lang.Object
org.apache.commons.math3.ml.distance.ChebyshevDistance
All Implemented Interfaces:
Serializable, DistanceMeasure

public class ChebyshevDistance extends Object implements DistanceMeasure
Calculates the L (max of abs) distance between two points.
Since:
3.2
See Also:
  • Constructor Details

    • ChebyshevDistance

      public ChebyshevDistance()
  • Method Details

    • compute

      public double compute(double[] a, double[] b) throws DimensionMismatchException
      Compute the distance between two n-dimensional vectors.

      The two vectors are required to have the same dimension.

      Specified by:
      compute in interface DistanceMeasure
      Parameters:
      a - the first vector
      b - the second vector
      Returns:
      the distance between the two vectors
      Throws:
      DimensionMismatchException - if the array lengths differ.