annotate tabdump.cpp @ 560:11ea54a02534 multiprobeLSH

Added a test program and lshlib functionality to inspect on-disk and in-core hashtable representations.
author mas01mc
date Sun, 22 Feb 2009 03:44:25 +0000
parents
children 1e6cc843563a
rev   line source
mas01mc@560 1 #include "lshlib.h"
mas01mc@560 2
mas01mc@560 3 int main(int argc, char **argv) {
mas01mc@560 4
mas01mc@560 5 if(argc < 2){
mas01mc@560 6 cout << "Usage: " << argv[0] << " indexfile" << endl;
mas01mc@560 7 exit(1);
mas01mc@560 8 }
mas01mc@560 9
mas01mc@560 10 LSH* lsh = 0;
mas01mc@560 11 lsh = new LSH(argv[1], true); // Initialize empty LSH tables
mas01mc@560 12
mas01mc@560 13 if(!lsh){
mas01mc@560 14 cerr << "Cannot open " << argv[1] << endl;
mas01mc@560 15 exit(1);
mas01mc@560 16 }
mas01mc@560 17
mas01mc@560 18 char buf[1024];
mas01mc@560 19 int n;
mas01mc@560 20 while(1){
mas01mc@560 21 printf("row#");
mas01mc@560 22 fflush(stdout);
mas01mc@560 23 scanf("%s", &buf);
mas01mc@560 24 if(strcmp("exit", buf)==0 || strcmp("quit", buf)==0){
mas01mc@560 25 exit(0);
mas01mc@560 26 }
mas01mc@560 27 n = atoi(buf);
mas01mc@560 28 printf("row=%d\n", n);
mas01mc@560 29 lsh->dump_disk_row(argv[1], n);
mas01mc@560 30 lsh->dump_core_row(n);
mas01mc@560 31 }
mas01mc@560 32 return 0;
mas01mc@560 33 }