de.lmu.ifi.dbs.elki.distance.distancefunction
Class SharedNearestNeighborJaccardDistanceFunction.Instance<T>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.database.query.AbstractDataBasedQuery<O>
      extended by de.lmu.ifi.dbs.elki.database.query.distance.AbstractDistanceQuery<O,D>
          extended by de.lmu.ifi.dbs.elki.database.query.distance.AbstractDatabaseDistanceQuery<O,D>
              extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractIndexBasedDistanceFunction.Instance<T,SharedNearestNeighborIndex<T>,DoubleDistance,SharedNearestNeighborJaccardDistanceFunction<T>>
                  extended by de.lmu.ifi.dbs.elki.distance.distancefunction.SharedNearestNeighborJaccardDistanceFunction.Instance<T>
Type Parameters:
T - Object type
All Implemented Interfaces:
DatabaseQuery, DistanceQuery<T,DoubleDistance>, IndexBasedDistanceFunction.Instance<T,SharedNearestNeighborIndex<T>,DoubleDistance>
Enclosing class:
SharedNearestNeighborJaccardDistanceFunction<O>

public static class SharedNearestNeighborJaccardDistanceFunction.Instance<T>
extends AbstractIndexBasedDistanceFunction.Instance<T,SharedNearestNeighborIndex<T>,DoubleDistance,SharedNearestNeighborJaccardDistanceFunction<T>>

Actual instance for a dataset.


Field Summary
 
Fields inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractIndexBasedDistanceFunction.Instance
index, parent
 
Fields inherited from class de.lmu.ifi.dbs.elki.database.query.AbstractDataBasedQuery
relation
 
Fields inherited from interface de.lmu.ifi.dbs.elki.database.query.DatabaseQuery
HINT_BULK, HINT_EXACT, HINT_HEAVY_USE, HINT_NO_CACHE, HINT_OPTIMIZED_ONLY, HINT_SINGLE
 
Constructor Summary
SharedNearestNeighborJaccardDistanceFunction.Instance(Relation<T> database, SharedNearestNeighborIndex<T> preprocessor, SharedNearestNeighborJaccardDistanceFunction<T> parent)
          Constructor.
 
Method Summary
 DoubleDistance distance(DBID id1, DBID id2)
          Returns the distance between the two objects specified by their object ids.
 DoubleDistance getDistanceFactory()
          Method to get the distance functions factory.
protected static double jaccardCoefficient(TreeSetDBIDs neighbors1, TreeSetDBIDs neighbors2)
           
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractIndexBasedDistanceFunction.Instance
getDistanceFunction, getIndex
 
Methods inherited from class de.lmu.ifi.dbs.elki.database.query.distance.AbstractDatabaseDistanceQuery
distance, distance, distance
 
Methods inherited from class de.lmu.ifi.dbs.elki.database.query.distance.AbstractDistanceQuery
infiniteDistance, nullDistance, undefinedDistance
 
Methods inherited from class de.lmu.ifi.dbs.elki.database.query.AbstractDataBasedQuery
getRelation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.database.query.distance.DistanceQuery
distance, distance, distance, getRelation, infiniteDistance, nullDistance, undefinedDistance
 

Constructor Detail

SharedNearestNeighborJaccardDistanceFunction.Instance

public SharedNearestNeighborJaccardDistanceFunction.Instance(Relation<T> database,
                                                             SharedNearestNeighborIndex<T> preprocessor,
                                                             SharedNearestNeighborJaccardDistanceFunction<T> parent)
Constructor.

Parameters:
database - Database
preprocessor - Preprocessor
parent - Parent distance
Method Detail

jaccardCoefficient

protected static double jaccardCoefficient(TreeSetDBIDs neighbors1,
                                           TreeSetDBIDs neighbors2)

distance

public DoubleDistance distance(DBID id1,
                               DBID id2)
Description copied from class: AbstractDistanceQuery
Returns the distance between the two objects specified by their object ids.

Specified by:
distance in interface DistanceQuery<T,DoubleDistance>
Specified by:
distance in class AbstractDistanceQuery<T,DoubleDistance>
Parameters:
id1 - first object id
id2 - second object id
Returns:
the distance between the two objects specified by their object ids

getDistanceFactory

public DoubleDistance getDistanceFactory()
Description copied from interface: DistanceQuery
Method to get the distance functions factory.

Specified by:
getDistanceFactory in interface DistanceQuery<T,DoubleDistance>
Overrides:
getDistanceFactory in class AbstractDistanceQuery<T,DoubleDistance>
Returns:
Factory for distance objects

Release 0.4.0 (2011-09-20_1324)