de.lmu.ifi.dbs.elki.database.query.similarity
Class PrimitiveSimilarityQuery<O,D extends Distance<D>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.database.query.AbstractDataBasedQuery<O>
      extended by de.lmu.ifi.dbs.elki.database.query.similarity.AbstractSimilarityQuery<O,D>
          extended by de.lmu.ifi.dbs.elki.database.query.similarity.PrimitiveSimilarityQuery<O,D>
Type Parameters:
O - Database object type.
D - Distance result type.
All Implemented Interfaces:
DatabaseQuery, SimilarityQuery<O,D>

public class PrimitiveSimilarityQuery<O,D extends Distance<D>>
extends AbstractSimilarityQuery<O,D>

Run a database query in a database context.


Field Summary
protected  PrimitiveSimilarityFunction<? super O,D> similarityFunction
          The distance function 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
PrimitiveSimilarityQuery(Relation<? extends O> relation, PrimitiveSimilarityFunction<? super O,D> similarityFunction)
          Constructor.
 
Method Summary
 D getDistanceFactory()
          Method to get the distance functions factory.
 D similarity(DBID id1, DBID id2)
          Returns the distance between the two objects specified by their object ids.
 D similarity(DBID id1, O o2)
          Returns the distance between the two objects specified by their object ids.
 D similarity(O o1, DBID id2)
          Returns the distance between the two objects specified by their object ids.
 D similarity(O o1, O o2)
          Returns the distance between the two objects specified by their object ids.
 
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.similarity.SimilarityQuery
getRelation
 

Field Detail

similarityFunction

protected final PrimitiveSimilarityFunction<? super O,D extends Distance<D>> similarityFunction
The distance function we use.

Constructor Detail

PrimitiveSimilarityQuery

public PrimitiveSimilarityQuery(Relation<? extends O> relation,
                                PrimitiveSimilarityFunction<? super O,D> similarityFunction)
Constructor.

Parameters:
relation - Relation to use.
similarityFunction - Our similarity function
Method Detail

similarity

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

Specified by:
similarity in interface SimilarityQuery<O,D extends Distance<D>>
Specified by:
similarity in class AbstractSimilarityQuery<O,D extends Distance<D>>
Parameters:
id1 - first object id
id2 - second object id
Returns:
the distance between the two objects specified by their object ids

similarity

public D similarity(O o1,
                    DBID id2)
Description copied from class: AbstractSimilarityQuery
Returns the distance between the two objects specified by their object ids.

Specified by:
similarity in interface SimilarityQuery<O,D extends Distance<D>>
Specified by:
similarity in class AbstractSimilarityQuery<O,D extends Distance<D>>
Parameters:
o1 - first object
id2 - second object id
Returns:
the distance between the two objects specified by their object ids

similarity

public D similarity(DBID id1,
                    O o2)
Description copied from class: AbstractSimilarityQuery
Returns the distance between the two objects specified by their object ids.

Specified by:
similarity in interface SimilarityQuery<O,D extends Distance<D>>
Specified by:
similarity in class AbstractSimilarityQuery<O,D extends Distance<D>>
Parameters:
id1 - first object id
o2 - second object
Returns:
the distance between the two objects specified by their object ids

similarity

public D similarity(O o1,
                    O o2)
Description copied from class: AbstractSimilarityQuery
Returns the distance between the two objects specified by their object ids.

Specified by:
similarity in interface SimilarityQuery<O,D extends Distance<D>>
Specified by:
similarity in class AbstractSimilarityQuery<O,D extends Distance<D>>
Parameters:
o1 - first object
o2 - second object
Returns:
the distance between the two objects specified by their object ids

getDistanceFactory

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

Returns:
Factory for distance objects

Release 0.4.0 (2011-09-20_1324)