de.lmu.ifi.dbs.elki.distance.distancefunction
Class ArcCosineDistanceFunction

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>
      extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractVectorDoubleDistanceFunction
          extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractCosineDistanceFunction
              extended by de.lmu.ifi.dbs.elki.distance.distancefunction.ArcCosineDistanceFunction
All Implemented Interfaces:
DistanceFunction<NumberVector<?,?>,DoubleDistance>, PrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>, PrimitiveDoubleDistanceFunction<NumberVector<?,?>>, InspectionUtilFrequentlyScanned, Parameterizable

public class ArcCosineDistanceFunction
extends AbstractCosineDistanceFunction

Cosine distance function for feature vectors. The cosine distance is computed as the arcus from the cosine similarity value, i.e., arccos(<v1,v2>).


Nested Class Summary
static class ArcCosineDistanceFunction.Parameterizer
          Parameterization class.
 
Field Summary
static ArcCosineDistanceFunction STATIC
          Static instance
 
Constructor Summary
ArcCosineDistanceFunction()
          Deprecated. Use static instance!
 
Method Summary
 double doubleDistance(NumberVector<?,?> v1, NumberVector<?,?> v2)
          Computes the cosine distance for two given feature vectors.
 boolean equals(Object obj)
           
 String toString()
           
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractCosineDistanceFunction
angle, angleSparse, instantiate
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractVectorDoubleDistanceFunction
distance, getDistanceFactory, getInputTypeRestriction
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractPrimitiveDistanceFunction
isMetric, isSymmetric
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.distancefunction.DistanceFunction
isMetric, isSymmetric
 

Field Detail

STATIC

public static final ArcCosineDistanceFunction STATIC
Static instance

Constructor Detail

ArcCosineDistanceFunction

@Deprecated
public ArcCosineDistanceFunction()
Deprecated. Use static instance!

Provides a CosineDistanceFunction.

Method Detail

doubleDistance

public double doubleDistance(NumberVector<?,?> v1,
                             NumberVector<?,?> v2)
Computes the cosine distance for two given feature vectors. The cosine distance is computed as the arcus from the cosine similarity value, i.e., arccos(<v1,v2>).

Parameters:
v1 - first feature vector
v2 - second feature vector
Returns:
the cosine distance for two given feature vectors v1 and v2

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

Release 0.4.0 (2011-09-20_1324)