示例#1
0
        public void GetZeroOnEmptySet()
        {
            BigBitSet set = new BigBitSet();

            Assert.IsFalse(set[0]);
            Assert.IsFalse(set[1]);
            Assert.IsFalse(set[ulong.MaxValue]);
        }
示例#2
0
        public void SetAndGetLastOnes()
        {
            BigBitSet set = new BigBitSet();

            for (uint k = 0; k < 16; k++)
                set[ulong.MaxValue - k] = true;

            for (uint k = 0; k < 16; k++)
                Assert.IsTrue(set[ulong.MaxValue - k]);
        }
示例#3
0
        public void SetAndGetFirstOnes()
        {
            BigBitSet set = new BigBitSet();

            for (uint k = 0; k < 16; k++)
                set[k] = true;

            for (uint k = 0; k < 16; k++)
                Assert.IsTrue(set[k]);
        }
示例#4
0
        public void SetAddMember(string key, ulong member)
        {
            BigBitSet set = (BigBitSet)this.values[key];

            if (set == null)
            {
                set = new BigBitSet();
                this.values[key] = set;
            }

            set[member] = true;
        }
示例#5
0
        public void SetOnesAndGetMiddleZeroes()
        {
            BigBitSet set = new BigBitSet();

            for (uint k = 0; k < 16; k++)
                set[ulong.MaxValue - k] = true;
            for (uint k = 0; k < 16; k++)
                set[k] = true;

            for (uint k = 0; k < 256; k++)
                Assert.IsFalse(set[(ulong)(long.MaxValue - k)]);
        }