vesion 0.4. It was included the bmz8 algorithm to generate mphfs for small set of keys (at most 256 keys), the vector adpter and some bugs have been corrected.
This commit is contained in:
parent
7a64ad46b2
commit
cfbe583520
@ -1,6 +1,6 @@
|
|||||||
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
AC_INIT(Makefile.am)
|
AC_INIT(Makefile.am)
|
||||||
AM_INIT_AUTOMAKE(cmph, 0.3)
|
AM_INIT_AUTOMAKE(cmph, 0.4)
|
||||||
AM_CONFIG_HEADER(config.h)
|
AM_CONFIG_HEADER(config.h)
|
||||||
|
|
||||||
dnl Checks for programs.
|
dnl Checks for programs.
|
||||||
|
@ -16,8 +16,8 @@ libcmph_la_SOURCES = debug.h\
|
|||||||
cmph_structs.h cmph_structs.c\
|
cmph_structs.h cmph_structs.c\
|
||||||
chm.h chm_structs.h chm.c\
|
chm.h chm_structs.h chm.c\
|
||||||
bmz.h bmz_structs.h bmz.c\
|
bmz.h bmz_structs.h bmz.c\
|
||||||
bmz8.h bmz8_structs.h bmz8.c\
|
bmz8.h bmz8_structs.h bmz8.c
|
||||||
brz.h brz_structs.h brz.c
|
# brz.h brz_structs.h brz.c
|
||||||
|
|
||||||
libcmph_la_LDFLAGS = -version-info 0:0:0
|
libcmph_la_LDFLAGS = -version-info 0:0:0
|
||||||
|
|
||||||
|
32
src/cmph.c
32
src/cmph.c
@ -3,7 +3,7 @@
|
|||||||
#include "chm.h"
|
#include "chm.h"
|
||||||
#include "bmz.h"
|
#include "bmz.h"
|
||||||
#include "bmz8.h" /* included -- Fabiano */
|
#include "bmz8.h" /* included -- Fabiano */
|
||||||
#include "brz.h" /* included -- Fabiano */
|
//#include "brz.h" /* included -- Fabiano */
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@ -159,7 +159,7 @@ void cmph_config_set_algo(cmph_config_t *mph, CMPH_ALGO algo)
|
|||||||
bmz8_config_destroy(mph);
|
bmz8_config_destroy(mph);
|
||||||
break;
|
break;
|
||||||
case CMPH_BRZ:
|
case CMPH_BRZ:
|
||||||
brz_config_destroy(mph);
|
// brz_config_destroy(mph);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
@ -176,7 +176,7 @@ void cmph_config_set_algo(cmph_config_t *mph, CMPH_ALGO algo)
|
|||||||
mph->data = bmz8_config_new();
|
mph->data = bmz8_config_new();
|
||||||
break;
|
break;
|
||||||
case CMPH_BRZ:
|
case CMPH_BRZ:
|
||||||
mph->data = brz_config_new();
|
// mph->data = brz_config_new();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
@ -196,7 +196,7 @@ void cmph_config_set_tmp_dir(cmph_config_t *mph, cmph_uint8 *tmp_dir)
|
|||||||
case CMPH_BMZ8: /* included -- Fabiano */
|
case CMPH_BMZ8: /* included -- Fabiano */
|
||||||
break;
|
break;
|
||||||
case CMPH_BRZ: /* included -- Fabiano */
|
case CMPH_BRZ: /* included -- Fabiano */
|
||||||
brz_config_set_tmp_dir(mph, tmp_dir);
|
// brz_config_set_tmp_dir(mph, tmp_dir);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
@ -215,7 +215,7 @@ void cmph_config_set_memory_availability(cmph_config_t *mph, cmph_uint32 memory_
|
|||||||
case CMPH_BMZ8: /* included -- Fabiano */
|
case CMPH_BMZ8: /* included -- Fabiano */
|
||||||
break;
|
break;
|
||||||
case CMPH_BRZ: /* included -- Fabiano */
|
case CMPH_BRZ: /* included -- Fabiano */
|
||||||
brz_config_set_memory_availability(mph, memory_availability);
|
// brz_config_set_memory_availability(mph, memory_availability);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
@ -238,7 +238,7 @@ void cmph_config_destroy(cmph_config_t *mph)
|
|||||||
bmz8_config_destroy(mph);
|
bmz8_config_destroy(mph);
|
||||||
break;
|
break;
|
||||||
case CMPH_BRZ: /* included -- Fabiano */
|
case CMPH_BRZ: /* included -- Fabiano */
|
||||||
brz_config_destroy(mph);
|
// brz_config_destroy(mph);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
@ -265,7 +265,7 @@ void cmph_config_set_hashfuncs(cmph_config_t *mph, CMPH_HASH *hashfuncs)
|
|||||||
bmz8_config_set_hashfuncs(mph, hashfuncs);
|
bmz8_config_set_hashfuncs(mph, hashfuncs);
|
||||||
break;
|
break;
|
||||||
case CMPH_BRZ: /* included -- Fabiano */
|
case CMPH_BRZ: /* included -- Fabiano */
|
||||||
brz_config_set_hashfuncs(mph, hashfuncs);
|
// brz_config_set_hashfuncs(mph, hashfuncs);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -302,9 +302,9 @@ cmph_t *cmph_new(cmph_config_t *mph)
|
|||||||
mphf = bmz8_new(mph, c);
|
mphf = bmz8_new(mph, c);
|
||||||
break;
|
break;
|
||||||
case CMPH_BRZ: /* included -- Fabiano */
|
case CMPH_BRZ: /* included -- Fabiano */
|
||||||
DEBUGP("Creating brz hash\n");
|
/* DEBUGP("Creating brz hash\n");
|
||||||
if (c == 0) c = 1.15;
|
if (c == 0) c = 1.15;
|
||||||
mphf = brz_new(mph, c);
|
mphf = brz_new(mph, c);*/
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
@ -323,7 +323,8 @@ int cmph_dump(cmph_t *mphf, FILE *f)
|
|||||||
case CMPH_BMZ8: /* included -- Fabiano */
|
case CMPH_BMZ8: /* included -- Fabiano */
|
||||||
return bmz8_dump(mphf, f);
|
return bmz8_dump(mphf, f);
|
||||||
case CMPH_BRZ: /* included -- Fabiano */
|
case CMPH_BRZ: /* included -- Fabiano */
|
||||||
return brz_dump(mphf, f);
|
break;
|
||||||
|
/* return brz_dump(mphf, f);*/
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
@ -352,8 +353,8 @@ cmph_t *cmph_load(FILE *f)
|
|||||||
bmz8_load(f, mphf);
|
bmz8_load(f, mphf);
|
||||||
break;
|
break;
|
||||||
case CMPH_BRZ: /* included -- Fabiano */
|
case CMPH_BRZ: /* included -- Fabiano */
|
||||||
DEBUGP("Loading brz algorithm dependent parts\n");
|
/* DEBUGP("Loading brz algorithm dependent parts\n");
|
||||||
brz_load(f, mphf);
|
brz_load(f, mphf);*/
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
@ -377,8 +378,9 @@ cmph_uint32 cmph_search(cmph_t *mphf, const char *key, cmph_uint32 keylen)
|
|||||||
DEBUGP("bmz8 algorithm search\n");
|
DEBUGP("bmz8 algorithm search\n");
|
||||||
return bmz8_search(mphf, key, keylen);
|
return bmz8_search(mphf, key, keylen);
|
||||||
case CMPH_BRZ: /* included -- Fabiano */
|
case CMPH_BRZ: /* included -- Fabiano */
|
||||||
DEBUGP("brz algorithm search\n");
|
break;
|
||||||
return brz_search(mphf, key, keylen);
|
/* DEBUGP("brz algorithm search\n");
|
||||||
|
return brz_search(mphf, key, keylen);*/
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
@ -405,7 +407,7 @@ void cmph_destroy(cmph_t *mphf)
|
|||||||
bmz8_destroy(mphf);
|
bmz8_destroy(mphf);
|
||||||
return;
|
return;
|
||||||
case CMPH_BRZ: /* included -- Fabiano */
|
case CMPH_BRZ: /* included -- Fabiano */
|
||||||
brz_destroy(mphf);
|
/* brz_destroy(mphf);*/
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
|
@ -143,9 +143,9 @@ int main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!valid)
|
if (!valid || mph_algo == CMPH_BRZ)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Invalid mph algorithm: %s\n", optarg);
|
fprintf(stderr, "Invalid mph algorithm: %s. It is not available in version %s\n", optarg, VERSION);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user