Class L2SquaredDistance<T>

java.lang.Object
com.oracle.coherence.ai.distance.AbstractDistance<T>
com.oracle.coherence.ai.distance.L2SquaredDistance<T>
All Implemented Interfaces:
DistanceAlgorithm<T>, ExternalizableLite, PortableObject, Serializable

public class L2SquaredDistance<T> extends AbstractDistance<T>
A DistanceAlgorithm that performs an L2 squared distance calculation between two vectors.
See Also:
  • Constructor Details

    • L2SquaredDistance

      public L2SquaredDistance()
  • Method Details

    • distance

      protected double distance(BitSet v1, BitSet v2)
      Description copied from class: AbstractDistance
      Calculate the distance between two bit vectors.
      Specified by:
      distance in class AbstractDistance<T>
      Parameters:
      v1 - the first bit vector
      v2 - the second bit vector
      Returns:
      the distance between the two bit vectors
    • distance

      protected double distance(byte[] v1, byte[] v2)
      Description copied from class: AbstractDistance
      Calculate the distance between two Int8 (byte) vectors.
      Specified by:
      distance in class AbstractDistance<T>
      Parameters:
      v1 - the first Int8 vector
      v2 - the second Int8 vector
      Returns:
      the distance between the two Int8 vectors
    • distance

      protected double distance(float[] v1, float[] v2)
      Description copied from class: AbstractDistance
      Calculate the distance between two Float32 (float) vectors.
      Specified by:
      distance in class AbstractDistance<T>
      Parameters:
      v1 - the first Float32 vector
      v2 - the second Float32 vector
      Returns:
      the distance between the two Float32 vectors