de.lmu.ifi.dbs.elki.distance.similarityfunction
Class SharedNearestNeighborSimilarityFunction<O>
java.lang.Object
de.lmu.ifi.dbs.elki.distance.similarityfunction.AbstractIndexBasedSimilarityFunction<O,SharedNearestNeighborIndex<O>,SetDBIDs,IntegerDistance>
de.lmu.ifi.dbs.elki.distance.similarityfunction.SharedNearestNeighborSimilarityFunction<O>
- Type Parameters:
O
- object type
- All Implemented Interfaces:
- IndexBasedSimilarityFunction<O,IntegerDistance>, SimilarityFunction<O,IntegerDistance>, InspectionUtilFrequentlyScanned, Parameterizable
public class SharedNearestNeighborSimilarityFunction<O>
- extends AbstractIndexBasedSimilarityFunction<O,SharedNearestNeighborIndex<O>,SetDBIDs,IntegerDistance>
SharedNearestNeighborSimilarityFunction with a pattern defined to accept
Strings that define a non-negative Integer.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SharedNearestNeighborSimilarityFunction
public SharedNearestNeighborSimilarityFunction(SharedNearestNeighborIndex.Factory<O,SharedNearestNeighborIndex<O>> indexFactory)
- Constructor.
- Parameters:
indexFactory
- Index factory.
getDistanceFactory
public IntegerDistance getDistanceFactory()
- Description copied from interface:
SimilarityFunction
- Get a distance factory.
- Returns:
- distance factory
countSharedNeighbors
protected static int countSharedNeighbors(SetDBIDs neighbors1,
SetDBIDs neighbors2)
instantiate
public <T extends O> SharedNearestNeighborSimilarityFunction.Instance<T> instantiate(Relation<T> database)
- Description copied from interface:
IndexBasedSimilarityFunction
- Preprocess the database to get the actual distance function.
- Specified by:
instantiate
in interface IndexBasedSimilarityFunction<O,IntegerDistance>
- Specified by:
instantiate
in interface SimilarityFunction<O,IntegerDistance>
- Specified by:
instantiate
in class AbstractIndexBasedSimilarityFunction<O,SharedNearestNeighborIndex<O>,SetDBIDs,IntegerDistance>
- Parameters:
database
- Representation to use
- Returns:
- Actual distance query.