Documentation of 'Catalano.Math.Distances.MinkowskiDistance' Java class
MinkowskiDistance
Catalano.Math.Distances

Class MinkowskiDistance

  • All Implemented Interfaces:
    IDistance<double[]>, IDivergence<double[]>, java.io.Serializable


    public class MinkowskiDistance
    extends java.lang.Object
    implements IDistance<double[]>
    Minkowski distance. The Minkowski distance is a metric in a normed vector space which can be considered as a generalization of both the Euclidean distance and the Manhattan distance.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      MinkowskiDistance()
      Initializes a new instance of the MinkowskiDistance class.
      MinkowskiDistance(double p)
      Initializes a new instance of the MinkowskiDistance class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      double Compute(double[] u, double[] v)
      Compute the distance between the vectors.
      double getOrder()
      Get the order of the distance.
      void setOrder(double p)
      Set the order of the distance.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MinkowskiDistance

        public MinkowskiDistance()
        Initializes a new instance of the MinkowskiDistance class. p = 1 (default).
      • MinkowskiDistance

        public MinkowskiDistance(double p)
        Initializes a new instance of the MinkowskiDistance class.
        Parameters:
        p - Order.
    • Method Detail

      • getOrder

        public double getOrder()
        Get the order of the distance.
        Returns:
        Order.
      • setOrder

        public void setOrder(double p)
        Set the order of the distance.
        Parameters:
        p - Order.
      • Compute

        public double Compute(double[] u,
                              double[] v)
        Description copied from interface: IDivergence
        Compute the distance between the vectors.
        Specified by:
        Compute in interface IDistance<double[]>
        Specified by:
        Compute in interface IDivergence<double[]>
        Parameters:
        u - Vector.
        v - Vector.
        Returns:
        Distance.

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.