Fixing bug 3465649. I still need to make CMPH_BRZ work for small sets.

This commit is contained in:
Fabiano C. Botelho
2013-04-17 01:19:15 -07:00
parent c1a9eb164e
commit 1b2a7cedff
5 changed files with 91 additions and 2 deletions

View File

@@ -288,6 +288,11 @@ cmph_t *bdz_new(cmph_config_t *mph, double c)
bdz->m = mph->key_source->nkeys;
bdz->r = (cmph_uint32)ceil((c * mph->key_source->nkeys)/3);
if ((bdz->r % 2) == 0) bdz->r+=1;
if (bdz->r == 1) { // workaround for small key sets
bdz->r = 3;
}
bdz->n = 3*bdz->r;
bdz->k = (1U << bdz->b);

View File

@@ -254,6 +254,11 @@ cmph_t *bdz_ph_new(cmph_config_t *mph, double c)
bdz_ph->m = mph->key_source->nkeys;
bdz_ph->r = (cmph_uint32)ceil((c * mph->key_source->nkeys)/3);
if ((bdz_ph->r % 2) == 0) bdz_ph->r += 1;
if (bdz_ph->r == 1) { // workaround for small key sets
bdz_ph->r = 3;
}
bdz_ph->n = 3*bdz_ph->r;