de.lmu.ifi.dbs.elki.distance.distancefunction.adapter
Class AbstractSimilarityAdapter.Instance<O>

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.AbstractDatabaseDistanceFunction.Instance<O,DoubleDistance>
                  extended by de.lmu.ifi.dbs.elki.distance.distancefunction.adapter.AbstractSimilarityAdapter.Instance<O>
Type Parameters:
O - Object type
All Implemented Interfaces:
DatabaseQuery, DistanceQuery<O,DoubleDistance>
Direct Known Subclasses:
SimilarityAdapterArccos.Instance, SimilarityAdapterLinear.Instance, SimilarityAdapterLn.Instance
Enclosing class:
AbstractSimilarityAdapter<O>

public abstract static class AbstractSimilarityAdapter.Instance<O>
extends AbstractDatabaseDistanceFunction.Instance<O,DoubleDistance>

Inner proxy class for SNN distance function.


Field Summary
private  SimilarityQuery<? super O,? extends NumberDistance<?,?>> similarityQuery
          The similarity query we use.
 
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
AbstractSimilarityAdapter.Instance(Relation<O> database, DistanceFunction<? super O,DoubleDistance> parent, SimilarityQuery<? super O,? extends NumberDistance<?,?>> similarityQuery)
          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.
abstract  double transform(double similarity)
          Transformation function.
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDatabaseDistanceFunction.Instance
getDistanceFunction
 
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
getRelation
 

Field Detail

similarityQuery

private SimilarityQuery<? super O,? extends NumberDistance<?,?>> similarityQuery
The similarity query we use.

Constructor Detail

AbstractSimilarityAdapter.Instance

public AbstractSimilarityAdapter.Instance(Relation<O> database,
                                          DistanceFunction<? super O,DoubleDistance> parent,
                                          SimilarityQuery<? super O,? extends NumberDistance<?,?>> similarityQuery)
Constructor.

Parameters:
database - Database to use
parent - Parent distance function
similarityQuery - Similarity query
Method Detail

transform

public abstract double transform(double similarity)
Transformation function.

Parameters:
similarity - Similarity value
Returns:
Distance value

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<O,DoubleDistance>
Specified by:
distance in class AbstractDistanceQuery<O,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<O,DoubleDistance>
Overrides:
getDistanceFactory in class AbstractDistanceQuery<O,DoubleDistance>
Returns:
Factory for distance objects

Release 0.4.0 (2011-09-20_1324)