Package generic.lsh.vector
Class LSHCosineVectorAccum
- java.lang.Object
-
- generic.lsh.vector.LSHCosineVector
-
- generic.lsh.vector.LSHCosineVectorAccum
-
- All Implemented Interfaces:
LSHVector
public class LSHCosineVectorAccum extends LSHCosineVector
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 Modifier and Type Class Description static classLSHCosineVectorAccum.Entry
-
Constructor Summary
Constructors Constructor Description LSHCosineVectorAccum()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHash(int h, double w)doublecompare(LSHVector op2, VectorCompare data)voiddoFinalize()doublegetLength()intnumEntries()-
Methods inherited from class generic.lsh.vector.LSHCosineVector
calcUniqueHash, compareCounts, compareDetail, equals, getEntries, getEntry, hashCode, restoreBase64, restoreSQL, restoreXml, saveBase64, saveSQL, saveXml, setHashEntries
-
-
-
-
Method Detail
-
addHash
public void addHash(int h, double w)
-
doFinalize
public void doFinalize()
-
getLength
public double getLength()
- Specified by:
getLengthin interfaceLSHVector- Overrides:
getLengthin classLSHCosineVector
-
compare
public double compare(LSHVector op2, VectorCompare data)
- Specified by:
comparein interfaceLSHVector- Overrides:
comparein classLSHCosineVector
-
numEntries
public int numEntries()
- Specified by:
numEntriesin interfaceLSHVector- Overrides:
numEntriesin classLSHCosineVector
-
-