Wanted: mutable bitmap

T

Tom Anderson

Hello!

One thing that would be rather useful in various bits of programming i've
done would be a mutable bitmap type. Basically, this would behave like a
set, where the items were constrained to be positive integers (perhaps
less than some limit set at construction time). The advantage over a set
would be performance (both time- and space-wise), pure and simple - this
object would be an optimisation tool. However, the performance it delivers
is pretty much essential for implementing things like Bloom filters, the
sieve of Eratosthenes, and other computer science staples.

Am i right in thinking there's no such thing in the standard library? Is
there an implementation out there somewhere else? Is there a hack for
doing it with the stuff that is in the standard library?

tom
 
P

Paul Rubin

Tom Anderson said:
One thing that would be rather useful in various bits of programming
i've done would be a mutable bitmap type.
Am i right in thinking there's no such thing in the standard library?
Is there an implementation out there somewhere else? Is there a hack
for doing it with the stuff that is in the standard library?

The obvious way is with the array module.
 
T

Tom Anderson

The obvious way is with the array module.

*bangs head against keyboard*

i've had a niggling feeling i should be paying more attention to that
module for months now. yes, it would be very simple to implement a
bitset on top of an array of integers. doh.

tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,152
Latest member
LorettaGur
Top