billhongs / compressedbitset

Automatically exported from code.google.com/p/compressedbitset
0 stars 0 forks source link

BUG REPORT #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

import org.devbrat.util.WAHBitSet;

import junit.framework.TestCase;

public class TestAnd extends TestCase {

    public void testAnd() throws Exception {
        int[] s1 = new int[] { 99, 185, 240, 250, 265, 283, 312, 457, 488, 516,
                673, 775, 809, 954, 974 };
        int[] s2 = new int[] { 97, 160, 230, 237, 253, 254, 298, 309, 330, 358,
                383, 443, 481, 523, 589, 607, 748, 775, 941, 947 };
        WAHBitSet bs1 = fromInts(s1);
        WAHBitSet bs2 = fromInts(s2);
        WAHBitSet and = bs1.and(bs2);
        // should be 775, but get 868
        assertEquals(775, and.iterator().next());
    }

    private WAHBitSet fromInts(int[] ints) {
        WAHBitSet bitSet = new WAHBitSet();
        for (int i : ints) {
            bitSet.set(i);
        }
        return bitSet;
    }

}

What version of the product are you using? On what operating system?

v0.1, windows xp sp3, jdk 6 update 6

Original issue reported on code.google.com by wuyu....@gmail.com on 3 Aug 2008 at 7:55

GoogleCodeExporter commented 9 years ago
what a pity.

i search for an replacement of jdk BitSet and hope this to be fast and consume 
less
memory.

but it ends finding slower (2X slower than BitSet even in and operation) , 
similar
memory usage and bug ...

Original comment by wuyu....@gmail.com on 3 Aug 2008 at 8:01

GoogleCodeExporter commented 9 years ago
Fixed.

Original comment by devb...@gmail.com on 25 Apr 2009 at 6:59

GoogleCodeExporter commented 9 years ago

Original comment by devb...@gmail.com on 25 Apr 2009 at 7:00