Git Product home page Git Product logo

compressedbitset's People

Stargazers

 avatar

Watchers

 avatar

compressedbitset's Issues

andSize() method fails when both bits sets have large number of contiguous one bits set

To reproduce this bug, run this simple test case . . . 

import junit.framework.TestCase;

import org.devbrat.util.WAHBitSet;

public class WahBitSetTest extends TestCase {

    public void testIt() {

        int maxSize = 10000;
        int bitsToSet = 100;

        WAHBitSet allOnes = new WAHBitSet();
        for (int i = 0; i < maxSize; i++) {
            allOnes.set(i);
        }

        WAHBitSet partialOnes = new WAHBitSet();
        for (int j = maxSize - bitsToSet; j < maxSize; j++) {
            partialOnes.set(j);
        }

        assertEquals(maxSize - (maxSize - bitsToSet), allOnes.andSize(partialOnes));
    }
}

The expected result of the andSize() call should be 100, but it is 38.  If you 
play around with the numbers, this will start working again when you set the 
bitsToSet variable to 69 (i.e., it breaks at 70, but works fine at 69 and 
lower.)

I realize that this project is mostly dormant, but any thoughts from the author 
or other users would be appreciated.  This is a major bug.

Original issue reported on code.google.com by [email protected] on 24 Jul 2010 at 1:34

IntArrayList

Hi,
Recently, I have tried to run your project in eclipse. However, eclipse
complains about methods from the IntArrayList. For example, you call int v
= vec.get(idx); (line 929) in WAHBitSet.java. The variable v expects the
get method to return an int type. But, in the IntArrayList class provided,
the method get returns an Object. Only getQuick() in IntArrayList returns
an int type. Are you using a different IntArrayList class? If so, where can
I get this class?

Thanks,
Cong,

Original issue reported on code.google.com by [email protected] on 9 Jul 2009 at 5:32

WAHIterator.next() yields ArrayIndexOutOfBoundsException

What steps will reproduce the problem?
1. create a compressed bitset
2. try to iterate over it using the WAHIterator

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

Please provide any additional information below.
WAHIterator.next() calls nextDoc and an ArrayIndexOutOfBoundsException gets
thrown at pos[pos_idx++];

Apparently pos has length 0, pos_idx is 0. The current word is marked as
being a non-range word, but it doesn't contain any indices?

Original issue reported on code.google.com by [email protected] on 1 Apr 2010 at 10:52

Suggestion

Please add methods to serialize the bitset to an array of bytes or ints,
this way one can initialize the bitmap from a byte or int array

Thanks


Original issue reported on code.google.com by [email protected] on 28 Jan 2008 at 2:57

moving to GitHub?

I'm thinking about exporting this project to github, or you guys don't want to. 
:)  I don't want it to seem like I'm the author of the project, though, so I'll 
wait.

Original issue reported on code.google.com by [email protected] on 20 Jun 2015 at 10:18

API enhancement

Currently it seems that API allow only a explicitly setting a bit position
value to 1. But there are occasions that this value has to be explicitly
set to zero and flip a one to zero. 

Original issue reported on code.google.com by [email protected] on 23 Dec 2009 at 4:24

BUG REPORT

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 [email protected] on 3 Aug 2008 at 7:55

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.