de.lmu.ifi.dbs.elki.distance.similarityfunction
Class AbstractPrimitiveSimilarityFunction<O,D extends Distance<D>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.distance.similarityfunction.AbstractPrimitiveSimilarityFunction<O,D>
Type Parameters:
O - object type
D - distance type
All Implemented Interfaces:
PrimitiveSimilarityFunction<O,D>, SimilarityFunction<O,D>, InspectionUtilFrequentlyScanned, Parameterizable
Direct Known Subclasses:
AbstractDBIDSimilarityFunction, LinearKernelFunction

public abstract class AbstractPrimitiveSimilarityFunction<O,D extends Distance<D>>
extends Object
implements PrimitiveSimilarityFunction<O,D>

Base implementation of a similarity function.


Constructor Summary
protected AbstractPrimitiveSimilarityFunction()
          Constructor.
 
Method Summary
abstract  SimpleTypeInformation<? super O> getInputTypeRestriction()
          Get the input data type of the function.
<T extends O>
SimilarityQuery<T,D>
instantiate(Relation<T> relation)
          Instantiate with a representation to get the actual similarity query.
 boolean isSymmetric()
          Is this function symmetric?
abstract  D similarity(O o1, O o2)
          Computes the similarity between two given DatabaseObjects according to this similarity function.
 
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.distance.similarityfunction.SimilarityFunction
getDistanceFactory
 

Constructor Detail

AbstractPrimitiveSimilarityFunction

protected AbstractPrimitiveSimilarityFunction()
Constructor.

Method Detail

isSymmetric

public boolean isSymmetric()
Description copied from interface: SimilarityFunction
Is this function symmetric?

Specified by:
isSymmetric in interface SimilarityFunction<O,D extends Distance<D>>
Returns:
true when symmetric

getInputTypeRestriction

public abstract SimpleTypeInformation<? super O> getInputTypeRestriction()
Description copied from interface: SimilarityFunction
Get the input data type of the function.

Specified by:
getInputTypeRestriction in interface PrimitiveSimilarityFunction<O,D extends Distance<D>>
Specified by:
getInputTypeRestriction in interface SimilarityFunction<O,D extends Distance<D>>

similarity

public abstract D similarity(O o1,
                             O o2)
Description copied from interface: PrimitiveSimilarityFunction
Computes the similarity between two given DatabaseObjects according to this similarity function.

Specified by:
similarity in interface PrimitiveSimilarityFunction<O,D extends Distance<D>>
Parameters:
o1 - first DatabaseObject
o2 - second DatabaseObject
Returns:
the similarity between two given DatabaseObjects according to this similarity function

instantiate

public <T extends O> SimilarityQuery<T,D> instantiate(Relation<T> relation)
Description copied from interface: SimilarityFunction
Instantiate with a representation to get the actual similarity query.

Specified by:
instantiate in interface SimilarityFunction<O,D extends Distance<D>>
Parameters:
relation - Representation to use
Returns:
Actual distance query.

Release 0.4.0 (2011-09-20_1324)