Package elki.similarity
Class SharedNearestNeighborSimilarity.Instance<O>
- java.lang.Object
-
- elki.similarity.AbstractIndexBasedSimilarity.Instance<O,SharedNearestNeighborIndex<O>>
-
- elki.similarity.SharedNearestNeighborSimilarity.Instance<O>
-
- Type Parameters:
O
- Object type
- All Implemented Interfaces:
DatabaseSimilarityQuery<O>
,SimilarityQuery<O>
,IndexBasedSimilarity.Instance<O,SharedNearestNeighborIndex<O>>
- Enclosing class:
- SharedNearestNeighborSimilarity<O>
public static class SharedNearestNeighborSimilarity.Instance<O> extends AbstractIndexBasedSimilarity.Instance<O,SharedNearestNeighborIndex<O>>
Instance for a particular database.- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description private SharedNearestNeighborSimilarity<? super O>
similarityFunction
Similarity function.-
Fields inherited from class elki.similarity.AbstractIndexBasedSimilarity.Instance
index, relation
-
-
Constructor Summary
Constructors Constructor Description Instance(Relation<O> database, SharedNearestNeighborIndex<O> preprocessor, SharedNearestNeighborSimilarity<? super O> similarityFunction)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Similarity<? 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.-
Methods inherited from class elki.similarity.AbstractIndexBasedSimilarity.Instance
getIndex, 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.similarity.DatabaseSimilarityQuery
similarity, similarity, similarity
-
-
-
-
Field Detail
-
similarityFunction
private SharedNearestNeighborSimilarity<? super O> similarityFunction
Similarity function.
-
-
Constructor Detail
-
Instance
public Instance(Relation<O> database, SharedNearestNeighborIndex<O> preprocessor, SharedNearestNeighborSimilarity<? super O> similarityFunction)
Constructor.- Parameters:
database
- Databasepreprocessor
- Index
-
-
Method Detail
-
similarity
public double similarity(DBIDRef id1, DBIDRef id2)
Description copied from interface:SimilarityQuery
Returns the similarity between the two objects specified by their object ids.- Parameters:
id1
- first object idid2
- second object id- Returns:
- the similarity between the two objects specified by their object ids
-
getSimilarity
public Similarity<? super O> getSimilarity()
Description copied from interface:SimilarityQuery
Get the inner similarity function.- Returns:
- Similarity function
-
-