Package com.oracle.coherence.ai.distance
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
A
DistanceAlgorithm that performs an L2 squared distance calculation between two vectors.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected doubledistance(byte[] v1, byte[] v2) Calculate the distance between two Int8 (byte) vectors.protected doubledistance(float[] v1, float[] v2) Calculate the distance between two Float32 (float) vectors.protected doubleCalculate the distance between two bit vectors.Methods inherited from class com.oracle.coherence.ai.distance.AbstractDistance
distance, readExternal, readExternal, writeExternal, writeExternal
-
Constructor Details
-
L2SquaredDistance
public L2SquaredDistance()
-
-
Method Details
-
distance
Description copied from class:AbstractDistanceCalculate the distance between two bit vectors.- Specified by:
distancein classAbstractDistance<T>- Parameters:
v1- the first bit vectorv2- the second bit vector- Returns:
- the distance between the two bit vectors
-
distance
protected double distance(byte[] v1, byte[] v2) Description copied from class:AbstractDistanceCalculate the distance between two Int8 (byte) vectors.- Specified by:
distancein classAbstractDistance<T>- Parameters:
v1- the first Int8 vectorv2- the second Int8 vector- Returns:
- the distance between the two Int8 vectors
-
distance
protected double distance(float[] v1, float[] v2) Description copied from class:AbstractDistanceCalculate the distance between two Float32 (float) vectors.- Specified by:
distancein classAbstractDistance<T>- Parameters:
v1- the first Float32 vectorv2- the second Float32 vector- Returns:
- the distance between the two Float32 vectors
-