de.lmu.ifi.dbs.elki.distance.similarityfunction
Class SharedNearestNeighborSimilarityFunction<O>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.distance.similarityfunction.AbstractIndexBasedSimilarityFunction<O,SharedNearestNeighborIndex<O>,SetDBIDs,IntegerDistance>
      extended by 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.


Nested Class Summary
static class SharedNearestNeighborSimilarityFunction.Instance<O>
          Instance for a particular database.
static class SharedNearestNeighborSimilarityFunction.Parameterizer<O>
          Parameterization class.
 
Field Summary
 
Fields inherited from class de.lmu.ifi.dbs.elki.distance.similarityfunction.AbstractIndexBasedSimilarityFunction
INDEX_ID, indexFactory
 
Constructor Summary
SharedNearestNeighborSimilarityFunction(SharedNearestNeighborIndex.Factory<O,SharedNearestNeighborIndex<O>> indexFactory)
          Constructor.
 
Method Summary
protected static int countSharedNeighbors(SetDBIDs neighbors1, SetDBIDs neighbors2)
           
 IntegerDistance getDistanceFactory()
          Get a distance factory.
<T extends O>
SharedNearestNeighborSimilarityFunction.Instance<T>
instantiate(Relation<T> database)
          Preprocess the database to get the actual distance function.
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.similarityfunction.AbstractIndexBasedSimilarityFunction
getInputTypeRestriction, isSymmetric
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SharedNearestNeighborSimilarityFunction

public SharedNearestNeighborSimilarityFunction(SharedNearestNeighborIndex.Factory<O,SharedNearestNeighborIndex<O>> indexFactory)
Constructor.

Parameters:
indexFactory - Index factory.
Method Detail

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.

Release 0.4.0 (2011-09-20_1324)