Class LPNormDistance

    • Field Detail

      • p

        protected double p
        p parameter and its inverse.
      • invp

        protected double invp
        p parameter and its inverse.
    • Constructor Detail

      • LPNormDistance

        public LPNormDistance​(double p)
        Constructor, internal version.
        Parameters:
        p - Parameter p
    • Method Detail

      • preDistance

        private double preDistance​(NumberVector v1,
                                   NumberVector v2,
                                   int start,
                                   int end)
        Compute unscaled distance in a range of dimensions.
        Parameters:
        v1 - First object
        v2 - Second object
        start - First dimension
        end - Exclusive last dimension
        Returns:
        Aggregated values.
      • preDistanceVM

        private double preDistanceVM​(NumberVector v,
                                     SpatialComparable mbr,
                                     int start,
                                     int end)
        Compute unscaled distance in a range of dimensions.
        Parameters:
        v - First vector
        mbr - Second MBR
        start - First dimension
        end - Exclusive last dimension
        Returns:
        Aggregated values.
      • preDistanceMBR

        private double preDistanceMBR​(SpatialComparable mbr1,
                                      SpatialComparable mbr2,
                                      int start,
                                      int end)
        Compute unscaled distance in a range of dimensions.
        Parameters:
        mbr1 - First MBR
        mbr2 - Second MBR
        start - First dimension
        end - Exclusive last dimension
        Returns:
        Aggregated values.
      • preNorm

        private double preNorm​(NumberVector v,
                               int start,
                               int end)
        Compute unscaled norm in a range of dimensions.
        Parameters:
        v - Data object
        start - First dimension
        end - Exclusive last dimension
        Returns:
        Aggregated values.
      • preNormMBR

        private double preNormMBR​(SpatialComparable mbr,
                                  int start,
                                  int end)
        Compute unscaled norm in a range of dimensions.
        Parameters:
        mbr - Data object
        start - First dimension
        end - Exclusive last dimension
        Returns:
        Aggregated values.
      • norm

        public double norm​(NumberVector v)
        Description copied from interface: Norm
        Compute the norm of object obj.
        Specified by:
        norm in interface Norm<NumberVector>
        Parameters:
        v - Object
        Returns:
        Norm
      • isMetric

        public boolean isMetric()
        Description copied from interface: Distance
        Is this distance function metric (satisfy the triangle inequality)
        Specified by:
        isMetric in interface Distance<NumberVector>
        Returns:
        true when metric.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getP

        public double getP()
        Get the functions p parameter.
        Returns:
        p
      • getInvP

        public double getInvP()
        Get the functions 1/p parameter.
        Returns:
        1/p
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object