Some comments.

This commit is contained in:
Davi Reis 2012-03-19 22:48:11 -03:00
parent b47f367db0
commit e760465fca
2 changed files with 11 additions and 1 deletions

View File

@ -67,6 +67,8 @@ static uint32_t nextpoweroftwo(uint32_t k) {
// http://graphics.stanford.edu/~seander/bithacks.html#ZeroInWord // http://graphics.stanford.edu/~seander/bithacks.html#ZeroInWord
// Fast a % (k*2^t) // Fast a % (k*2^t)
// http://www.azillionmonkeys.com/qed/adiv.html // http://www.azillionmonkeys.com/qed/adiv.html
// rank and select:
// http://vigna.dsi.unimi.it/ftp/papers/Broadword.pdf
} // namespace cxxmph } // namespace cxxmph

View File

@ -15,6 +15,10 @@
// traditional hash function over a key and doing 2-3 conflict resolutions on // traditional hash function over a key and doing 2-3 conflict resolutions on
// 100byte-ish strings. // 100byte-ish strings.
// //
// Thesis presenting this and similar algorithms:
// http://homepages.dcc.ufmg.br/~fbotelho/en/talks/thesis2008/thesis.pdf
//
//
// Notes: // Notes:
// //
// Most users can use the SimpleMPHIndex wrapper instead of the MPHIndex which // Most users can use the SimpleMPHIndex wrapper instead of the MPHIndex which
@ -80,7 +84,11 @@ class MPHIndex {
uint32_t Rank(uint32_t vertex) const; uint32_t Rank(uint32_t vertex) const;
// Algorithm parameters // Algorithm parameters
double c_; // Number of bits per key (? is it right) // Perfect hash function density. If this was a 2graph,
// then probability of having an acyclic graph would be
// sqrt(1-(2/c)^2). See section 3 for details.
// http://www.it-c.dk/people/pagh/papers/simpleperf.pdf
double c_;
uint8_t b_; // Number of bits of the kth index in the ranktable uint8_t b_; // Number of bits of the kth index in the ranktable
// Values used during generation // Values used during generation