tools/scan.cpp File Reference

Linear scan dataset and construct benchmark. More...

#include <boost/program_options.hpp>
#include <boost/progress.hpp>
#include <boost/format.hpp>
#include <boost/timer.hpp>
#include <lshkit.h>


int main (int argc, char *argv[])


const char * help = "This program searches for K-NNs by linear scan and generate a benchmark file."

Detailed Description

Linear scan dataset and construct benchmark.

This program randomly picks Q points from a dataset as queries, and then linear-scan the database to find K-NN/R-NN for each query to produce a benchmark file. For each query, the query point itself is excluded from the K-NN/R-NN list.

You can specify both K and R and the prorgram will search for the K points closest to queries which are within distance range of R. If K = 0, then all points within distance range of R are returned. The default value of R is the maximal value of float.

Allowed options:
  -h [ --help ]          produce help message.
  -Q [ -- ] arg (=1)     number of queries to sample.
  -K [ -- ] arg (=1)     number of nearest neighbors.
  --metric arg (=2)      1: L1; 2: L2
  -D [ --data ] arg      dataset path
  -B [ --benchmark ] arg output benchmark file path

Get LSHKIT at Fast, secure and Free Open Source software downloads doxygen