Package elki.distance

Class AbstractNumberVectorDistance

    • Constructor Detail

      • AbstractNumberVectorDistance

        public AbstractNumberVectorDistance()
        Constructor.
    • Method Detail

      • dimensionality

        public static final int dimensionality​(SpatialComparable o1,
                                               SpatialComparable o2)
        Get the common dimensionality of the two objects. Throw an IllegalArgumentException otherwise.
        Parameters:
        o1 - First vector / MBR
        o2 - Second vector / MBR
        Returns:
        Common dimensionality
        Throws:
        java.lang.IllegalArgumentException - when dimensionalities are not the same.
      • dimensionality

        public static final int dimensionality​(double[] o1,
                                               SpatialComparable o2)
        Get the common dimensionality of the two objects. Throw an IllegalArgumentException otherwise.
        Parameters:
        o1 - First vector / MBR
        o2 - Second vector / MBR
        Returns:
        Common dimensionality
        Throws:
        java.lang.IllegalArgumentException - when dimensionalities are not the same.
      • dimensionality

        public static final int dimensionality​(double[] o1,
                                               double[] o2)
        Get the common dimensionality of the two objects. Throw an IllegalArgumentException otherwise.
        Parameters:
        o1 - First vector / MBR
        o2 - Second vector / MBR
        Returns:
        Common dimensionality
        Throws:
        java.lang.IllegalArgumentException - when dimensionalities are not the same.
      • dimensionality

        public static final int dimensionality​(SpatialComparable o1,
                                               SpatialComparable o2,
                                               int expect)
        Get the common dimensionality of the two objects. Throw an IllegalArgumentException otherwise.
        Parameters:
        o1 - First vector / MBR
        o2 - Second vector / MBR
        expect - Expected dimensionality
        Returns:
        Common dimensionality
        Throws:
        java.lang.IllegalArgumentException - when dimensionalities are not the same.
      • dimensionality

        public static final int dimensionality​(double[] o1,
                                               SpatialComparable o2,
                                               int expect)
        Get the common dimensionality of the two objects. Throw an IllegalArgumentException otherwise.
        Parameters:
        o1 - First vector / MBR
        o2 - Second vector / MBR
        expect - Expected dimensionality
        Returns:
        Common dimensionality
        Throws:
        java.lang.IllegalArgumentException - when dimensionalities are not the same.
      • dimensionality

        public static final int dimensionality​(double[] o1,
                                               double[] o2,
                                               int expect)
        Get the common dimensionality of the two objects. Throw an IllegalArgumentException otherwise.
        Parameters:
        o1 - First vector / MBR
        o2 - Second vector / MBR
        expect - Expected dimensionality
        Returns:
        Common dimensionality
        Throws:
        java.lang.IllegalArgumentException - when dimensionalities are not the same.
      • dimensionality

        public static final int dimensionality​(NumberVector o1,
                                               NumberVector o2)
        Get the common dimensionality of the two objects. Throw an IllegalArgumentException otherwise.
        Parameters:
        o1 - First vector / MBR
        o2 - Second vector / MBR
        Returns:
        Common dimensionality
        Throws:
        java.lang.IllegalArgumentException - when dimensionalities are not the same.
      • dimensionality

        public static final int dimensionality​(NumberVector o1,
                                               NumberVector o2,
                                               int expect)
        Get the common dimensionality of the two objects. Throw an IllegalArgumentException otherwise.
        Parameters:
        o1 - First vector / MBR
        o2 - Second vector / MBR
        expect - Expected dimensionality
        Returns:
        Common dimensionality
        Throws:
        java.lang.IllegalArgumentException - when dimensionalities are not the same.