Package elki.distance
Class AbstractDBIDRangeDistance
- java.lang.Object
-
- elki.distance.AbstractDatabaseDistance<DBID>
-
- elki.distance.AbstractDBIDRangeDistance
-
- All Implemented Interfaces:
DBIDDistance
,DBIDRangeDistance
,Distance<DBID>
- Direct Known Subclasses:
DiskCacheBasedDoubleDistance
,DiskCacheBasedFloatDistance
,FileBasedSparseDoubleDistance
,FileBasedSparseFloatDistance
public abstract class AbstractDBIDRangeDistance extends AbstractDatabaseDistance<DBID> implements DBIDRangeDistance
Abstract base class for distance functions that rely on integer offsets within a consecutive range. This is beneficial for external distances.- Since:
- 0.7.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class elki.distance.AbstractDatabaseDistance
AbstractDatabaseDistance.Instance<O>
-
-
Constructor Summary
Constructors Constructor Description AbstractDBIDRangeDistance()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
distance(DBIDRef o1, DBIDRef o2)
Returns the distance between the two objects specified by their object ids.SimpleTypeInformation<DBID>
getInputTypeRestriction()
Get the input data type of the function.<O extends DBID>
DistanceQuery<O>instantiate(Relation<O> database)
Instantiate with a database to get the actual distance query.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.distance.DBIDRangeDistance
checkRange, distance
-
Methods inherited from interface elki.distance.Distance
isMetric, isSquared, isSymmetric
-
-
-
-
Method Detail
-
distance
public double distance(DBIDRef o1, DBIDRef o2)
Description copied from interface:DBIDDistance
Returns the distance between the two objects specified by their object ids.- Specified by:
distance
in interfaceDBIDDistance
- Parameters:
o1
- first object ido2
- second object id- Returns:
- the distance between the two objects specified by their object ids
-
getInputTypeRestriction
public SimpleTypeInformation<DBID> getInputTypeRestriction()
Description copied from interface:Distance
Get the input data type of the function.- Specified by:
getInputTypeRestriction
in interfaceDistance<DBID>
- Returns:
- Type restriction
-
instantiate
public <O extends DBID> DistanceQuery<O> instantiate(Relation<O> database)
Description copied from interface:Distance
Instantiate with a database to get the actual distance query.- Specified by:
instantiate
in interfaceDistance<DBID>
- Parameters:
database
- The representation to use- Returns:
- Actual distance query.
-
-