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
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHash(int h, double w) doublecompare(LSHVector op2, VectorCompare data) voiddoubleintMethods 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:
getLengthin interfaceLSHVector- Overrides:
getLengthin classLSHCosineVector
-
compare
- Specified by:
comparein interfaceLSHVector- Overrides:
comparein classLSHCosineVector
-
numEntries
public int numEntries()- Specified by:
numEntriesin interfaceLSHVector- Overrides:
numEntriesin classLSHCosineVector
-