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 class
AbstractProjectedHashFunctionFamily.Par
Parameterization class.
-
Field Summary
Fields Modifier and Type Field Description protected int
k
The number of projections to use for each hash function.protected RandomProjectionFamily
proj
Projection family to use.protected RandomFactory
random
Random generator to use.protected double
width
Width 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.TypeInformation
getInputTypeRestriction()
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:LocalitySensitiveHashFunctionFamily
Generate hash functions for the given relation.- Specified by:
generateHashFunctions
in 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:LocalitySensitiveHashFunctionFamily
Get the input type information.- Specified by:
getInputTypeRestriction
in interfaceLocalitySensitiveHashFunctionFamily<NumberVector>
- Returns:
- Input type information.
-
-