|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.obsearch.index.ghs.CompressedBitSet64
public class CompressedBitSet64
CompressedBitSet64 stores bits in a byte array. The bit set must be first created (stored in a temporary file) And then the bytes will be loaded into memory. The compressed bit set works on longs and it allows sequential k-nn searches of longs with the hamming distance. Insertions must be done in ascending order. The main assumption is that compression will allow small indexes that will be stored in memory.
| Field Summary | |
|---|---|
protected int |
count
|
protected byte[] |
data
|
protected long |
first
|
| Constructor Summary | |
|---|---|
CompressedBitSet64()
Create a new compressed bit set. |
|
| Method Summary | |
|---|---|
void |
add(long bit)
Add the ith bit to this bitset. |
int |
bucketDistance(long a,
long b)
Hamming distance used for searching. |
void |
commit()
We will stop adding values and now we will use the bit set for search. |
protected long[] |
getAll()
Return all the buckets just for debugging purposes. |
long |
getBytesSize()
|
protected long |
read(it.unimi.dsi.io.InputBitStream in)
|
long[] |
searchBuckets(long query,
int maxF,
int m)
Search the maxF closest buckets by hamming distance for the given query |
List<OBResultInvertedByte<Long>> |
searchFull(long query)
Search the entire bitset. |
int |
size()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected byte[] data
protected int count
protected long first
| Constructor Detail |
|---|
public CompressedBitSet64()
throws OBException
IOException
OBException| Method Detail |
|---|
public void add(long bit)
throws OBException
bit -
OBException
public void commit()
throws OBException
OBExceptionpublic long getBytesSize()
public final int bucketDistance(long a,
long b)
a - b -
public long[] searchBuckets(long query,
int maxF,
int m)
throws OBException
query - The query we will usemaxF - The number of objects that will be searched.m - the number of bits == max distance expected.
InstantiationException
IllegalAccessException
OBException
public List<OBResultInvertedByte<Long>> searchFull(long query)
throws OBException
query - query to search
OBExceptionpublic int size()
protected long[] getAll()
throws IOException
IOException
protected long read(it.unimi.dsi.io.InputBitStream in)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||