view tabdump.cpp @ 561:1e6cc843563a multiprobeLSH

Fixed error in pointID bit processing (logical ! used instead of bit-wise ~). Fixed LSH table row disk/core dump routines.
author mas01mc
date Sun, 22 Feb 2009 15:04:44 +0000
parents 11ea54a02534
children
line wrap: on
line source
#include "lshlib.h"

int main(int argc, char **argv) {

  if(argc < 2){
    cout << "Usage: " << argv[0] << " indexfile" << endl;
    exit(1);
  }

  LSH* lsh = 0;
  lsh = new LSH(argv[1], true); // Initialize empty LSH tables

  if(!lsh){
    cerr << "Cannot open " << argv[1] << endl;
    exit(1);
  }

  char buf[1024];
  int n;
  while(1){
    printf("row#");
    fflush(stdout);
    scanf("%s", &buf);
    if(strcmp("exit", buf)==0 || strcmp("quit", buf)==0){
      exit(0);
    }
    n = atoi(buf);
    printf("*** LSH DISK ***\n");
    lsh->dump_disk_row(argv[1], n);
    printf("*** LSH CORE (ARRAY) ***\n");
    lsh->dump_core_row(n);
  }
  return 0;
}