Class Minkowski

  • All Implemented Interfaces:

    public class Minkowski
    extends java.lang.Object
    implements Metric
    • Constructor Detail

      • Minkowski

        public Minkowski​(double q)
        Constructor for Minkowski metric.
        q - Power of component wise absolute difference; must be at least 1
    • Method Detail

      • getMetric

        public static Metric getMetric​(double q)
      • distance

        public double distance​(SparseVector a,
                               SparseVector b)
        Gives the Minkowski distance between two vectors. distance(x,y) := \left( \Sum_i=0^d-1 \left| x_i - y_i \right|^q \right)^\frac{1}{q}
        Specified by:
        distance in interface Metric