Package elki.index.lsh.hashfamilies
Class AbstractProjectedHashFunctionFamily
- java.lang.Object
-
- elki.index.lsh.hashfamilies.AbstractProjectedHashFunctionFamily
-
- All Implemented Interfaces:
LocalitySensitiveHashFunctionFamily<NumberVector>
- Direct Known Subclasses:
EuclideanHashFunctionFamily,ManhattanHashFunctionFamily
public abstract class AbstractProjectedHashFunctionFamily extends java.lang.Object implements LocalitySensitiveHashFunctionFamily<NumberVector>
Abstract base class for projection based hash functions.- Since:
- 0.6.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractProjectedHashFunctionFamily.ParParameterization class.
-
Field Summary
Fields Modifier and Type Field Description protected intkThe number of projections to use for each hash function.protected RandomProjectionFamilyprojProjection family to use.protected RandomFactoryrandomRandom generator to use.protected doublewidthWidth of each bin.
-
Constructor Summary
Constructors Constructor Description AbstractProjectedHashFunctionFamily(RandomFactory random, RandomProjectionFamily proj, double width, int k)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.ArrayList<? extends LocalitySensitiveHashFunction<? super NumberVector>>generateHashFunctions(Relation<? extends NumberVector> relation, int l)Generate hash functions for the given relation.TypeInformationgetInputTypeRestriction()Get the input type information.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.index.lsh.hashfamilies.LocalitySensitiveHashFunctionFamily
isCompatible
-
-
-
-
Field Detail
-
random
protected RandomFactory random
Random generator to use.
-
proj
protected RandomProjectionFamily proj
Projection family to use.
-
width
protected double width
Width of each bin.
-
k
protected int k
The number of projections to use for each hash function.
-
-
Constructor Detail
-
AbstractProjectedHashFunctionFamily
public AbstractProjectedHashFunctionFamily(RandomFactory random, RandomProjectionFamily proj, double width, int k)
Constructor.- Parameters:
random- Random generatorproj- Projection familywidth- Bin widthk- Number of projections for each hash function.
-
-
Method Detail
-
generateHashFunctions
public java.util.ArrayList<? extends LocalitySensitiveHashFunction<? super NumberVector>> generateHashFunctions(Relation<? extends NumberVector> relation, int l)
Description copied from interface:LocalitySensitiveHashFunctionFamilyGenerate hash functions for the given relation.- Specified by:
generateHashFunctionsin interfaceLocalitySensitiveHashFunctionFamily<NumberVector>- Parameters:
relation- Relation to indexl- Number of hash tables to use- Returns:
- Family of hash functions
-
getInputTypeRestriction
public TypeInformation getInputTypeRestriction()
Description copied from interface:LocalitySensitiveHashFunctionFamilyGet the input type information.- Specified by:
getInputTypeRestrictionin interfaceLocalitySensitiveHashFunctionFamily<NumberVector>- Returns:
- Input type information.
-
-