jklustor-all-api-0.0.7-20140619012755 (ChemAxon)


com.chemaxon.descriptors.metrics
Class FloatVectorComparator.Util

Object
  extended by com.chemaxon.descriptors.metrics.FloatVectorComparator.Util
Enclosing interface:
FloatVectorComparator

public static final class FloatVectorComparator.Util
extends Object

Various utility methods related to float vector comparation.


Method Summary
(package private) static void checkVectors(float[] v1, float[] v2)
          Ensure that compared vectors are not null, empty and matches.
(package private) static double sqrDist(float[] v1, float[] v2)
          Calculates squared Euclidean distance.
(package private) static double vLength(float[] v)
          Calculates length (magnitude) of vector.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

vLength

static double vLength(float[] v)
Calculates length (magnitude) of vector.

Parameters:
v - float vector
Returns:
length

checkVectors

static void checkVectors(float[] v1,
                         float[] v2)
Ensure that compared vectors are not null, empty and matches.

Parameters:
v1 - Target vector
v2 - Query vector
Throws:
IllegalArgumentException - when vector lengths mismatch

sqrDist

static double sqrDist(float[] v1,
                      float[] v2)
Calculates squared Euclidean distance.

Parameters:
v1 - float vector
v2 - float vector
Returns:
squared distance

jklustor-all-api-0.0.7-20140619012755 (ChemAxon)