Fixed r value initialization bdz and bdz_ph.
This commit is contained in:
parent
7cbf88d680
commit
5ba74165d8
@ -280,6 +280,7 @@ cmph_t *bdz_new(cmph_config_t *mph, double c)
|
|||||||
DEBUGP("c: %f\n", c);
|
DEBUGP("c: %f\n", c);
|
||||||
bdz->m = mph->key_source->nkeys;
|
bdz->m = mph->key_source->nkeys;
|
||||||
bdz->r = ceil((c * mph->key_source->nkeys)/3);
|
bdz->r = ceil((c * mph->key_source->nkeys)/3);
|
||||||
|
if ((bdz->r % 2) == 0) bdz->r+=1;
|
||||||
bdz->n = 3*bdz->r;
|
bdz->n = 3*bdz->r;
|
||||||
|
|
||||||
bdz->k = (1 << bdz->b);
|
bdz->k = (1 << bdz->b);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "bdz_ph.h"
|
#include "bdz_ph.h"
|
||||||
#include "cmph_structs.h"
|
#include "cmph_structs.h"
|
||||||
#include "bdz_structs_ph.h"
|
#include "bdz_structs_ph.h"
|
||||||
#include "hash.h"
|
#include "hash.h"
|
||||||
@ -253,6 +253,7 @@ cmph_t *bdz_ph_new(cmph_config_t *mph, double c)
|
|||||||
DEBUGP("c: %f\n", c);
|
DEBUGP("c: %f\n", c);
|
||||||
bdz_ph->m = mph->key_source->nkeys;
|
bdz_ph->m = mph->key_source->nkeys;
|
||||||
bdz_ph->r = ceil((c * mph->key_source->nkeys)/3);
|
bdz_ph->r = ceil((c * mph->key_source->nkeys)/3);
|
||||||
|
if ((bdz_ph->r % 2) == 0) bdz_ph->r += 1;
|
||||||
bdz_ph->n = 3*bdz_ph->r;
|
bdz_ph->n = 3*bdz_ph->r;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user