The bit-twiddling tag has no wiki summary.
3
votes
1answer
220 views
Connect Four: Bitboard checking algorithm
I'm rather new to Clojure and so I decided to program a Connect Four for fun and learning.
The code below is a Clojure implementation of this bitboard algorithm.
The whole code can be found here: ...
1
vote
1answer
99 views
What specific optimizations can be made to this BitArray class, and how can they be implemented?
Here is the current code for the BitArray class needing optimization (implemented on big integers):
import itertools
################################################################################
...
3
votes
4answers
288 views
Counting the number of bits of a positive integer
How can I improve this code for counting the number of bits of a positive integer n in Python?
def bitcount(n):
a = 1
while 1<<a <= n:
a <<= 1
s = 0
while ...
2
votes
1answer
243 views
BitVector Class: Performance
Lately, I've been reading up on the Common Language Infrastructure's data formats. As a result, one thing it mentioned is some of the data is stored in a BitVector.
I hadn't ever used a BitVector ...
4
votes
1answer
257 views
Jon Bentley's bitmap sort implementation
I've implemented Jon Bentley's bitmap sorting algorithm from Column 1 of his Programming Pearls book. This code supports user-defined integer range (works from Integer.MIN_VALUE to Integer.MAX_VALUE), ...
13
votes
9answers
2k views
Copying 80 bytes as fast as possible
I am running a math-oriented computation that spends a significant amount of its time doing memcpy, always copying 80 bytes from one location to the next, an array of 20 32-bit ints. The total ...