*** empty log message ***

This commit is contained in:
fc_botelho
2009-03-18 22:08:46 +00:00
parent 79d250d152
commit a80f0de19f
4 changed files with 29 additions and 13 deletions

View File

@@ -179,7 +179,7 @@ void chd_ph_config_set_b(cmph_config_t *mph, cmph_uint32 keys_per_bucket)
{
assert(mph);
chd_ph_config_data_t *chd_ph = (chd_ph_config_data_t *)mph->data;
if(keys_per_bucket <= 1 || keys_per_bucket >= 15)
if(keys_per_bucket < 1 || keys_per_bucket >= 15)
{
keys_per_bucket = 4;
}
@@ -542,7 +542,7 @@ cmph_t *chd_ph_new(cmph_config_t *mph, double c)
if(mph->verbosity && chd_ph->keys_per_bin == 1)
{
fprintf(stderr, "space lower bound is %.3f bits per key", chd_ph_space_lower_bound(chd_ph->m, chd_ph->n));
fprintf(stderr, "space lower bound is %.3f bits per key\n", chd_ph_space_lower_bound(chd_ph->m, chd_ph->n));
}
// We allocate the working tables

View File

@@ -82,7 +82,7 @@ int main(int argc, char **argv)
cmph_io_adapter_t *source;
cmph_uint32 memory_availability = 0;
cmph_uint32 b = 0;
cmph_uint32 keys_per_bin = 0;
cmph_uint32 keys_per_bin = 1;
while (1)
{
char ch = getopt(argc, argv, "hVvgc:k:a:M:b:t:f:m:d:s:");
@@ -299,7 +299,7 @@ int main(int argc, char **argv)
return -1;
}
cmph_uint32 siz = cmph_size(mphf);
hashtable = (cmph_uint8*)malloc(siz*sizeof(cmph_uint8));
hashtable = (cmph_uint8*)calloc(siz, sizeof(cmph_uint8));
memset(hashtable, 0,(size_t) siz);
//check all keys
for (i = 0; i < source->nkeys; ++i)
@@ -313,11 +313,12 @@ int main(int argc, char **argv)
{
fprintf(stderr, "Unknown key %*s in the input.\n", buflen, buf);
ret = 1;
} else if(hashtable[h])
} else if(hashtable[h] >= keys_per_bin)
{
fprintf(stderr, "More than %u keys were mapped to bin %u\n", keys_per_bin, h);
fprintf(stderr, "Duplicated or unknown key %*s in the input\n", buflen, buf);
ret = 1;
} else hashtable[h] = 1;
} else hashtable[h]++;
if (verbosity)
{