forked from ilanschnell/bitarray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
67 lines (45 loc) · 1.9 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
base-n.py:
Simple illustration of ASCII encoding bitarrays to bases
of 2, 4, 8, 16, 32 and 64.
bloom.py:
Demonstrates the implementation of a "Bloom filter", see:
http://en.wikipedia.org/wiki/Bloom_filter
extend_json.py:
Demonstrates how to construct a json encoder and decoder (using the
'json' standard library) which can handle extended Python data structures
containing bitarrays.
gene.py:
Shows how gene sequences (ATGC) can be very easily and efficiently
represented by bitarrays.
growth/
Things to study the bitarray growth pattern, including tests for the
current implementation.
huffman/
Directory containing a library and examples for working with Huffman
trees and codes.
lexico.py
Contains two functions, all_perm and next_perm, which are handle
lexicographical permutations of bitarrays.
mandel.py
Generates a .ppm image file of size 4000 x 3000 of the Mandelbrot set.
Despite its size, the output image file has only a size of slightly
over 1.5 Million bytes (uncompressed) because each pixel is stored in
one bit.
Requires: numba
ndarray.py
Demonstrates how to efficiently convert boolean data from a bitarray
to a numpy.ndarray of dtype bool.
Requires: numpy
pbm.py
Defines a simple class called PBM (Portable Bit Map) which allows:
- addressing pixels by their coordinates
- storing and loading .ppm (P4), which is the same as .pbm, files
sieve.py
Demonstrates the "Sieve of Eratosthenes" algorithm for finding all prime
numbers up to a specified integer.
smallints.py
A class is defined which allows efficiently storing an array of
integers represented by a specified number of bits (1 through 8).
For example, an array with 1000 5 bit integers can be created,
allowing each element in the array to take values form 0 to 31,
while the size of the object is 625 (5000/8) bytes.