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:
fc_botelho 2005-09-16 02:53:07 +00:00
parent b78fa91879
commit 2303517703
9 changed files with 69 additions and 69 deletions

52
INSTALL
View File

@ -1,16 +1,13 @@
Installation Instructions Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
************************* Foundation, Inc.
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004 Free This file is free documentation; the Free Software Foundation gives
Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it. unlimited permission to copy, distribute and modify it.
Basic Installation Basic Installation
================== ==================
These are generic installation instructions. These are generic installation instructions.
The `configure' shell script attempts to guess correct values for The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses various system-dependent variables used during compilation. It uses
@ -70,9 +67,9 @@ The simplest way to compile this package is:
Compilers and Options Compilers and Options
===================== =====================
Some systems require unusual options for compilation or linking that the Some systems require unusual options for compilation or linking that
`configure' script does not know about. Run `./configure --help' for the `configure' script does not know about. Run `./configure --help'
details on some of the pertinent environment variables. for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here by setting variables in the command line or in the environment. Here
@ -85,7 +82,7 @@ is an example:
Compiling For Multiple Architectures Compiling For Multiple Architectures
==================================== ====================================
You can compile the package for more than one kind of computer at the You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the supports the `VPATH' variable, such as GNU `make'. `cd' to the
@ -102,19 +99,19 @@ for another architecture.
Installation Names Installation Names
================== ==================
By default, `make install' will install the package's files in By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an `/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PREFIX'. option `--prefix=PATH'.
You can specify separate installation prefixes for You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PREFIX', the package will give `configure' the option `--exec-prefix=PATH', the package will use
use PREFIX as the prefix for installing programs and libraries. PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix. Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them. you can set and what kinds of files go in them.
@ -125,7 +122,7 @@ option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features Optional Features
================= =================
Some packages pay attention to `--enable-FEATURE' options to Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package. `configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The is something like `gnu-as' or `x' (for the X Window System). The
@ -140,11 +137,11 @@ you can use the `configure' options `--x-includes=DIR' and
Specifying the System Type Specifying the System Type
========================== ==========================
There may be some features `configure' cannot figure out automatically, There may be some features `configure' cannot figure out
but needs to determine by the type of machine the package will run on. automatically, but needs to determine by the type of machine the package
Usually, assuming the package is built to be run on the _same_ will run on. Usually, assuming the package is built to be run on the
architectures, `configure' can figure that out, but if it prints a _same_ architectures, `configure' can figure that out, but if it prints
message saying it cannot guess the machine type, give it the a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system `--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form: type, such as `sun4', or a canonical name which has the form:
@ -170,9 +167,9 @@ eventually be run) with `--host=TYPE'.
Sharing Defaults Sharing Defaults
================ ================
If you want to set default values for `configure' scripts to share, you If you want to set default values for `configure' scripts to share,
can create a site shell script called `config.site' that gives default you can create a site shell script called `config.site' that gives
values for variables like `CC', `cache_file', and `prefix'. default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then `configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the `PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script. `CONFIG_SITE' environment variable to the location of the site script.
@ -181,7 +178,7 @@ A warning: not all `configure' scripts look for a site script.
Defining Variables Defining Variables
================== ==================
Variables not defined in a site shell script can be set in the Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set variables may be lost. In order to avoid this problem, you should set
@ -195,7 +192,8 @@ overridden in the site shell script).
`configure' Invocation `configure' Invocation
====================== ======================
`configure' recognizes the following options to control how it operates. `configure' recognizes the following options to control how it
operates.
`--help' `--help'
`-h' `-h'

View File

@ -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.

View File

@ -1,7 +1,7 @@
file_adapter_ex2.o file_adapter_ex2.o: file_adapter_ex2.c ../src/cmph.h \ file_adapter_ex2.o file_adapter_ex2.o: file_adapter_ex2.c ../src/cmph.h \
/usr/include/stdlib.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/stdlib.h /usr/include/features.h /usr/include/sys/cdefs.h \
/usr/include/gnu/stubs.h \ /usr/include/gnu/stubs.h \
/usr/lib/gcc/i386-redhat-linux/3.4.2/include/stddef.h \ /usr/lib/gcc-lib/i586-suse-linux/3.3.4/include/stddef.h \
/usr/include/sys/types.h /usr/include/bits/types.h \ /usr/include/sys/types.h /usr/include/bits/types.h \
/usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
@ -11,7 +11,7 @@ file_adapter_ex2.o file_adapter_ex2.o: file_adapter_ex2.c ../src/cmph.h \
/usr/include/bits/sched.h /usr/include/alloca.h /usr/include/stdio.h \ /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/stdio.h \
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
/usr/include/bits/wchar.h /usr/include/gconv.h \ /usr/include/bits/wchar.h /usr/include/gconv.h \
/usr/lib/gcc/i386-redhat-linux/3.4.2/include/stdarg.h \ /usr/lib/gcc-lib/i586-suse-linux/3.3.4/include/stdarg.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/bits/stdio.h ../src/cmph_types.h /usr/include/bits/stdio.h ../src/cmph_types.h
@ -25,7 +25,7 @@ file_adapter_ex2.o file_adapter_ex2.o: file_adapter_ex2.c ../src/cmph.h \
/usr/include/gnu/stubs.h: /usr/include/gnu/stubs.h:
/usr/lib/gcc/i386-redhat-linux/3.4.2/include/stddef.h: /usr/lib/gcc-lib/i586-suse-linux/3.3.4/include/stddef.h:
/usr/include/sys/types.h: /usr/include/sys/types.h:
@ -69,7 +69,7 @@ file_adapter_ex2.o file_adapter_ex2.o: file_adapter_ex2.c ../src/cmph.h \
/usr/include/gconv.h: /usr/include/gconv.h:
/usr/lib/gcc/i386-redhat-linux/3.4.2/include/stdarg.h: /usr/lib/gcc-lib/i586-suse-linux/3.3.4/include/stdarg.h:
/usr/include/bits/stdio_lim.h: /usr/include/bits/stdio_lim.h:

View File

@ -1,7 +1,7 @@
vector_adapter_ex1.o vector_adapter_ex1.o: vector_adapter_ex1.c \ vector_adapter_ex1.o vector_adapter_ex1.o: vector_adapter_ex1.c \
../src/cmph.h /usr/include/stdlib.h /usr/include/features.h \ ../src/cmph.h /usr/include/stdlib.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/lib/gcc/i386-redhat-linux/3.4.2/include/stddef.h \ /usr/lib/gcc-lib/i586-suse-linux/3.3.4/include/stddef.h \
/usr/include/sys/types.h /usr/include/bits/types.h \ /usr/include/sys/types.h /usr/include/bits/types.h \
/usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
@ -11,7 +11,7 @@ vector_adapter_ex1.o vector_adapter_ex1.o: vector_adapter_ex1.c \
/usr/include/bits/sched.h /usr/include/alloca.h /usr/include/stdio.h \ /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/stdio.h \
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
/usr/include/bits/wchar.h /usr/include/gconv.h \ /usr/include/bits/wchar.h /usr/include/gconv.h \
/usr/lib/gcc/i386-redhat-linux/3.4.2/include/stdarg.h \ /usr/lib/gcc-lib/i586-suse-linux/3.3.4/include/stdarg.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/bits/stdio.h ../src/cmph_types.h /usr/include/bits/stdio.h ../src/cmph_types.h
@ -25,7 +25,7 @@ vector_adapter_ex1.o vector_adapter_ex1.o: vector_adapter_ex1.c \
/usr/include/gnu/stubs.h: /usr/include/gnu/stubs.h:
/usr/lib/gcc/i386-redhat-linux/3.4.2/include/stddef.h: /usr/lib/gcc-lib/i586-suse-linux/3.3.4/include/stddef.h:
/usr/include/sys/types.h: /usr/include/sys/types.h:
@ -69,7 +69,7 @@ vector_adapter_ex1.o vector_adapter_ex1.o: vector_adapter_ex1.c \
/usr/include/gconv.h: /usr/include/gconv.h:
/usr/lib/gcc/i386-redhat-linux/3.4.2/include/stdarg.h: /usr/lib/gcc-lib/i586-suse-linux/3.3.4/include/stdarg.h:
/usr/include/bits/stdio_lim.h: /usr/include/bits/stdio_lim.h:

View File

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.9.2 from Makefile.am. # Makefile.in generated by automake 1.9.1 from Makefile.am.
# examples/Makefile. Generated from Makefile.in by configure. # examples/Makefile. Generated from Makefile.in by configure.
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -36,8 +36,8 @@ POST_INSTALL = :
NORMAL_UNINSTALL = : NORMAL_UNINSTALL = :
PRE_UNINSTALL = : PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
build_triplet = i686-pc-linux-gnu build_triplet = i686-suse-linux
host_triplet = i686-pc-linux-gnu host_triplet = i686-suse-linux
noinst_PROGRAMS = vector_adapter_ex1$(EXEEXT) \ noinst_PROGRAMS = vector_adapter_ex1$(EXEEXT) \
file_adapter_ex2$(EXEEXT) file_adapter_ex2$(EXEEXT)
subdir = examples subdir = examples
@ -101,8 +101,8 @@ ECHO_N = -n
ECHO_T = ECHO_T =
EGREP = grep -E EGREP = grep -E
EXEEXT = EXEEXT =
F77 = g77 F77 =
FFLAGS = -g -O2 FFLAGS =
GETCONF = getconf GETCONF = getconf
INSTALL_DATA = ${INSTALL} -m 644 INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL} INSTALL_PROGRAM = ${INSTALL}
@ -127,11 +127,11 @@ RANLIB = ranlib
SET_MAKE = SET_MAKE =
SHELL = /bin/sh SHELL = /bin/sh
STRIP = strip STRIP = strip
VERSION = 0.3 VERSION = 0.4
ac_ct_AR = ar ac_ct_AR = ar
ac_ct_CC = gcc ac_ct_CC = gcc
ac_ct_CXX = g++ ac_ct_CXX = g++
ac_ct_F77 = g77 ac_ct_F77 =
ac_ct_GETCONF = getconf ac_ct_GETCONF = getconf
ac_ct_RANLIB = ranlib ac_ct_RANLIB = ranlib
ac_ct_STRIP = strip ac_ct_STRIP = strip
@ -145,18 +145,18 @@ am__quote =
am__tar = ${AMTAR} chof - "$$tardir" am__tar = ${AMTAR} chof - "$$tardir"
am__untar = ${AMTAR} xf - am__untar = ${AMTAR} xf -
bindir = ${exec_prefix}/bin bindir = ${exec_prefix}/bin
build = i686-pc-linux-gnu build = i686-suse-linux
build_alias = build_alias =
build_cpu = i686 build_cpu = i686
build_os = linux-gnu build_os = linux
build_vendor = pc build_vendor = suse
datadir = ${prefix}/share datadir = ${prefix}/share
exec_prefix = ${prefix} exec_prefix = ${prefix}
host = i686-pc-linux-gnu host = i686-suse-linux
host_alias = host_alias =
host_cpu = i686 host_cpu = i686
host_os = linux-gnu host_os = linux
host_vendor = pc host_vendor = suse
includedir = ${prefix}/include includedir = ${prefix}/include
infodir = ${prefix}/info infodir = ${prefix}/info
install_sh = /home/fbotelho/doutorado/algoritmos/cmph/install-sh install_sh = /home/fbotelho/doutorado/algoritmos/cmph/install-sh

View File

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.9.2 from Makefile.am. # Makefile.in generated by automake 1.9.1 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,

View File

@ -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

View File

@ -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);

View File

@ -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;
} }
} }