public void EnumeratorSkipsBeyondLastBucket() { // compression var compressedBuffer1 = new EliasFanoList(_postingList.Last(), _postingList.Count, _postingList); // get enumerator and skip var enumerator = compressedBuffer1.GetEnumerator() as ISkippingEnumerator <uint>; Assert.AreEqual(false, enumerator.SkipToBoundary(50000000)); }
public void EnumeratorSkipsToLastItem() { // compression var compressedBuffer1 = new EliasFanoList(_postingList.Last(), _postingList.Count, _postingList); // get enumerator and skip var enumerator = compressedBuffer1.GetEnumerator() as ISkippingEnumerator <uint>; Assert.AreEqual(true, enumerator.SkipToBoundary(25070429)); Assert.AreEqual(25070429U, enumerator.Current); }
public void EnumeratorSkipsToSecondPointerIndex() { // compression var data = Enumerable.Range(0, 4096).Select(i => (uint)i).ToList(); var compressedBuffer1 = new EliasFanoList(data); // get enumerator and skip var enumerator = compressedBuffer1.GetEnumerator() as ISkippingEnumerator <uint>; Assert.AreEqual(true, enumerator.SkipToIndex(2048)); Assert.AreEqual(2048U, enumerator.Current); Assert.AreEqual(true, enumerator.MoveNext()); Assert.AreEqual(2049U, enumerator.Current); }
public void EnumeratorSkipsByIndex() { // compression var compressedBuffer1 = new EliasFanoList(_postingList.Last(), _postingList.Count, _postingList); // get enumerator and skip var enumerator = compressedBuffer1.GetEnumerator() as ISkippingEnumerator <uint>; Assert.AreEqual(true, enumerator.SkipToIndex(10)); Assert.AreEqual(587702U, enumerator.Current); Assert.AreEqual(true, enumerator.MoveNext()); Assert.AreEqual(587882U, enumerator.Current); Assert.AreEqual(true, enumerator.MoveNext()); Assert.AreEqual(588062U, enumerator.Current); Assert.AreEqual(true, enumerator.MoveNext()); Assert.AreEqual(588242U, enumerator.Current); Assert.AreEqual(true, enumerator.MoveNext()); Assert.AreEqual(588422U, enumerator.Current); }
public void EnumeratorSkipsBeyondBoundary() { // compression var compressedBuffer1 = new EliasFanoList(_postingList.Last(), _postingList.Count, _postingList); // get enumerator and skip var enumerator = compressedBuffer1.GetEnumerator() as ISkippingEnumerator <uint>; Assert.AreEqual(true, enumerator.SkipToBoundary(595621)); Assert.AreEqual(595622U, enumerator.Current); Assert.AreEqual(true, enumerator.MoveNext()); Assert.AreEqual(595802U, enumerator.Current); Assert.AreEqual(true, enumerator.MoveNext()); Assert.AreEqual(595982U, enumerator.Current); Assert.AreEqual(true, enumerator.MoveNext()); Assert.AreEqual(596162U, enumerator.Current); Assert.AreEqual(true, enumerator.MoveNext()); Assert.AreEqual(596342U, enumerator.Current); Assert.AreEqual(true, enumerator.MoveNext()); Assert.AreEqual(596522U, enumerator.Current); }