Example #1
0
        public unsafe void PullIndex()
        {
            var blockSize = 50;
            var pull      = new Pull <int>(blockSize);

            for (int i = 0; i < 100; i++)
            {
                var index = Pull.GetHIndex(i, blockSize, out var block, out var blockIndex);
                Helper.OneToTwoShift(index, out var left, out var right);
                Debug.WriteLine($"pull index {i} = {index} left {left} right {right}");
                pull.SetValue(index, i);
            }

            for (int i = 0; i < 100; i++)
            {
                Pull.GetHIndex(i, blockSize, out var block, out var blockIndex);
                Assert.AreEqual(i, pull.GetValue(block, blockIndex));
            }
        }