Search in sources :

Example 6 with FingerPrint

use of il.technion.tinytable.hash.FingerPrint in project narchy by automenta.

the class TinyTable method remove.

private boolean remove(FingerPrint fpaux) {
    int m = moveToEnd(fpaux);
    if (m < 0)
        return false;
    this.removeAndShrink(fpaux.bucketId);
    removeItemFromIndex(fpaux);
    int bucket;
    int il = this.I0.length;
    for (int i = fpaux.bucketId + 1; i < fpaux.bucketId + il; i++) {
        bucket = (i) % il;
        if (A[bucket] > 0) {
            removeAndShrink(bucket);
            A[bucket]--;
        } else {
            break;
        }
    }
    return true;
}
Also used : FingerPrint(il.technion.tinytable.hash.FingerPrint)

Example 7 with FingerPrint

use of il.technion.tinytable.hash.FingerPrint in project narchy by automenta.

the class TinyTable method removeItemFromIndex.

void removeItemFromIndex(FingerPrint fpaux) {
    int chainSize = RankIndexing.getChainAndUpdateOffsets(fpaux, I0, IStar, this.offsets, this.chain, fpaux.chainId) - 1;
    RankIndexing.RemoveItem(fpaux.chainId, I0, IStar, fpaux.bucketId, offsets, chain, chainSize);
}
Also used : FingerPrint(il.technion.tinytable.hash.FingerPrint)

Example 8 with FingerPrint

use of il.technion.tinytable.hash.FingerPrint in project narchy by automenta.

the class RankIndexingTechnqiueUnitTest method TestAdd.

@Test
public void TestAdd() {
    long[] I0 = new long[1];
    long[] IStar = new long[1];
    byte[] offsets = new byte[64];
    byte[] chain = new byte[64];
    FingerPrint fpaux = new FingerPrint(0, 4, 1);
    RankIndexing.addItem(fpaux, I0, IStar, offsets, chain);
    assertTrue(RankIndexing.chainExist(I0[0], 4));
    fpaux = new FingerPrint(fpaux.bucketId, 5, /* chain */
    fpaux.fingerprint);
    RankIndexing.addItem(fpaux, I0, IStar, offsets, chain);
    assertTrue(RankIndexing.chainExist(I0[0], fpaux.chainId));
    RankIndexing.getChainAndUpdateOffsets(fpaux, I0, IStar, offsets, chain);
    assertTrue(chain[0] == 1);
    fpaux = new FingerPrint(fpaux.bucketId, 4, /* chain */
    fpaux.fingerprint);
    RankIndexing.getChainAndUpdateOffsets(fpaux, I0, IStar, offsets, chain);
    assertTrue(chain[0] == 0);
}
Also used : FingerPrint(il.technion.tinytable.hash.FingerPrint) Test(org.junit.jupiter.api.Test)

Aggregations

FingerPrint (il.technion.tinytable.hash.FingerPrint)8 Test (org.junit.jupiter.api.Test)2 IntArrayList (org.eclipse.collections.impl.list.mutable.primitive.IntArrayList)1