de.lmu.ifi.dbs.elki.distance.distancefunction
Class AbstractPrimitiveDistanceFunction<O,D extends Distance<D>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractPrimitiveDistanceFunction<O,D>
Type Parameters:
O - the type of objects to compute the distances in between
D - the type of Distance used
All Implemented Interfaces:
DistanceFunction<O,D>, PrimitiveDistanceFunction<O,D>, InspectionUtilFrequentlyScanned, Parameterizable
Direct Known Subclasses:
AbstractDimensionsSelectingDoubleDistanceFunction, AbstractVectorDoubleDistanceFunction, DimensionSelectingDistanceFunction, FooKernelFunction, PolynomialKernelFunction

public abstract class AbstractPrimitiveDistanceFunction<O,D extends Distance<D>>
extends Object
implements PrimitiveDistanceFunction<O,D>

AbstractDistanceFunction provides some methods valid for any extending class.


Constructor Summary
AbstractPrimitiveDistanceFunction()
          Provides an abstract DistanceFunction.
 
Method Summary
abstract  D distance(O o1, O o2)
          Computes the distance between two given DatabaseObjects according to this distance function.
abstract  D getDistanceFactory()
          Method to get the distance functions factory.
<T extends O>
DistanceQuery<T,D>
instantiate(Relation<T> relation)
          Instantiate with a database to get the actual distance query.
 boolean isMetric()
          Is this distance function metric (in particular, does it satisfy the triangle equation?)
 boolean isSymmetric()
          Is this function symmetric?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.distancefunction.PrimitiveDistanceFunction
getInputTypeRestriction
 

Constructor Detail

AbstractPrimitiveDistanceFunction

public AbstractPrimitiveDistanceFunction()
Provides an abstract DistanceFunction.

Method Detail

distance

public abstract D distance(O o1,
                           O o2)
Description copied from interface: PrimitiveDistanceFunction
Computes the distance between two given DatabaseObjects according to this distance function.

Specified by:
distance in interface PrimitiveDistanceFunction<O,D extends Distance<D>>
Parameters:
o1 - first DatabaseObject
o2 - second DatabaseObject
Returns:
the distance between two given DatabaseObjects according to this distance function

getDistanceFactory

public abstract D getDistanceFactory()
Description copied from interface: DistanceFunction
Method to get the distance functions factory.

Specified by:
getDistanceFactory in interface DistanceFunction<O,D extends Distance<D>>
Returns:
Factory for distance objects

isSymmetric

public boolean isSymmetric()
Description copied from interface: DistanceFunction
Is this function symmetric?

Specified by:
isSymmetric in interface DistanceFunction<O,D extends Distance<D>>
Returns:
true when symmetric

isMetric

public boolean isMetric()
Description copied from interface: DistanceFunction
Is this distance function metric (in particular, does it satisfy the triangle equation?)

Specified by:
isMetric in interface DistanceFunction<O,D extends Distance<D>>
Returns:
true when metric.

instantiate

public <T extends O> DistanceQuery<T,D> instantiate(Relation<T> relation)
Instantiate with a database to get the actual distance query.

Specified by:
instantiate in interface DistanceFunction<O,D extends Distance<D>>
Parameters:
relation - Representation
Returns:
Actual distance query.

Release 0.4.0 (2011-09-20_1324)