de.lmu.ifi.dbs.elki.distance.distancefunction
Class AbstractDBIDDistanceFunction<D extends Distance<D>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDBIDDistanceFunction<D>
Type Parameters:
D - the type of Distance used
All Implemented Interfaces:
DBIDDistanceFunction<D>, DistanceFunction<DBID,D>, InspectionUtilFrequentlyScanned, Parameterizable
Direct Known Subclasses:
DiskCacheBasedDoubleDistanceFunction, DiskCacheBasedFloatDistanceFunction, FileBasedDoubleDistanceFunction, FileBasedFloatDistanceFunction, ProxyDistanceFunction, RandomStableDistanceFunction

public abstract class AbstractDBIDDistanceFunction<D extends Distance<D>>
extends Object
implements DBIDDistanceFunction<D>

AbstractDistanceFunction provides some methods valid for any extending class.


Constructor Summary
protected AbstractDBIDDistanceFunction()
          Provides an abstract DistanceFunction.
 
Method Summary
abstract  D distance(DBID o1, DBID o2)
          Returns the distance between the two objects specified by their object ids.
abstract  D getDistanceFactory()
          Method to get the distance functions factory.
 SimpleTypeInformation<DBID> getInputTypeRestriction()
          Get the input data type of the function.
<O extends DBID>
DistanceQuery<O,D>
instantiate(Relation<O> database)
          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
 

Constructor Detail

AbstractDBIDDistanceFunction

protected AbstractDBIDDistanceFunction()
Provides an abstract DistanceFunction.

Method Detail

distance

public abstract D distance(DBID o1,
                           DBID o2)
Description copied from interface: DBIDDistanceFunction
Returns the distance between the two objects specified by their object ids.

Specified by:
distance in interface DBIDDistanceFunction<D extends Distance<D>>
Parameters:
o1 - first object id
o2 - second object id
Returns:
the distance between the two objects specified by their object ids

getDistanceFactory

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

Specified by:
getDistanceFactory in interface DistanceFunction<DBID,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<DBID,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<DBID,D extends Distance<D>>
Returns:
true when metric.

getInputTypeRestriction

public SimpleTypeInformation<DBID> getInputTypeRestriction()
Description copied from interface: DistanceFunction
Get the input data type of the function.

Specified by:
getInputTypeRestriction in interface DistanceFunction<DBID,D extends Distance<D>>
Returns:
Type restriction

instantiate

public final <O extends DBID> DistanceQuery<O,D> instantiate(Relation<O> database)
Description copied from interface: DistanceFunction
Instantiate with a database to get the actual distance query.

Specified by:
instantiate in interface DistanceFunction<DBID,D extends Distance<D>>
Parameters:
database - The representation to use
Returns:
Actual distance query.

Release 0.4.0 (2011-09-20_1324)