Horst Schirmeier 6300a2b364 util: SumTree implementation
The SumTree implements an efficient tree data structure for
"roulette-wheel" sampling, or "sampling with fault expansion", i.e.,
sampling of trace entries / pilots without replacement and with a
picking probability proportional to the entries' sizes.

For every sample, the naive approach picks a random number between 0
and the sum of all entry sizes minus one.  It then iterates over all
entries and sums their sizes until the sum exceeds the random number.
The current entry gets picked.  The main disadvantage is the linear
complexity, which gets unpleasant for millions of entries.

The core idea behind the SumTree implementation is to maintain the
size sum of groups of entries, kept in "buckets".  Thereby, a bucket
can be quickly jumped over.  To keep bucket sizes (and thereby linear
search times) bounded, more bucket hierarchy levels are introduced
when a defined bucket size limit is reached.

Note that the current implementation is built for a pure growth phase
(when the tree gets filled with pilots from the database), followed by
a sampling phase when the tree gets emptied.  It does not handle a
mixed add/remove case very smartly, although it should remain
functional.

Change-Id: If05e9700bc84761b5bc31006402641e7112b3a72
2014-07-03 15:42:25 +02:00
2014-06-03 12:24:49 +02:00
2014-06-03 12:24:49 +02:00
2014-07-03 15:42:25 +02:00
2014-06-03 11:47:20 +02:00

This is an import of the old danceos svn repository.  The Fail* development
started with rev 187, but this git import only contains revisions 956 and newer
due to directory structure changes.

Imported from external gitsvn checkout.
http://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html
Description
No description provided
Readme 38 MiB
Languages
C++ 45%
C 36.8%
Python 8.2%
Shell 1.7%
Makefile 1.6%
Other 6.2%