annotate tabdump.cpp @ 755:37c2b9cce23a multiprobeLSH

Adding mkc_lsh_update branch, trunk candidate with improved LSH: merged trunk 1095 and branch multiprobe_lsh
author mas01mc
date Thu, 25 Nov 2010 13:42:40 +0000
parents 1e6cc843563a
children
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@561 28 printf("*** LSH DISK ***\n");
mas01mc@560 29 lsh->dump_disk_row(argv[1], n);
mas01mc@561 30 printf("*** LSH CORE (ARRAY) ***\n");
mas01mc@560 31 lsh->dump_core_row(n);
mas01mc@560 32 }
mas01mc@560 33 return 0;
mas01mc@560 34 }