Package generic.lsh.vector
Class LSHCosineVectorAccum
java.lang.Object
generic.lsh.vector.LSHCosineVector
generic.lsh.vector.LSHCosineVectorAccum
- All Implemented Interfaces:
LSHVector
A cosine vector where we can accumulate the (feature,weight) pairs over time
using the addHash method. Once either the getLength or compare methods is
called the vector becomes "finalized" and acts as an ordinary LSHCosineVector
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addHash
(int h, double w) double
compare
(LSHVector op2, VectorCompare data) void
double
int
Methods inherited from class generic.lsh.vector.LSHCosineVector
calcUniqueHash, compareCounts, compareDetail, equals, getEntries, getEntry, hashCode, restoreBase64, restoreSQL, restoreXml, saveBase64, saveSQL, saveXml, setHashEntries
-
Constructor Details
-
LSHCosineVectorAccum
public LSHCosineVectorAccum()
-
-
Method Details
-
addHash
public void addHash(int h, double w) -
doFinalize
public void doFinalize() -
getLength
public double getLength()- Specified by:
getLength
in interfaceLSHVector
- Overrides:
getLength
in classLSHCosineVector
-
compare
- Specified by:
compare
in interfaceLSHVector
- Overrides:
compare
in classLSHCosineVector
-
numEntries
public int numEntries()- Specified by:
numEntries
in interfaceLSHVector
- Overrides:
numEntries
in classLSHCosineVector
-