comparison lshlib.h @ 514:01cb73dfcddd

Removed redundant copy in LSH hashfunction computation when #!defined USE_U_FUNCTIONS. Moved LSH macro definitions into lshlib.h
author mas01mc
date Sat, 24 Jan 2009 06:16:00 +0000
parents a30948382f56
children fdcd436d7cbd 9119f2fa3efe
comparison
equal deleted inserted replaced
513:a30948382f56 514:01cb73dfcddd
91 #define O2_SERIAL_MAGIC ('o'|'2'<<8|'l'<<16|'s'<<24) 91 #define O2_SERIAL_MAGIC ('o'|'2'<<8|'l'<<16|'s'<<24)
92 92
93 #define WRITE_UNS32(VAL, TOKENSTR) if( fwrite(VAL, sizeof(Uns32T), 1, dbFile) != 1 ){\ 93 #define WRITE_UNS32(VAL, TOKENSTR) if( fwrite(VAL, sizeof(Uns32T), 1, dbFile) != 1 ){\
94 fclose(dbFile);error("write error in serial_write_format2",TOKENSTR);} 94 fclose(dbFile);error("write error in serial_write_format2",TOKENSTR);}
95 95
96 //#define LSH_DUMP_CORE_TABLES // set to dump hashtables on load
97 //#define USE_U_FUNCTIONS // set to use partial hashfunction re-use
98
99 // Backward-compatible CORE ARRAY lsh index
100 #define LSH_CORE_ARRAY // Set to use arrays for hashtables rather than linked-lists
101 #define LSH_LIST_HEAD_COUNTERS // Enable counters in hashtable list heads
102
103 // Critical path logic
104 #if defined LSH_CORE_ARRAY && !defined LSH_LIST_HEAD_COUNTERS
105 #define LSH_LIST_HEAD_COUNTERS
106 #endif
107
108 #define LSH_CORE_ARRAY_BIT (0x80000000) // LSH_CORE_ARRAY test bit for list head
109
96 using namespace std; 110 using namespace std;
97 111
98 Uns32T get_page_logn(); 112 Uns32T get_page_logn();
99 113
100 // Disk table entry 114 // Disk table entry
204 Uns32T** r2; // random ints for hashing 218 Uns32T** r2; // random ints for hashing
205 219
206 bucket*** h; // The LSH hash tables 220 bucket*** h; // The LSH hash tables
207 221
208 bool use_u_functions; // flag to optimize computation of hashes 222 bool use_u_functions; // flag to optimize computation of hashes
223 #ifdef USE_U_FUNCTIONS
209 vector<vector<Uns32T> > uu; // Storage for m patial hash evaluations ( g_j = [u_a,u_b] ) 224 vector<vector<Uns32T> > uu; // Storage for m patial hash evaluations ( g_j = [u_a,u_b] )
210 225 #endif
211 Uns32T maxp; // highest pointID stored in database 226 Uns32T maxp; // highest pointID stored in database
212 Uns32T bucketCount; // count of number of point buckets allocated 227 Uns32T bucketCount; // count of number of point buckets allocated
213 Uns32T pointCount; // count of number of points inserted 228 Uns32T pointCount; // count of number of points inserted
214 Uns32T collisionCount; // number of points collided in a hash-table row 229 Uns32T collisionCount; // number of points collided in a hash-table row
215 230