By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,714 Members | 750 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,714 IT Pros & Developers. It's quick & easy.

Wanted: mutable bitmap

P: n/a
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

--
Ensure a star-man is never constructed!
Sep 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Tom Anderson <tw**@urchin.earth.li> writes:
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.
Sep 17 '05 #2

P: n/a
On Sat, 17 Sep 2005, it was written:
Tom Anderson <tw**@urchin.earth.li> writes:
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.


*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

--
There is no strange thing.
Sep 17 '05 #3

P: n/a
You'd might be better off with Numarray or Scipy. Image and sparse
matrix modules are with in the package, and there is direct
functionality for PIL integration.

Numarray is better documented:
http://stsdas.stsci.edu/numarray/num...tml/index.html

Sep 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.