org.apache.ignite.ml.math.distances

## Interface DistanceMeasure

- All Superinterfaces:
    Externalizable, Serializable
  All Known Implementing Classes:
    BrayCurtisDistance, CanberraDistance, ChebyshevDistance, CosineSimilarity, EuclideanDistance, HammingDistance, JaccardIndex, JensenShannonDistance, ManhattanDistance, MinkowskiDistance, WeightedMinkowskiDistance

      public interface DistanceMeasure
      extends Externalizable

  This class is based on the corresponding class from Apache Common Math lib. Interface for distance measures of n-dimensional vectors.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default double` | `compute(Vector a, double[] b)` Compute the distance between n-dimensional vector and n-dimensional array.
    `double` | `compute(Vector a, Vector b)` Compute the distance between two n-dimensional vectors.
    `default void` | `readExternal(ObjectInput in)`
    `default void` | `writeExternal(ObjectOutput out)`

- - ### Method Detail

    - #### compute

          double compute(Vector a,
                         Vector b)
                  throws CardinalityException

      Compute the distance between two n-dimensional vectors.

      The two vectors are required to have the same dimension.

      Parameters:
        `a` - The first vector.
        `b` - The second vector.
      Returns:
        The distance between the two vectors.
      Throws:
        `CardinalityException` - if the array lengths differ.

    - #### compute

          default double compute(Vector a,
                                 double[] b)
                          throws CardinalityException

      Compute the distance between n-dimensional vector and n-dimensional array.

      The two data structures are required to have the same dimension.

      Parameters:
        `a` - The vector.
        `b` - The array.
      Returns:
        The distance between vector and array.
      Throws:
        `CardinalityException` - if the data structures lengths differ.

    - #### writeExternal

          default void writeExternal(ObjectOutput out)
                              throws IOException

      Specified by:
        `writeExternal` in interface `Externalizable`
      Throws:
        `IOException`

    - #### readExternal

          default void readExternal(ObjectInput in)
                             throws IOException,
                                    ClassNotFoundException

      Specified by:
        `readExternal` in interface `Externalizable`
      Throws:
        `IOException`
        `ClassNotFoundException`

2022 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.12.0
Release Date | : January 10 2022