473,385 Members | 1,555 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Wanted: mutable bitmap

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
3 1254
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Gordon Airport | last post by:
Has anyone suggested introducing a mutable string type (yes, of course) and distinguishing them from standard strings by the quote type - single or double? As far as I know ' and " are currently...
50
by: Dan Perl | last post by:
There is something with initializing mutable class attributes that I am struggling with. I'll use an example to explain: class Father: attr1=None # this is OK attr2= # this is wrong...
18
by: Markus.Elfring | last post by:
The C++ language specification provides the key word "mutable" that is not available in the C99 standard. Will it be imported to reduce any incompatibilities?...
12
by: Kjetil Kristoffer Solberg | last post by:
What is a mutable struct? regards Kjetil Kristoffer Solberg
12
by: Water Cooler v2 | last post by:
Are JavaScript strings mutable? How're they implemented - 1. char arrays 2. linked lists of char arrays 3. another data structure I see that the + operator is overloaded for the string class...
12
by: Vincent RICHOMME | last post by:
Hi, I am currently implementing some basic classes from .NET into modern C++. And I would like to know if someone would know a non mutable string class.
1
by: Let_Me_Be | last post by:
Hi, I'm kinda worndering how the mutable keyword works. Because of speed, I added value caching into my base class, and the only posible way to implement this seemed to be adding the mutable...
2
by: subramanian100in | last post by:
I am reading David Musser's "STL Tutorial and Reference Guide" Second Edition. In that book, on pages 68-69, definition has been given that "an iterator can be mutable or constant depending on...
24
by: Steven D'Aprano | last post by:
Sometimes it seems that barely a day goes by without some newbie, or not- so-newbie, getting confused by the behaviour of functions with mutable default arguments. No sooner does one thread...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.