Package elki.database.query.distance
Class SpatialPrimitiveDistanceSimilarityQuery<O extends SpatialComparable>
- java.lang.Object
-
- elki.database.query.distance.PrimitiveDistanceQuery<V>
-
- elki.database.query.distance.SpatialPrimitiveDistanceQuery<O>
-
- elki.database.query.distance.SpatialPrimitiveDistanceSimilarityQuery<O>
-
- Type Parameters:
O
- Object type
- All Implemented Interfaces:
DistanceQuery<O>
,SpatialDistanceQuery<O>
,DistanceSimilarityQuery<O>
,SimilarityQuery<O>
public class SpatialPrimitiveDistanceSimilarityQuery<O extends SpatialComparable> extends SpatialPrimitiveDistanceQuery<O> implements DistanceSimilarityQuery<O>
Combination query class, to allow combined implementations of spatial distances and similarities.- Since:
- 0.7.5
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description private PrimitiveSimilarity<? super O>
similarityFunction
Typed reference to the similarity function (usually the same as the distance function!)-
Fields inherited from class elki.database.query.distance.SpatialPrimitiveDistanceQuery
distanceFunction
-
Fields inherited from class elki.database.query.distance.PrimitiveDistanceQuery
relation
-
-
Constructor Summary
Constructors Constructor Description SpatialPrimitiveDistanceSimilarityQuery(Relation<? extends O> relation, SpatialPrimitiveDistance<? super O> distanceFunction, PrimitiveSimilarity<? super O> similarityFunction)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PrimitiveSimilarity<? super O>
getSimilarity()
Get the inner similarity function.double
similarity(DBIDRef id1, DBIDRef id2)
Returns the similarity between the two objects specified by their object ids.double
similarity(DBIDRef id1, O o2)
Returns the similarity between the two objects specified by their object ids.double
similarity(O o1, DBIDRef id2)
Returns the similarity between the two objects specified by their object ids.double
similarity(O o1, O o2)
Returns the similarity between the two objects specified by their object ids.-
Methods inherited from class elki.database.query.distance.SpatialPrimitiveDistanceQuery
getDistance, minDist, minDist
-
Methods inherited from class elki.database.query.distance.PrimitiveDistanceQuery
distance, distance, distance, distance, 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.DistanceQuery
distance, distance, distance, distance, getRelation
-
Methods inherited from interface elki.database.query.similarity.SimilarityQuery
getRelation
-
-
-
-
Field Detail
-
similarityFunction
private PrimitiveSimilarity<? super O extends SpatialComparable> similarityFunction
Typed reference to the similarity function (usually the same as the distance function!)
-
-
Constructor Detail
-
SpatialPrimitiveDistanceSimilarityQuery
public SpatialPrimitiveDistanceSimilarityQuery(Relation<? extends O> relation, SpatialPrimitiveDistance<? super O> distanceFunction, PrimitiveSimilarity<? super O> similarityFunction)
Constructor.- Parameters:
relation
- RepresentationdistanceFunction
- distance functionsimilarityFunction
- similarity function (usually the same as the distance function!)
-
-
Method Detail
-
similarity
public final double similarity(DBIDRef id1, DBIDRef id2)
Description copied from interface:SimilarityQuery
Returns the similarity between the two objects specified by their object ids.- Specified by:
similarity
in interfaceSimilarityQuery<O extends SpatialComparable>
- Parameters:
id1
- first object idid2
- second object id- Returns:
- the similarity between the two objects specified by their object ids
-
similarity
public final double similarity(O o1, DBIDRef id2)
Description copied from interface:SimilarityQuery
Returns the similarity between the two objects specified by their object ids.- Specified by:
similarity
in interfaceSimilarityQuery<O extends SpatialComparable>
- Parameters:
o1
- first objectid2
- second object id- Returns:
- the similarity between the two objects specified by their object ids
-
similarity
public final double similarity(DBIDRef id1, O o2)
Description copied from interface:SimilarityQuery
Returns the similarity between the two objects specified by their object ids.- Specified by:
similarity
in interfaceSimilarityQuery<O extends SpatialComparable>
- Parameters:
id1
- first object ido2
- second object- Returns:
- the similarity between the two objects specified by their object ids
-
similarity
public double similarity(O o1, O o2)
Description copied from interface:SimilarityQuery
Returns the similarity between the two objects specified by their object ids.- Specified by:
similarity
in interfaceSimilarityQuery<O extends SpatialComparable>
- Parameters:
o1
- first objecto2
- second object- Returns:
- the similarity between the two objects specified by their object ids
-
getSimilarity
public PrimitiveSimilarity<? super O> getSimilarity()
Description copied from interface:SimilarityQuery
Get the inner similarity function.- Specified by:
getSimilarity
in interfaceSimilarityQuery<O extends SpatialComparable>
- Returns:
- Similarity function
-
-