D
- the type of Distance usedpublic abstract class AbstractDBIDDistanceFunction<D extends Distance<D>> extends Object implements DBIDDistanceFunction<D>
Modifier | Constructor and Description |
---|---|
protected |
AbstractDBIDDistanceFunction()
Provides an abstract DistanceFunction.
|
Modifier and Type | Method and Description |
---|---|
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> |
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?
|
protected AbstractDBIDDistanceFunction()
public abstract D distance(DBID o1, DBID o2)
DBIDDistanceFunction
distance
in interface DBIDDistanceFunction<D extends Distance<D>>
o1
- first object ido2
- second object idpublic abstract D getDistanceFactory()
DistanceFunction
getDistanceFactory
in interface DistanceFunction<DBID,D extends Distance<D>>
public boolean isSymmetric()
DistanceFunction
isSymmetric
in interface DistanceFunction<DBID,D extends Distance<D>>
true
when symmetricpublic boolean isMetric()
DistanceFunction
public SimpleTypeInformation<DBID> getInputTypeRestriction()
DistanceFunction
getInputTypeRestriction
in interface DistanceFunction<DBID,D extends Distance<D>>
public final <O extends DBID> DistanceQuery<O,D> instantiate(Relation<O> database)
DistanceFunction
instantiate
in interface DistanceFunction<DBID,D extends Distance<D>>
database
- The representation to use