Package elki.distance.adapter
Class AbstractSimilarityAdapter<O>
- java.lang.Object
-
- elki.distance.AbstractDatabaseDistance<O>
-
- elki.distance.adapter.AbstractSimilarityAdapter<O>
-
- Type Parameters:
O
- object class to process
- All Implemented Interfaces:
Distance<O>
- Direct Known Subclasses:
ArccosSimilarityAdapter
,LinearSimilarityAdapter
,LnSimilarityAdapter
public abstract class AbstractSimilarityAdapter<O> extends AbstractDatabaseDistance<O>
Adapter from a similarity function to a distance function.Note: The derived distance function will usually not satisfy the triangle equation.
- Since:
- 0.2
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractSimilarityAdapter.Instance<O>
Inner proxy class for SNN distance function.static class
AbstractSimilarityAdapter.Par<O,S extends Similarity<? super O>>
Parameterization class.
-
Field Summary
Fields Modifier and Type Field Description protected Similarity<? super O>
similarityFunction
Holds the similarity function.
-
Constructor Summary
Constructors Constructor Description AbstractSimilarityAdapter(Similarity<? super O> similarityFunction)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
TypeInformation
getInputTypeRestriction()
Get the input data type of the function.int
hashCode()
abstract <T extends O>
DistanceQuery<T>instantiate(Relation<T> database)
Instantiate with a database to get the actual distance query.boolean
isSymmetric()
Is this function symmetric?
-
-
-
Field Detail
-
similarityFunction
protected Similarity<? super O> similarityFunction
Holds the similarity function.
-
-
Constructor Detail
-
AbstractSimilarityAdapter
public AbstractSimilarityAdapter(Similarity<? super O> similarityFunction)
Constructor.- Parameters:
similarityFunction
- Similarity function to use.
-
-
Method Detail
-
getInputTypeRestriction
public TypeInformation getInputTypeRestriction()
Description copied from interface:Distance
Get the input data type of the function.- Returns:
- Type restriction
-
isSymmetric
public boolean isSymmetric()
Description copied from interface:Distance
Is this function symmetric?- Returns:
true
when symmetric
-
instantiate
public abstract <T extends O> DistanceQuery<T> instantiate(Relation<T> database)
Description copied from interface:Distance
Instantiate with a database to get the actual distance query.- Parameters:
database
- The representation to use- Returns:
- Actual distance query.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-