O - Database object type.public class PrimitiveDistanceQuery<O> extends java.lang.Object implements DistanceQuery<O>
| Modifier and Type | Field and Description |
|---|---|
protected PrimitiveDistanceFunction<? super O> |
distanceFunction
The distance function we use.
|
protected Relation<? extends O> |
relation
The data to use for this query
|
HINT_BULK, HINT_EXACT, HINT_HEAVY_USE, HINT_NO_CACHE, HINT_OPTIMIZED_ONLY, HINT_SINGLE| Constructor and Description |
|---|
PrimitiveDistanceQuery(Relation<? extends O> relation,
PrimitiveDistanceFunction<? super O> distanceFunction)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
double |
distance(DBIDRef id1,
DBIDRef id2)
Returns the distance between the two objects specified by their object ids.
|
double |
distance(DBIDRef id1,
O o2)
Returns the distance between the two objects specified by their object ids.
|
double |
distance(O o1,
DBIDRef id2)
Returns the distance between the two objects specified by their object ids.
|
double |
distance(O o1,
O o2)
Returns the distance between the two objects specified by their object ids.
|
PrimitiveDistanceFunction<? super O> |
getDistanceFunction()
Get the inner distance function.
|
Relation<? extends O> |
getRelation()
Access the underlying data query.
|
protected final PrimitiveDistanceFunction<? super O> distanceFunction
public PrimitiveDistanceQuery(Relation<? extends O> relation, PrimitiveDistanceFunction<? super O> distanceFunction)
relation - Representation to use.distanceFunction - Our distance functionpublic final double distance(DBIDRef id1, DBIDRef id2)
DistanceQuerydistance in interface DistanceQuery<O>id1 - first object idid2 - second object idpublic final double distance(O o1, DBIDRef id2)
DistanceQuerydistance in interface DistanceQuery<O>o1 - first objectid2 - second object idpublic final double distance(DBIDRef id1, O o2)
DistanceQuerydistance in interface DistanceQuery<O>id1 - first object ido2 - second objectpublic double distance(O o1, O o2)
DistanceQuerydistance in interface DistanceQuery<O>o1 - first objecto2 - second objectpublic Relation<? extends O> getRelation()
DistanceQuerygetRelation in interface DistanceQuery<O>public PrimitiveDistanceFunction<? super O> getDistanceFunction()
DistanceQuerygetDistanceFunction in interface DistanceQuery<O>Copyright © 2019 ELKI Development Team. License information.