Package elki.database.query.distance
Class DBIDRangeDistanceQuery
- java.lang.Object
-
- elki.database.query.distance.DBIDDistanceQuery
-
- elki.database.query.distance.DBIDRangeDistanceQuery
-
- All Implemented Interfaces:
DatabaseDistanceQuery<DBID>
,DistanceQuery<DBID>
public class DBIDRangeDistanceQuery extends DBIDDistanceQuery
Run a distance query based on DBIDRanges- Since:
- 0.7.0
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description protected DBIDRangeDistance
distanceFunction
The distance function we use.protected DBIDRange
range
The DBID range we are accessing.-
Fields inherited from class elki.database.query.distance.DBIDDistanceQuery
relation
-
-
Constructor Summary
Constructors Constructor Description DBIDRangeDistanceQuery(Relation<DBID> relation, DBIDRangeDistance distanceFunction)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
distance(DBIDRef id1, DBIDRef id2)
Returns the distance between the two objects specified by their object ids.DBIDDistance
getDistance()
Get the inner distance function.-
Methods inherited from class elki.database.query.distance.DBIDDistanceQuery
getRelation
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.database.query.distance.DatabaseDistanceQuery
distance, distance, distance
-
-
-
-
Field Detail
-
distanceFunction
protected final DBIDRangeDistance distanceFunction
The distance function we use.
-
range
protected final DBIDRange range
The DBID range we are accessing.
-
-
Constructor Detail
-
DBIDRangeDistanceQuery
public DBIDRangeDistanceQuery(Relation<DBID> relation, DBIDRangeDistance distanceFunction)
Constructor.- Parameters:
relation
- Database to use.distanceFunction
- Our distance function
-
-
Method Detail
-
distance
public double distance(DBIDRef id1, DBIDRef id2)
Description copied from interface:DistanceQuery
Returns the distance between the two objects specified by their object ids.- Specified by:
distance
in interfaceDistanceQuery<DBID>
- Overrides:
distance
in classDBIDDistanceQuery
- Parameters:
id1
- first object idid2
- second object id- Returns:
- the distance between the two objects specified by their object ids
-
getDistance
public DBIDDistance getDistance()
Description copied from interface:DistanceQuery
Get the inner distance function.- Specified by:
getDistance
in interfaceDistanceQuery<DBID>
- Overrides:
getDistance
in classDBIDDistanceQuery
- Returns:
- Distance function
-
-