Package elki.similarity
Class AbstractIndexBasedSimilarity<O,F extends IndexFactory<O>>
- java.lang.Object
-
- elki.similarity.AbstractIndexBasedSimilarity<O,F>
-
- Type Parameters:
O- object typeF- index type
- All Implemented Interfaces:
IndexBasedSimilarity<O>,Similarity<O>
- Direct Known Subclasses:
FractionalSharedNearestNeighborSimilarity,SharedNearestNeighborSimilarity
public abstract class AbstractIndexBasedSimilarity<O,F extends IndexFactory<O>> extends java.lang.Object implements IndexBasedSimilarity<O>
Abstract super class for distance functions needing a preprocessor.- Since:
- 0.1
- Author:
- Elke Achtert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractIndexBasedSimilarity.Instance<O,I extends Index>The actual instance bound to a particular database.static classAbstractIndexBasedSimilarity.Par<F extends IndexFactory<?>>Parameterization class.
-
Field Summary
Fields Modifier and Type Field Description protected FindexFactoryParameter to specify the preprocessor to be used.
-
Constructor Summary
Constructors Constructor Description AbstractIndexBasedSimilarity(F indexFactory)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description TypeInformationgetInputTypeRestriction()Get the input data type of the function.abstract <T extends O>
AbstractIndexBasedSimilarity.Instance<T,?>instantiate(Relation<T> database)Preprocess the database to get the actual distance function.booleanisSymmetric()Is this function symmetric?
-
-
-
Field Detail
-
indexFactory
protected F extends IndexFactory<O> indexFactory
Parameter to specify the preprocessor to be used.
-
-
Constructor Detail
-
AbstractIndexBasedSimilarity
public AbstractIndexBasedSimilarity(F indexFactory)
Constructor.- Parameters:
indexFactory-
-
-
Method Detail
-
instantiate
public abstract <T extends O> AbstractIndexBasedSimilarity.Instance<T,?> instantiate(Relation<T> database)
Description copied from interface:IndexBasedSimilarityPreprocess the database to get the actual distance function.- Specified by:
instantiatein interfaceIndexBasedSimilarity<O>- Specified by:
instantiatein interfaceSimilarity<O>- Parameters:
database- Representation to use- Returns:
- Actual distance query.
-
isSymmetric
public boolean isSymmetric()
Description copied from interface:SimilarityIs this function symmetric?- Specified by:
isSymmetricin interfaceSimilarity<O>- Returns:
truewhen symmetric
-
getInputTypeRestriction
public final TypeInformation getInputTypeRestriction()
Description copied from interface:SimilarityGet the input data type of the function.- Specified by:
getInputTypeRestrictionin interfaceSimilarity<O>
-
-