I've used ibis::bitvector::setBit() to set individual bits in a (compressed) 
bitvector, but I'd like to build a bitvector corresponding to a set of 
continuous ranges.  Is there a convenient way to do this already?  I was 
thinking of creating a bitvector for each continuous range and OR-ing them 
together as follows:

ibis::bitvector mask;

int intervals = 10000;
int min_span = 100;
int max_span = 10000 - min_span;
int max=100000000;

for (int i=0; i<intervals; i++) {
    int from = rand() % max;
    int length = rand() % max_span + min_span;
ibis::bitvector bv(from,from+length); // the constructor I'm looking for
mask |= bv;
}

In practice, the list of intervals could be sorted by start position and would 
usually be non-overlapping.  Would this make the OR-ing faster?

Andrew
_______________________________________________
FastBit-users mailing list
[email protected]
https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users

Reply via email to