changeset 559:f6363bfdad80 multiprobeLSH

Added public lsh hashtable inspection methods.
author mas01mc
date Sat, 21 Feb 2009 21:56:57 +0000
parents 18b3d4c9e93d
children 11ea54a02534
files lshlib.cpp lshlib.h
diffstat 2 files changed, 31 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lshlib.cpp	Sat Feb 21 12:00:03 2009 +0000
+++ b/lshlib.cpp	Sat Feb 21 21:56:57 2009 +0000
@@ -1710,6 +1710,35 @@
     }
 }
 
+ void G::dump_core_row(Uns32T n){
+   if(!(n<H::N)){
+     printf("ROW OUT OF RANGE:%d (MAX:%d)\n", n, H::N);
+     return;
+   }
+   for(Uns32T j = 0 ; j < H::L ; j++ ){
+     bucket* bPtr = h[j][n];
+     if(bPtr){
+       printf("C[%d,%d]", j, n);
+#ifdef LSH_LIST_HEAD_COUNTERS
+       printf("[numBuckets=%d]",bPtr->snext.numBuckets);
+       if(bPtr->t2&LSH_CORE_ARRAY_BIT) {
+	 dump_core_hashtable_array((Uns32T*)(bPtr->next));
+       } 
+       else {
+	 dump_hashtable_row(bPtr->next);
+       }
+#else
+       dump_hashtable_row(bPtr);
+#endif
+       printf("\n");
+     }
+   }
+ }
+
+void G::dump_disk_row(Uns32T n){
+
+ }
+
  void G::dump_core_hashtable_array(Uns32T* p){
    Uns32T skip;
    Uns32T t2;
--- a/lshlib.h	Sat Feb 21 12:00:03 2009 +0000
+++ b/lshlib.h	Sat Feb 21 21:56:57 2009 +0000
@@ -393,7 +393,8 @@
   float get_mean_collision_rate(){ return (float) pointCount / bucketCount ; }
   char* get_indexName(){return indexName;}
   void dump_hashtables();
-
+  void dump_core_row(Uns32T n);
+  void dump_disk_row(Uns32T n);
 };
 
 typedef class G LSH;