Main Page | Data Structures | File List | Data Fields | Globals

distance.h

Go to the documentation of this file.
00001 /* $Id: distance_8h-source.html,v 1.1.1.1 2004/05/19 02:44:34 jose Exp $ */ 00002 00003 struct matrix { 00004 char input[255]; /* input character */ 00005 float conversion[255][255]; /* conversion cost, in, out positions */ 00006 float insertion[255][255]; /* cost of inserting, in, out positions */ 00007 }; 00008 00009 #ifndef max 00010 #define max(a,b) ((a) >= (b) ? (a) : (b)) 00011 #endif /* max */ 00012 00013 #ifndef min 00014 #define min(a,b) ((a) <= (b) ? (a) : (b)) 00015 #endif /* min */ 00016 00017 /* claculate the edit distance, unit costs for all insertions/conversions */ 00018 int levenshtein_d(const void *d1, size_t len1, const void *d2, 00019 size_t len2); 00020 /* calculate the hamming distance */ 00021 int hamming_d(const void *d1, size_t len1, const void *d2, 00022 size_t len2); 00023 /* create a bloom filter for any piece of data */ 00024 void bloom_create(const void *data, size_t len, const void *digest, 00025 size_t digest_len); 00026 /* calculae the bloom filter distance between two digests */ 00027 double bloom_d(const void *digest1, const void *digest2, 00028 size_t digest_len); 00029 /* calculate a variable cost edit distance */ 00030 double mod_levenshtein_d(const void *d1, size_t len1, const void *d2, 00031 size_t len2, struct matrix *m);

Generated on Tue May 18 20:32:17 2004 for libdistance by doxygen 1.3.7