Hi John,
I hope all is going well! I'm playing around with the ibis::bitvector API
and I'm seeing some peculiar behavior. I'm trying to AND two bitmaps of
different sizes together.... The first bitmap looks as follows:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-----------------------------------------------------------
This bitvector stores 0 bits of a 1-bit (1 set) sequence in a 0-word array
and one bit in the active word
0 1 1 2 2 3
0123456789012345678901234567890
-------------------------------
40000000 1
-----------------------------------------------------------
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
It has one set bit, and that is the zeroth bit in the bitmap. It is
basically one 32 bit literal.
I want to And it with the following bitmap which is 326 bits long which is
basically all 1's.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This bitvector stores 310 bits of a 326-bit (326 set) sequence in a 1-word
array and 16 bits in the active word
0 1 1 2 2 3
0123456789012345678901234567890
-------------------------------
0 c000000a 310*1
7fff8000 1111111111111111
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Now, the first bitmap, should match with the first bit of the second bitmap
(so, basically the first bitmap should be seen as 326 bits long...with the
first bit being set to 1, and the rest zeros). So when I AND the two
together, I want the result to be a bitvector with the first bit set to
one, and the following 325 bits all set to zero.
But what I'm seeing is the following result:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This bitvector stores 310 bits of a 326-bit (1 set) sequence in a 1-word
array and 16 bits in the active word
0 1 1 2 2 3
0123456789012345678901234567890
-------------------------------
0 8000000a 310*0
40000000 1000000000000000
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Which has 310 0's before the one bit is set.... I'm using the &= operator
to do operation. so it goes smallBitmap &= bigBitmap.
Is there an easy way to get the answer I am looking for? Or am I using the
bitvectors incorrectly?
Best Regards,
Teryl
_______________________________________________
FastBit-users mailing list
[email protected]
https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users