-
Notifications
You must be signed in to change notification settings - Fork 14
/
README
71 lines (51 loc) · 2.42 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
68
69
70
71
Relaxed Radix Balanced Trees (RRB-trees)
An immutable vector-like data structure with very good performance
characteristics for concatenation and slicing. Also provides transient
(mutable-like) variants which you can convert to and from in constant time.
+-----------+---------------+
| Operation | Eff. runtime |
+-----------+---------------+
| Lookup | O(~1) |
| Last | O(1) |
| Count | O(1) |
| Update | O(~1) |
| Append | O(~1) |
| Pop | O(~1) |
| Iteration | O(n)* |
| Concat | O(log n) |
| Slice | O(~1) |
+-----------+---------------+
* Amortised constant time – O(1) – per element.
For an explanation on how this data structure works in detail, read
http://infoscience.epfl.ch/record/169879/files/RMTrees.pdf and then my thesis:
http://hypirion.com/thesis
This library, unmodified, depends on automake tools and Boehm GC.
On OSX (at least on Mavericks, presumably also on Yosemite), you can install
automake tools and Boehm GC with Homebrew like this:
brew install boehmgc libtool
On Debian-based distros, you can install the automake tools through:
sudo apt-get install build-essential automake autoconf gnu-standards\
autoconf-doc libtool gettext autoconf-archive
and Boehm GC through:
sudo apt-get install libgc-dev libgc1c2
To build and install the library, perform the following calls:
autoreconf --install
CFLAGS='-Ofast' ./configure
make
make check ## but only if you want to
sudo make install
The `sudo make install` call should return a message which tells you where the
library has been installed (usually `/usr/local/lib`). Now, to check that the
installation went successfully, you try to compile one of the test suite
programs on its own:
cd test-suite
gcc -o testy printing_example.c -std=c11 -lrrb -lgc
./testy # should work fine, and should create the file "foo.dot"
dot -Tpng -o foo.png foo.dot # If you have `dot` installed
If this doesn't work by default, then it might be that your linker has a cache
which needs to be updated. Try `sudo ldconfig` and rerun the compilation step.
If you want to uninstall the library, do `sudo make uninstall` in the project
root directory. (You have to ./configure it first though.)
Copyright © 2013-2014 Jean Niklas L'orange
Distributed under the MIT License (MIT). You can find a copy in the root of this
project with the name COPYING.