Package elki.database.query.distance
Class PrimitiveDistanceSimilarityQuery<O>
- java.lang.Object
-
- elki.database.query.distance.PrimitiveDistanceQuery<O>
-
- elki.database.query.distance.PrimitiveDistanceSimilarityQuery<O>
-
- Type Parameters:
O
- Object type
- All Implemented Interfaces:
DistanceQuery<O>
,DistanceSimilarityQuery<O>
,SimilarityQuery<O>
public class PrimitiveDistanceSimilarityQuery<O> extends PrimitiveDistanceQuery<O> implements DistanceSimilarityQuery<O>
Combination query class, for convenience.- Since:
- 0.4.0
- 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.PrimitiveDistanceQuery
distanceFunction, relation
-
-
Constructor Summary
Constructors Constructor Description PrimitiveDistanceSimilarityQuery(Relation<? extends O> relation, PrimitiveDistance<? 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.PrimitiveDistanceQuery
distance, distance, distance, distance, getDistance, 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, getDistance, getRelation
-
Methods inherited from interface elki.database.query.similarity.SimilarityQuery
getRelation
-
-
-
-
Field Detail
-
similarityFunction
private PrimitiveSimilarity<? super O> similarityFunction
Typed reference to the similarity function (usually the same as the distance function!)
-
-
Constructor Detail
-
PrimitiveDistanceSimilarityQuery
public PrimitiveDistanceSimilarityQuery(Relation<? extends O> relation, PrimitiveDistance<? 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>
- 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>
- 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>
- 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>
- 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>
- Returns:
- Similarity function
-
-