Class WeightedSquaredEuclideanDistance

    • Field Detail

      • weights

        protected double[] weights
        Weight array
    • Constructor Detail

      • WeightedSquaredEuclideanDistance

        public WeightedSquaredEuclideanDistance​(double[] weights)
        Constructor.
        Parameters:
        weights - Weight vector
    • Method Detail

      • norm

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

        public boolean isSquared()
        Description copied from interface: Distance
        Squared distances, that would become metric after square root.

        E.g. squared Euclidean.

        Specified by:
        isSquared in interface Distance<NumberVector>
        Returns:
        true when squared.
      • 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