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 class
LSHCosineVectorAccum.Entry
-
Constructor Summary
Constructors Constructor Description LSHCosineVectorAccum()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addHash(int h, double w)
double
compare(LSHVector op2, VectorCompare data)
void
doFinalize()
double
getLength()
int
numEntries()
-
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:
getLength
in interfaceLSHVector
- Overrides:
getLength
in classLSHCosineVector
-
compare
public double compare(LSHVector op2, VectorCompare data)
- Specified by:
compare
in interfaceLSHVector
- Overrides:
compare
in classLSHCosineVector
-
numEntries
public int numEntries()
- Specified by:
numEntries
in interfaceLSHVector
- Overrides:
numEntries
in classLSHCosineVector
-
-