OBJECT
- Type of object being sketchedpublic class ShortLSHSketcher<OBJECT> extends Object implements Sketcher<OBJECT,short[]>
Sketcher
that produces bit-string sketches encoded as short arrays.
Only the least-significant bit of each hash function will be appended to the
final sketch. The length of the output array will be computed such that the
bit from each hash function is contained.Constructor and Description |
---|
ShortLSHSketcher(HashFunction<OBJECT> first,
HashFunction<OBJECT>... remainder)
Construct with the given functions.
|
ShortLSHSketcher(HashFunctionFactory<OBJECT> factory,
int nFuncs)
Construct with the factory which is used to produce the required number
of functions.
|
ShortLSHSketcher(List<HashFunction<OBJECT>> functions)
Construct with the given functions.
|
Modifier and Type | Method and Description |
---|---|
int |
arrayLength()
Get the length of the output short array of packed bits.
|
int |
bitLength()
Get the length of the sketch in bits.
|
short[] |
createSketch(OBJECT input)
Create a sketch for the given object.
|
public ShortLSHSketcher(List<HashFunction<OBJECT>> functions)
functions
- the underlying hash functions.@SafeVarargs public ShortLSHSketcher(HashFunction<OBJECT> first, HashFunction<OBJECT>... remainder)
first
- the first functionremainder
- the remainder of the functionspublic ShortLSHSketcher(HashFunctionFactory<OBJECT> factory, int nFuncs)
factory
- the factory to use to produce the underlying hash functions.nFuncs
- the number of functions to create for the compositionpublic short[] createSketch(OBJECT input)
Sketcher
createSketch
in interface Sketcher<OBJECT,short[]>
input
- the object to sketchpublic int bitLength()
public int arrayLength()