master 761b7d746d66 cached
1093 files
90.4 MB
2.9M tokens
2608 symbols
1 requests
Copy disabled (too large) Download .txt
Showing preview only (11,705K chars total). Download the full file to get everything.
Repository: DBWangGroupUNSW/nns_benchmark
Branch: master
Commit: 761b7d746d66
Files: 1093
Total size: 90.4 MB

Directory structure:
gitextract_qmxghsr6/

├── .gitignore
├── README.md
├── algorithms/
│   ├── AGH/
│   │   ├── README.md
│   │   ├── preprocess/
│   │   │   ├── OneLayerAGH_Test.m
│   │   │   ├── OneLayerAGH_Train.m
│   │   │   ├── TwoLayerAGH_Test.m
│   │   │   ├── TwoLayerAGH_Train.m
│   │   │   ├── compactbit.m
│   │   │   ├── fvecs_read.m
│   │   │   ├── get_anchor.m
│   │   │   ├── hammingDist.m
│   │   │   ├── ivecs_read.m
│   │   │   ├── ivecs_write.m
│   │   │   ├── main.m
│   │   │   ├── main_OneLayer.m
│   │   │   ├── main_TwoLayer.m
│   │   │   ├── main_c_OneLayer.m~
│   │   │   ├── main_c_TwoLayer.m~
│   │   │   └── sqdist.m
│   │   ├── script/
│   │   │   └── searcher.sh
│   │   └── src/
│   │       ├── AGH.cpp
│   │       ├── AGH.h
│   │       ├── Makefile
│   │       ├── center_chooser.h
│   │       ├── char_bit_cnt.h
│   │       ├── data_util.h
│   │       ├── dynamic_bitset.h
│   │       ├── eval.h
│   │       ├── hammingDist.h
│   │       ├── heap.h
│   │       ├── hierarchical_clustering_index.h
│   │       ├── random.h
│   │       └── result_set.h
│   ├── Annoy/
│   │   ├── README.html
│   │   ├── README.md
│   │   ├── script/
│   │   │   ├── indexer.sh
│   │   │   ├── run.sh
│   │   │   └── searcher.sh
│   │   └── src/
│   │       ├── Makefile
│   │       ├── annoy.cpp
│   │       ├── data.h
│   │       ├── indexer.cpp
│   │       ├── kissrandom.h
│   │       └── searcher.cpp
│   ├── DPG/
│   │   ├── README.html
│   │   ├── README.md
│   │   ├── script/
│   │   │   ├── build_index.sh
│   │   │   └── search.sh
│   │   └── src/
│   │       ├── DPG_diverse.cpp
│   │       ├── DPG_index.cpp
│   │       ├── DPG_search.cpp
│   │       ├── Makefile
│   │       ├── RandGen.cpp
│   │       ├── RandGen.h
│   │       ├── build.sh
│   │       ├── kgraph-data.h
│   │       ├── kgraph.cpp
│   │       ├── kgraph.h
│   │       ├── main.cpp
│   │       └── metric.cpp
│   ├── KGraph/
│   │   ├── README.html
│   │   ├── README.md
│   │   ├── script/
│   │   │   ├── kgraph_index.sh
│   │   │   └── kgraph_search.sh
│   │   └── src/
│   │       ├── Makefile
│   │       ├── RandGen.cpp
│   │       ├── RandGen.h
│   │       ├── build.sh
│   │       ├── kgraph-data.h
│   │       ├── kgraph.cpp
│   │       ├── kgraph.h
│   │       ├── kgraph_index.cpp
│   │       ├── kgraph_search.cpp
│   │       └── metric.cpp
│   ├── NMSLIB/
│   │   ├── README.md
│   │   ├── code/
│   │   │   ├── CMakeFiles/
│   │   │   │   ├── 3.2.3/
│   │   │   │   │   ├── CMakeCCompiler.cmake
│   │   │   │   │   ├── CMakeCXXCompiler.cmake
│   │   │   │   │   ├── CMakeSystem.cmake
│   │   │   │   │   ├── CompilerIdC/
│   │   │   │   │   │   └── CMakeCCompilerId.c
│   │   │   │   │   └── CompilerIdCXX/
│   │   │   │   │       └── CMakeCXXCompilerId.cpp
│   │   │   │   ├── CMakeDirectoryInformation.cmake
│   │   │   │   ├── CMakeError.log
│   │   │   │   ├── CMakeOutput.log
│   │   │   │   ├── Makefile.cmake
│   │   │   │   ├── Makefile2
│   │   │   │   ├── TargetDirectories.txt
│   │   │   │   ├── cmake.check_cache
│   │   │   │   ├── feature_tests.c
│   │   │   │   ├── feature_tests.cxx
│   │   │   │   └── progress.marks
│   │   │   ├── CMakeLists.txt
│   │   │   ├── CMakeLists.txt~
│   │   │   ├── FindEigen3.cmake
│   │   │   ├── FindGSL.cmake
│   │   │   ├── Makefile
│   │   │   ├── NonMetricSpaceLib.sln
│   │   │   ├── cmake_install.cmake
│   │   │   ├── include/
│   │   │   │   ├── cluster_util.h
│   │   │   │   ├── distcomp.h
│   │   │   │   ├── distcomp_edist.h
│   │   │   │   ├── eval_metrics.h
│   │   │   │   ├── eval_results.h
│   │   │   │   ├── experimentconf.h
│   │   │   │   ├── experiments.h
│   │   │   │   ├── factory/
│   │   │   │   │   ├── init_methods.h
│   │   │   │   │   ├── init_spaces.h
│   │   │   │   │   ├── method/
│   │   │   │   │   │   ├── bbtree.h
│   │   │   │   │   │   ├── dummy.h
│   │   │   │   │   │   ├── ghtree.h
│   │   │   │   │   │   ├── hnsw.h
│   │   │   │   │   │   ├── list_clusters.h
│   │   │   │   │   │   ├── lsh.h
│   │   │   │   │   │   ├── lsh_multiprobe.h
│   │   │   │   │   │   ├── multi_index.h
│   │   │   │   │   │   ├── multi_vantage_point_tree.h
│   │   │   │   │   │   ├── nndes.h
│   │   │   │   │   │   ├── nonmetr_list_clust.h
│   │   │   │   │   │   ├── omedrank.h
│   │   │   │   │   │   ├── perm_bin_vptree.h
│   │   │   │   │   │   ├── perm_index_incr_bin.h
│   │   │   │   │   │   ├── perm_lsh_bin.h
│   │   │   │   │   │   ├── permutation_inverted_index.h
│   │   │   │   │   │   ├── permutation_prefix_index.h
│   │   │   │   │   │   ├── pivot_neighb_invindx.h
│   │   │   │   │   │   ├── proj_vptree.h
│   │   │   │   │   │   ├── projection_index_incremental.h
│   │   │   │   │   │   ├── seqsearch.h
│   │   │   │   │   │   ├── small_world_rand.h
│   │   │   │   │   │   ├── spatial_approx_tree.h
│   │   │   │   │   │   └── vptree.h
│   │   │   │   │   └── space/
│   │   │   │   │       ├── space_bit_hamming.h
│   │   │   │   │       ├── space_bregman.h
│   │   │   │   │       ├── space_dummy.h
│   │   │   │   │       ├── space_edist.h
│   │   │   │   │       ├── space_js.h
│   │   │   │   │       ├── space_lp.h
│   │   │   │   │       ├── space_savch.h
│   │   │   │   │       ├── space_scalar.h
│   │   │   │   │       ├── space_sparse_lp.h
│   │   │   │   │       ├── space_sparse_scalar.h
│   │   │   │   │       ├── space_sqfd.h
│   │   │   │   │       └── space_word_embed.h
│   │   │   │   ├── flexbuff.h
│   │   │   │   ├── floatdiff.h
│   │   │   │   ├── global.h
│   │   │   │   ├── gold_standard.h
│   │   │   │   ├── idtype.h
│   │   │   │   ├── incremental_quick_select.h
│   │   │   │   ├── index.h
│   │   │   │   ├── init.h
│   │   │   │   ├── knnquery.h
│   │   │   │   ├── knnqueue.h
│   │   │   │   ├── logging.h
│   │   │   │   ├── memory.h
│   │   │   │   ├── meta_analysis.h
│   │   │   │   ├── method/
│   │   │   │   │   ├── bbtree.h
│   │   │   │   │   ├── dummy.h
│   │   │   │   │   ├── ghtree.h
│   │   │   │   │   ├── hnsw.h
│   │   │   │   │   ├── lcstrategy.h
│   │   │   │   │   ├── list_clusters.h
│   │   │   │   │   ├── lsh.h
│   │   │   │   │   ├── lsh_multiprobe.h
│   │   │   │   │   ├── lsh_space.h
│   │   │   │   │   ├── multi_index.h
│   │   │   │   │   ├── multi_vantage_point_tree.h
│   │   │   │   │   ├── multi_vantage_point_tree_utils.h
│   │   │   │   │   ├── nndes.h
│   │   │   │   │   ├── nonmetr_list_clust.h
│   │   │   │   │   ├── omedrank.h
│   │   │   │   │   ├── perm_bin_vptree.h
│   │   │   │   │   ├── perm_index_incr_bin.h
│   │   │   │   │   ├── perm_lsh_bin.h
│   │   │   │   │   ├── permutation_inverted_index.h
│   │   │   │   │   ├── permutation_prefix_index.h
│   │   │   │   │   ├── pivot_neighb_common.h
│   │   │   │   │   ├── pivot_neighb_invindx.h
│   │   │   │   │   ├── proj_vptree.h
│   │   │   │   │   ├── projection_index_incremental.h
│   │   │   │   │   ├── seqsearch.h
│   │   │   │   │   ├── small_world_rand.h
│   │   │   │   │   ├── small_world_rand_split.h
│   │   │   │   │   ├── spatial_approx_tree.h
│   │   │   │   │   ├── vptree.h
│   │   │   │   │   └── vptree_utils.h
│   │   │   │   ├── methodfactory.h
│   │   │   │   ├── nndes/
│   │   │   │   │   ├── nndes-common.h
│   │   │   │   │   └── nndes.h
│   │   │   │   ├── object.h
│   │   │   │   ├── params.h
│   │   │   │   ├── params_cmdline.h
│   │   │   │   ├── params_def.h
│   │   │   │   ├── permutation_type.h
│   │   │   │   ├── permutation_utils.h
│   │   │   │   ├── ported_boost_progress.h
│   │   │   │   ├── pow.h
│   │   │   │   ├── projection.h
│   │   │   │   ├── query.h
│   │   │   │   ├── query_creator.h
│   │   │   │   ├── randproj_util.h
│   │   │   │   ├── rangequery.h
│   │   │   │   ├── report.h
│   │   │   │   ├── report.h~
│   │   │   │   ├── report_intr_dim.h
│   │   │   │   ├── searchoracle.h
│   │   │   │   ├── simddebug.h
│   │   │   │   ├── simdutils.h
│   │   │   │   ├── sort_arr_bi.h
│   │   │   │   ├── space/
│   │   │   │   │   ├── space_bit_hamming.h
│   │   │   │   │   ├── space_bregman.h
│   │   │   │   │   ├── space_dummy.h
│   │   │   │   │   ├── space_js.h
│   │   │   │   │   ├── space_leven.h
│   │   │   │   │   ├── space_lp.h
│   │   │   │   │   ├── space_rank_correl.h
│   │   │   │   │   ├── space_scalar.h
│   │   │   │   │   ├── space_sparse_lp.h
│   │   │   │   │   ├── space_sparse_scalar.h
│   │   │   │   │   ├── space_sparse_scalar_fast.h
│   │   │   │   │   ├── space_sparse_vector.h
│   │   │   │   │   ├── space_sparse_vector_inter.h
│   │   │   │   │   ├── space_sqfd.h
│   │   │   │   │   ├── space_string.h
│   │   │   │   │   ├── space_vector.h
│   │   │   │   │   ├── space_vector_gen.h
│   │   │   │   │   └── space_word_embed.h
│   │   │   │   ├── space.h
│   │   │   │   ├── spacefactory.h
│   │   │   │   ├── tune.h
│   │   │   │   ├── utils.h
│   │   │   │   ├── utils.h~
│   │   │   │   └── ztimer.h
│   │   │   ├── launches/
│   │   │   │   └── sample.launch
│   │   │   ├── lshkit/
│   │   │   │   ├── CMakeFiles/
│   │   │   │   │   ├── CMakeDirectoryInformation.cmake
│   │   │   │   │   ├── lshkit.dir/
│   │   │   │   │   │   ├── CXX.includecache
│   │   │   │   │   │   ├── DependInfo.cmake
│   │   │   │   │   │   ├── build.make
│   │   │   │   │   │   ├── cmake_clean.cmake
│   │   │   │   │   │   ├── cmake_clean_target.cmake
│   │   │   │   │   │   ├── depend.internal
│   │   │   │   │   │   ├── depend.make
│   │   │   │   │   │   ├── flags.make
│   │   │   │   │   │   ├── link.txt
│   │   │   │   │   │   └── progress.make
│   │   │   │   │   └── progress.marks
│   │   │   │   ├── CMakeLists.txt
│   │   │   │   ├── Makefile
│   │   │   │   ├── cmake_install.cmake
│   │   │   │   ├── include/
│   │   │   │   │   ├── lshkit/
│   │   │   │   │   │   ├── apost.h
│   │   │   │   │   │   ├── archive.h
│   │   │   │   │   │   ├── common.h
│   │   │   │   │   │   ├── composite.h
│   │   │   │   │   │   ├── concept.h
│   │   │   │   │   │   ├── eval.h
│   │   │   │   │   │   ├── forest.h
│   │   │   │   │   │   ├── histogram.h
│   │   │   │   │   │   ├── kernel.h
│   │   │   │   │   │   ├── lsh-index.h
│   │   │   │   │   │   ├── lsh.h
│   │   │   │   │   │   ├── matrix-io.h
│   │   │   │   │   │   ├── matrix.h
│   │   │   │   │   │   ├── metric.h
│   │   │   │   │   │   ├── mplsh-model.h
│   │   │   │   │   │   ├── mplsh.h
│   │   │   │   │   │   ├── multiprobelsh-fitdata.h
│   │   │   │   │   │   ├── multiprobelsh-tune.h
│   │   │   │   │   │   ├── sketch.h
│   │   │   │   │   │   ├── spectral-hash.h
│   │   │   │   │   │   ├── topk.h
│   │   │   │   │   │   ├── tune.h
│   │   │   │   │   │   └── vq.h
│   │   │   │   │   └── lshkit.h
│   │   │   │   ├── src/
│   │   │   │   │   ├── apost.cpp
│   │   │   │   │   ├── char_bit_cnt.cpp
│   │   │   │   │   ├── kdtree.cpp
│   │   │   │   │   ├── kdtree.h
│   │   │   │   │   ├── mplsh-model.cpp
│   │   │   │   │   ├── mplsh.cpp
│   │   │   │   │   └── vq.cpp
│   │   │   │   └── tools/
│   │   │   │       ├── CMakeLists.txt
│   │   │   │       ├── apost-run.cpp
│   │   │   │       ├── dump-query.cpp
│   │   │   │       ├── embed.cpp
│   │   │   │       ├── fitdata.cpp
│   │   │   │       ├── forest-run.cpp
│   │   │   │       ├── lsh-run.cpp
│   │   │   │       ├── mplsh-predict.cpp
│   │   │   │       ├── mplsh-run.cpp
│   │   │   │       ├── mplsh-tune.cpp
│   │   │   │       ├── run-spectral.cpp
│   │   │   │       ├── scan.cpp
│   │   │   │       ├── sketch-run.cpp
│   │   │   │       └── txt2bin.cpp
│   │   │   ├── src/
│   │   │   │   ├── CMakeFiles/
│   │   │   │   │   ├── CMakeDirectoryInformation.cmake
│   │   │   │   │   ├── NonMetricSpaceLib.dir/
│   │   │   │   │   │   ├── CXX.includecache
│   │   │   │   │   │   ├── DependInfo.cmake
│   │   │   │   │   │   ├── build.make
│   │   │   │   │   │   ├── cmake_clean.cmake
│   │   │   │   │   │   ├── cmake_clean_target.cmake
│   │   │   │   │   │   ├── depend.internal
│   │   │   │   │   │   ├── depend.make
│   │   │   │   │   │   ├── flags.make
│   │   │   │   │   │   ├── link.txt
│   │   │   │   │   │   └── progress.make
│   │   │   │   │   ├── dummy_app.dir/
│   │   │   │   │   │   ├── CXX.includecache
│   │   │   │   │   │   ├── DependInfo.cmake
│   │   │   │   │   │   ├── build.make
│   │   │   │   │   │   ├── cmake_clean.cmake
│   │   │   │   │   │   ├── depend.internal
│   │   │   │   │   │   ├── depend.make
│   │   │   │   │   │   ├── flags.make
│   │   │   │   │   │   ├── link.txt
│   │   │   │   │   │   └── progress.make
│   │   │   │   │   ├── experiment.dir/
│   │   │   │   │   │   ├── CXX.includecache
│   │   │   │   │   │   ├── DependInfo.cmake
│   │   │   │   │   │   ├── build.make
│   │   │   │   │   │   ├── cmake_clean.cmake
│   │   │   │   │   │   ├── depend.internal
│   │   │   │   │   │   ├── depend.make
│   │   │   │   │   │   ├── flags.make
│   │   │   │   │   │   ├── link.txt
│   │   │   │   │   │   └── progress.make
│   │   │   │   │   ├── progress.marks
│   │   │   │   │   └── tune_vptree.dir/
│   │   │   │   │       ├── CXX.includecache
│   │   │   │   │       ├── DependInfo.cmake
│   │   │   │   │       ├── build.make
│   │   │   │   │       ├── cmake_clean.cmake
│   │   │   │   │       ├── depend.internal
│   │   │   │   │       ├── depend.make
│   │   │   │   │       ├── flags.make
│   │   │   │   │       ├── link.txt
│   │   │   │   │       └── progress.make
│   │   │   │   ├── CMakeLists.txt
│   │   │   │   ├── Makefile
│   │   │   │   ├── NonMetricSpaceLib.vcxproj
│   │   │   │   ├── NonMetricSpaceLib.vcxproj.filters
│   │   │   │   ├── cluster_util.cc
│   │   │   │   ├── cmake_install.cmake
│   │   │   │   ├── distcomp_bregman.cc
│   │   │   │   ├── distcomp_edist.cc
│   │   │   │   ├── distcomp_js.cc
│   │   │   │   ├── distcomp_lp.cc
│   │   │   │   ├── distcomp_lp.cc~
│   │   │   │   ├── distcomp_rankcorr.cc
│   │   │   │   ├── distcomp_scalar.cc
│   │   │   │   ├── distcomp_sparse_scalar_fast.cc
│   │   │   │   ├── dummy_app.cc
│   │   │   │   ├── dummy_app.vcxproj
│   │   │   │   ├── dummy_app.vcxproj.filters
│   │   │   │   ├── experiment.vcxproj
│   │   │   │   ├── experiment.vcxproj.filters
│   │   │   │   ├── experimentconf.cc
│   │   │   │   ├── global.cc
│   │   │   │   ├── init.cc
│   │   │   │   ├── knnquery.cc
│   │   │   │   ├── logging.cc
│   │   │   │   ├── main.cc
│   │   │   │   ├── main.cc~
│   │   │   │   ├── memory.cc
│   │   │   │   ├── method/
│   │   │   │   │   ├── bbtree.cc
│   │   │   │   │   ├── dummy.cc
│   │   │   │   │   ├── ghtree.cc
│   │   │   │   │   ├── hnsw.cc
│   │   │   │   │   ├── hnsw.cc~
│   │   │   │   │   ├── hnsw_distfunc_opt.cc
│   │   │   │   │   ├── hnsw_distfunc_opt.cc~
│   │   │   │   │   ├── list_clusters.cc
│   │   │   │   │   ├── lsh.cc
│   │   │   │   │   ├── lsh_multiprobe.cc
│   │   │   │   │   ├── lsh_space.cc
│   │   │   │   │   ├── multi_index.cc
│   │   │   │   │   ├── multi_vantage_point_tree.cc
│   │   │   │   │   ├── nndes.cc
│   │   │   │   │   ├── nonmetr_list_clust.cc
│   │   │   │   │   ├── omedrank.cc
│   │   │   │   │   ├── perm_bin_vptree.cc
│   │   │   │   │   ├── perm_index_incr_bin.cc
│   │   │   │   │   ├── perm_lsh_bin.cc
│   │   │   │   │   ├── permutation_inverted_index.cc
│   │   │   │   │   ├── permutation_prefix_index.cc
│   │   │   │   │   ├── pivot_neighb_invindx.cc
│   │   │   │   │   ├── proj_vptree.cc
│   │   │   │   │   ├── projection_index_incremental.cc
│   │   │   │   │   ├── seqsearch.cc
│   │   │   │   │   ├── small_world_rand.cc
│   │   │   │   │   ├── small_world_rand.cc~
│   │   │   │   │   ├── small_world_rand_split.cc
│   │   │   │   │   ├── spatial_approx_tree.cc
│   │   │   │   │   └── vptree.cc
│   │   │   │   ├── params.cc
│   │   │   │   ├── params_cmdline.cc
│   │   │   │   ├── projection.cc
│   │   │   │   ├── query.cc
│   │   │   │   ├── randproj_util.cc
│   │   │   │   ├── rangequery.cc
│   │   │   │   ├── searchoracle.cc
│   │   │   │   ├── space/
│   │   │   │   │   ├── space_bit_hamming.cc
│   │   │   │   │   ├── space_bregman.cc
│   │   │   │   │   ├── space_dummy.cc
│   │   │   │   │   ├── space_js.cc
│   │   │   │   │   ├── space_lp.cc
│   │   │   │   │   ├── space_scalar.cc
│   │   │   │   │   ├── space_sparse_lp.cc
│   │   │   │   │   ├── space_sparse_scalar_fast.cc
│   │   │   │   │   ├── space_sparse_vector.cc
│   │   │   │   │   ├── space_sparse_vector_inter.cc
│   │   │   │   │   ├── space_sqfd.cc
│   │   │   │   │   ├── space_string.cc
│   │   │   │   │   ├── space_vector.cc
│   │   │   │   │   └── space_word_embed.cc
│   │   │   │   ├── space.cc
│   │   │   │   ├── tune_vptree.cc
│   │   │   │   ├── tune_vptree.vcxproj
│   │   │   │   ├── tune_vptree.vcxproj.filters
│   │   │   │   └── utils.cc
│   │   │   └── test/
│   │   │       ├── CMakeFiles/
│   │   │       │   ├── CMakeDirectoryInformation.cmake
│   │   │       │   ├── bench_distfunc.dir/
│   │   │       │   │   ├── CXX.includecache
│   │   │       │   │   ├── DependInfo.cmake
│   │   │       │   │   ├── build.make
│   │   │       │   │   ├── cmake_clean.cmake
│   │   │       │   │   ├── depend.internal
│   │   │       │   │   ├── depend.make
│   │   │       │   │   ├── flags.make
│   │   │       │   │   ├── link.txt
│   │   │       │   │   └── progress.make
│   │   │       │   ├── bench_projection.dir/
│   │   │       │   │   ├── CXX.includecache
│   │   │       │   │   ├── DependInfo.cmake
│   │   │       │   │   ├── build.make
│   │   │       │   │   ├── cmake_clean.cmake
│   │   │       │   │   ├── depend.internal
│   │   │       │   │   ├── depend.make
│   │   │       │   │   ├── flags.make
│   │   │       │   │   ├── link.txt
│   │   │       │   │   └── progress.make
│   │   │       │   ├── bunit.dir/
│   │   │       │   │   ├── CXX.includecache
│   │   │       │   │   ├── DependInfo.cmake
│   │   │       │   │   ├── build.make
│   │   │       │   │   ├── cmake_clean.cmake
│   │   │       │   │   ├── depend.internal
│   │   │       │   │   ├── depend.make
│   │   │       │   │   ├── flags.make
│   │   │       │   │   ├── link.txt
│   │   │       │   │   └── progress.make
│   │   │       │   ├── progress.marks
│   │   │       │   ├── report_intr_dim.dir/
│   │   │       │   │   ├── CXX.includecache
│   │   │       │   │   ├── DependInfo.cmake
│   │   │       │   │   ├── build.make
│   │   │       │   │   ├── cmake_clean.cmake
│   │   │       │   │   ├── depend.internal
│   │   │       │   │   ├── depend.make
│   │   │       │   │   ├── flags.make
│   │   │       │   │   ├── link.txt
│   │   │       │   │   └── progress.make
│   │   │       │   ├── test_clust.dir/
│   │   │       │   │   ├── CXX.includecache
│   │   │       │   │   ├── DependInfo.cmake
│   │   │       │   │   ├── build.make
│   │   │       │   │   ├── cmake_clean.cmake
│   │   │       │   │   ├── depend.internal
│   │   │       │   │   ├── depend.make
│   │   │       │   │   ├── flags.make
│   │   │       │   │   ├── link.txt
│   │   │       │   │   └── progress.make
│   │   │       │   └── test_integr.dir/
│   │   │       │       ├── CXX.includecache
│   │   │       │       ├── DependInfo.cmake
│   │   │       │       ├── build.make
│   │   │       │       ├── cmake_clean.cmake
│   │   │       │       ├── depend.internal
│   │   │       │       ├── depend.make
│   │   │       │       ├── flags.make
│   │   │       │       ├── link.txt
│   │   │       │       └── progress.make
│   │   │       ├── CMakeLists.txt
│   │   │       ├── Makefile
│   │   │       ├── bench_distfunc.cc
│   │   │       ├── bench_distfunc.vcxproj
│   │   │       ├── bench_projection.cc
│   │   │       ├── bunit.cc
│   │   │       ├── bunit.h
│   │   │       ├── bunit.vcxproj
│   │   │       ├── bunit.vcxproj.filters
│   │   │       ├── bunit.vcxproj.user
│   │   │       ├── cmake_install.cmake
│   │   │       ├── genrand_vect.h
│   │   │       ├── report_intr_dim.cc
│   │   │       ├── test_clust.cc
│   │   │       ├── test_distfunc.cc
│   │   │       ├── test_editdist.cc
│   │   │       ├── test_eval.cc
│   │   │       ├── test_fp.cc
│   │   │       ├── test_integr.cc
│   │   │       ├── test_integr.vcxproj
│   │   │       ├── test_integr_util.h
│   │   │       ├── test_lpnorm.cc
│   │   │       ├── test_object.cc
│   │   │       ├── test_proj.cc
│   │   │       ├── test_space_serial.cc
│   │   │       ├── test_sqfd.cc
│   │   │       ├── test_timer.cc
│   │   │       └── testdataset.h
│   │   └── script/
│   │       ├── run_HNSW.sh
│   │       ├── run_NAPP.sh
│   │       ├── run_SW.sh
│   │       └── run_vptree.sh
│   ├── NSH/
│   │   ├── README.md
│   │   ├── preprocess/
│   │   │   ├── compactbit.m
│   │   │   ├── computeRecall.m
│   │   │   ├── distMat.m
│   │   │   ├── fvecs_read.m
│   │   │   ├── hammingDist.m
│   │   │   ├── ivecs_read.m
│   │   │   ├── ivecs_write.m
│   │   │   ├── main.m
│   │   │   ├── readme.markdown
│   │   │   ├── run_NSH.m
│   │   │   └── trainNSH.m
│   │   ├── script/
│   │   │   └── searcher.sh
│   │   └── src/
│   │       ├── Makefile
│   │       ├── NSH.cpp
│   │       ├── NSH.h
│   │       ├── center_chooser.h
│   │       ├── char_bit_cnt.h
│   │       ├── data_util.h
│   │       ├── dynamic_bitset.h
│   │       ├── eval.h
│   │       ├── hammingDist.h
│   │       ├── heap.h
│   │       ├── hierarchical_clustering_index.h
│   │       ├── random.h
│   │       └── result_set.h
│   ├── OPQ/
│   │   ├── README.html
│   │   ├── README.md
│   │   ├── TransForm_Data/
│   │   │   ├── coarse_vocabularies.m
│   │   │   ├── coarse_vocabularies.m~
│   │   │   ├── fine_vocabularies.m
│   │   │   ├── fvecs_read.m
│   │   │   ├── fvecs_write.m
│   │   │   ├── generate_learn.m
│   │   │   ├── generate_learn.m~
│   │   │   ├── main.m
│   │   │   ├── sqdist.m
│   │   │   ├── train_opq_np.m
│   │   │   ├── transform_base_query.m
│   │   │   └── transform_base_query.m~
│   │   ├── script/
│   │   │   ├── indexer.sh
│   │   │   └── searcher.sh
│   │   └── src/
│   │       ├── CMakeLists.txt
│   │       ├── IndexerLauncher.cmake
│   │       ├── NearestSearch.cmake
│   │       ├── SearcherTester.cmake
│   │       ├── build_release.sh
│   │       ├── data_util.cpp
│   │       ├── data_util.h
│   │       ├── indexer.h
│   │       ├── indexer_launcher.cpp
│   │       ├── make_project.bat
│   │       ├── multitable.hpp
│   │       ├── ordered_lists_merger.h
│   │       ├── perfomance_util.cpp
│   │       ├── perfomance_util.h
│   │       ├── run_indexer.py
│   │       ├── run_indexer_vlad.py
│   │       ├── run_searcher.py
│   │       ├── run_searcher_vlad.py
│   │       ├── searcher.h
│   │       └── searcher_tester.cpp
│   ├── QALSH/
│   │   ├── Makefile
│   │   ├── README.md
│   │   ├── script/
│   │   │   ├── build.sh
│   │   │   └── search.sh
│   │   └── src/
│   │       ├── ann.cpp
│   │       ├── ann.h
│   │       ├── b_node.cpp
│   │       ├── b_node.h
│   │       ├── b_tree.cpp
│   │       ├── b_tree.h
│   │       ├── block_file.cpp
│   │       ├── block_file.h
│   │       ├── def.h
│   │       ├── headers.h
│   │       ├── main.cpp
│   │       ├── qalsh.cpp
│   │       ├── qalsh.h
│   │       ├── random.cpp
│   │       ├── random.h
│   │       ├── util.cpp
│   │       └── util.h
│   ├── RCT/
│   │   ├── README.html
│   │   ├── README.md
│   │   ├── script/
│   │   │   ├── build.sh
│   │   │   └── search.sh
│   │   └── src/
│   │       ├── DistData.cpp
│   │       ├── DistData.h
│   │       ├── Makefile
│   │       ├── data_util.h
│   │       ├── indexer.cpp
│   │       ├── random.cpp
│   │       ├── random.h
│   │       ├── rct.cpp
│   │       ├── rct.h
│   │       ├── searcher
│   │       └── searcher.cpp
│   ├── README.md
│   ├── SGH/
│   │   ├── README.md
│   │   ├── preprocess/
│   │   │   ├── calculateMap.m
│   │   │   ├── calculaterecall.m
│   │   │   ├── compactbit.m
│   │   │   ├── distMat.m
│   │   │   ├── fvecs_read.m
│   │   │   ├── genGroundTruth.m
│   │   │   ├── hammingDist.m
│   │   │   ├── ivecs_read.m
│   │   │   ├── ivecs_write.m
│   │   │   ├── main.m
│   │   │   ├── run_SGH.m
│   │   │   ├── sqdist.m
│   │   │   └── trainSGH.m
│   │   ├── script/
│   │   │   └── searcher.sh
│   │   └── src/
│   │       ├── Makefile
│   │       ├── SGH.cpp
│   │       ├── SGH.h
│   │       ├── center_chooser.h
│   │       ├── char_bit_cnt.h
│   │       ├── data_util.h
│   │       ├── dynamic_bitset.h
│   │       ├── eval.h
│   │       ├── hammingDist.h
│   │       ├── heap.h
│   │       ├── hierarchical_clustering_index.h
│   │       ├── random.h
│   │       └── result_set.h
│   ├── SH/
│   │   ├── README.md
│   │   ├── script/
│   │   │   └── run.sh
│   │   └── src/
│   │       ├── SHgeneral.cpp
│   │       ├── SHgeneral.h
│   │       ├── SHindex.cpp
│   │       ├── SHindex.h
│   │       ├── SHselection.cpp
│   │       ├── SHselection.h
│   │       ├── build.sh
│   │       ├── constants.h
│   │       ├── data.h
│   │       ├── io.cpp
│   │       ├── io.h
│   │       ├── knn.cpp
│   │       ├── knn.h
│   │       ├── main.cpp
│   │       ├── myrandom.cpp
│   │       ├── myrandom.h
│   │       ├── myvector.cpp
│   │       ├── myvector.h
│   │       ├── statisticsmodule.cpp
│   │       └── statisticsmodule.h
│   ├── SRS/
│   │   ├── README.html
│   │   ├── README.md
│   │   ├── script/
│   │   │   ├── build.sh
│   │   │   └── search.sh
│   │   └── src/
│   │       ├── Makefile
│   │       ├── ParamFile.cpp
│   │       ├── ParamFile.h
│   │       ├── ProjData.cpp
│   │       ├── ProjData.h
│   │       ├── README.html
│   │       ├── RandGen.cpp
│   │       ├── RandGen.h
│   │       ├── Rawdata.h
│   │       ├── SRSCoverTree.cpp
│   │       ├── SRSCoverTree.h
│   │       ├── SRSInMemory.h
│   │       ├── cal_param.cpp
│   │       ├── gen_gt.cpp
│   │       ├── gen_hard_data.cpp
│   │       ├── srs.cpp
│   │       └── stack.h
│   └── flann/
│       ├── README.html
│       ├── README.md
│       ├── code/
│       │   ├── CMakeLists.txt
│       │   ├── COPYING
│       │   ├── ChangeLog
│       │   ├── README.md
│       │   ├── bin/
│       │   │   ├── download_checkmd5.py
│       │   │   ├── indent.sh
│       │   │   ├── make_release.sh
│       │   │   ├── run_test.py
│       │   │   └── uncrustify.cfg
│       │   ├── build/
│       │   │   ├── .Makefile.swp
│       │   │   ├── CMakeFiles/
│       │   │   │   ├── 3.2.3/
│       │   │   │   │   ├── CMakeCCompiler.cmake
│       │   │   │   │   ├── CMakeCXXCompiler.cmake
│       │   │   │   │   ├── CMakeSystem.cmake
│       │   │   │   │   ├── CompilerIdC/
│       │   │   │   │   │   └── CMakeCCompilerId.c
│       │   │   │   │   └── CompilerIdCXX/
│       │   │   │   │       └── CMakeCXXCompilerId.cpp
│       │   │   │   ├── CMakeDirectoryInformation.cmake
│       │   │   │   ├── CMakeOutput.log
│       │   │   │   ├── CMakeRuleHashes.txt
│       │   │   │   ├── Makefile.cmake
│       │   │   │   ├── Makefile2
│       │   │   │   ├── TargetDirectories.txt
│       │   │   │   ├── cmake.check_cache
│       │   │   │   ├── feature_tests.c
│       │   │   │   ├── feature_tests.cxx
│       │   │   │   ├── progress.marks
│       │   │   │   └── uninstall.dir/
│       │   │   │       ├── DependInfo.cmake
│       │   │   │       ├── build.make
│       │   │   │       ├── cmake_clean.cmake
│       │   │   │       └── progress.make
│       │   │   ├── CPackConfig.cmake
│       │   │   ├── CPackSourceConfig.cmake
│       │   │   ├── Makefile
│       │   │   ├── bin/
│       │   │   │   ├── build_auto
│       │   │   │   ├── build_hkmeans
│       │   │   │   ├── build_kdtree
│       │   │   │   ├── flann_h_kmeans_tunning_cpp
│       │   │   │   ├── flann_kdtree_tunning_cpp
│       │   │   │   ├── flann_linear_example_cpp
│       │   │   │   ├── linear
│       │   │   │   ├── search_auto
│       │   │   │   ├── search_hkmeans
│       │   │   │   └── search_kdtree
│       │   │   ├── cmake/
│       │   │   │   ├── CMakeFiles/
│       │   │   │   │   ├── CMakeDirectoryInformation.cmake
│       │   │   │   │   └── progress.marks
│       │   │   │   ├── Makefile
│       │   │   │   ├── cmake_install.cmake
│       │   │   │   └── flann.pc
│       │   │   ├── cmake_install.cmake
│       │   │   ├── doc/
│       │   │   │   ├── CMakeFiles/
│       │   │   │   │   ├── CMakeDirectoryInformation.cmake
│       │   │   │   │   ├── auxclean.dir/
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── doc.dir/
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── dvi.dir/
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── pdf.dir/
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── progress.marks
│       │   │   │   │   ├── ps.dir/
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   └── safepdf.dir/
│       │   │   │   │       ├── DependInfo.cmake
│       │   │   │   │       ├── build.make
│       │   │   │   │       ├── cmake_clean.cmake
│       │   │   │   │       └── progress.make
│       │   │   │   ├── Makefile
│       │   │   │   ├── cmake_install.cmake
│       │   │   │   └── references.bib
│       │   │   ├── examples/
│       │   │   │   ├── CMakeFiles/
│       │   │   │   │   ├── CMakeDirectoryInformation.cmake
│       │   │   │   │   ├── build_auto.dir/
│       │   │   │   │   │   ├── CXX.includecache
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── build_hkmeans.dir/
│       │   │   │   │   │   ├── CXX.includecache
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── build_kdtree.dir/
│       │   │   │   │   │   ├── CXX.includecache
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── examples.dir/
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── flann_h_kmeans_tunning_cpp.dir/
│       │   │   │   │   │   ├── CXX.includecache
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── flann_kdtree_tunning_cpp.dir/
│       │   │   │   │   │   ├── CXX.includecache
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── flann_linear_example_cpp.dir/
│       │   │   │   │   │   ├── CXX.includecache
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── linear.dir/
│       │   │   │   │   │   ├── CXX.includecache
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── progress.marks
│       │   │   │   │   ├── search_auto.dir/
│       │   │   │   │   │   ├── CXX.includecache
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── search_hkmeans.dir/
│       │   │   │   │   │   ├── CXX.includecache
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   └── search_kdtree.dir/
│       │   │   │   │       ├── CXX.includecache
│       │   │   │   │       ├── DependInfo.cmake
│       │   │   │   │       ├── build.make
│       │   │   │   │       ├── cmake_clean.cmake
│       │   │   │   │       ├── depend.internal
│       │   │   │   │       ├── depend.make
│       │   │   │   │       ├── flags.make
│       │   │   │   │       ├── link.txt
│       │   │   │   │       └── progress.make
│       │   │   │   ├── Makefile
│       │   │   │   └── cmake_install.cmake
│       │   │   ├── lib/
│       │   │   │   ├── libflann.so.1.8
│       │   │   │   ├── libflann.so.1.8.4
│       │   │   │   ├── libflann_cpp.so.1.8
│       │   │   │   └── libflann_cpp.so.1.8.4
│       │   │   ├── src/
│       │   │   │   ├── CMakeFiles/
│       │   │   │   │   ├── CMakeDirectoryInformation.cmake
│       │   │   │   │   └── progress.marks
│       │   │   │   ├── Makefile
│       │   │   │   ├── cmake_install.cmake
│       │   │   │   ├── cpp/
│       │   │   │   │   ├── CMakeFiles/
│       │   │   │   │   │   ├── CMakeDirectoryInformation.cmake
│       │   │   │   │   │   ├── flann.dir/
│       │   │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   │   ├── build.make
│       │   │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   │   └── progress.make
│       │   │   │   │   │   ├── flann_cpp.dir/
│       │   │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   │   ├── build.make
│       │   │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   │   └── progress.make
│       │   │   │   │   │   ├── flann_cpp_s.dir/
│       │   │   │   │   │   │   ├── CXX.includecache
│       │   │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   │   ├── build.make
│       │   │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   │   ├── cmake_clean_target.cmake
│       │   │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   │   └── progress.make
│       │   │   │   │   │   ├── flann_s.dir/
│       │   │   │   │   │   │   ├── CXX.includecache
│       │   │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   │   ├── build.make
│       │   │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   │   ├── cmake_clean_target.cmake
│       │   │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   │   └── progress.make
│       │   │   │   │   │   └── progress.marks
│       │   │   │   │   ├── Makefile
│       │   │   │   │   └── cmake_install.cmake
│       │   │   │   ├── matlab/
│       │   │   │   │   ├── CMakeFiles/
│       │   │   │   │   │   ├── CMakeDirectoryInformation.cmake
│       │   │   │   │   │   └── progress.marks
│       │   │   │   │   ├── Makefile
│       │   │   │   │   └── cmake_install.cmake
│       │   │   │   └── python/
│       │   │   │       ├── CMakeFiles/
│       │   │   │       │   ├── CMakeDirectoryInformation.cmake
│       │   │   │       │   └── progress.marks
│       │   │   │       ├── Makefile
│       │   │   │       ├── cmake_install.cmake
│       │   │   │       └── setup.py
│       │   │   └── uninstall_target.cmake
│       │   ├── cmake/
│       │   │   ├── CMakeLists.txt
│       │   │   ├── FindFlann.cmake
│       │   │   ├── UseLATEX.cmake
│       │   │   ├── flann.pc
│       │   │   ├── flann.pc.in
│       │   │   ├── flann_utils.cmake
│       │   │   └── uninstall_target.cmake.in
│       │   ├── doc/
│       │   │   ├── CMakeLists.txt
│       │   │   ├── manual.tex
│       │   │   └── references.bib
│       │   ├── examples/
│       │   │   ├── CMakeLists.txt
│       │   │   ├── CMakeLists.txt~
│       │   │   ├── GIST_flann_auto_example.cpp~
│       │   │   ├── GIST_flann_h_kmeans_example.cpp~
│       │   │   ├── GIST_flann_kdtree_example (copy).cpp~
│       │   │   ├── GIST_flann_kdtree_example.cpp~
│       │   │   ├── GIST_flann_linear_example.cpp~
│       │   │   ├── MNIST_flann_auto_example.cpp~
│       │   │   ├── MNIST_flann_h_kmeans_example.cpp~
│       │   │   ├── MNIST_flann_kdtree_example (copy).cpp~
│       │   │   ├── MNIST_flann_kdtree_example.cpp~
│       │   │   ├── MNIST_flann_linear_example.cpp~
│       │   │   ├── README
│       │   │   ├── SIFT_flann_auto_example.cpp~
│       │   │   ├── SIFT_flann_h_kmeans_example.cpp~
│       │   │   ├── SIFT_flann_kdtree_example (copy).cpp~
│       │   │   ├── SIFT_flann_kdtree_example.cpp~
│       │   │   ├── SIFT_flann_linear_example (copy).cpp~
│       │   │   ├── SIFT_flann_linear_example.cpp~
│       │   │   ├── audio_flann_auto_example.cpp~
│       │   │   ├── audio_flann_h_kmeans_example.cpp~
│       │   │   ├── audio_flann_kdtree_example.cpp~
│       │   │   ├── audio_flann_kdtree_tunning.cpp~
│       │   │   ├── audio_flann_linear_example.cpp~
│       │   │   ├── build_auto.cpp
│       │   │   ├── build_auto.cpp~
│       │   │   ├── build_hkmeans.cpp
│       │   │   ├── build_hkmeans.cpp~
│       │   │   ├── build_kdtree.cpp
│       │   │   ├── build_kdtree.cpp~
│       │   │   ├── cifar10_flann_auto_example.cpp~
│       │   │   ├── cifar10_flann_h_kmeans_example.cpp~
│       │   │   ├── cifar10_flann_kdtree_example.cpp~
│       │   │   ├── cifar10_flann_linear_example.cpp~
│       │   │   ├── flann_auto_example.cpp~
│       │   │   ├── flann_example.cpp~
│       │   │   ├── flann_example.c~
│       │   │   ├── flann_h_kmeans_example.cpp~
│       │   │   ├── flann_kdtree_example.cpp~
│       │   │   ├── flann_kdtree_tunning.cpp~
│       │   │   ├── flann_linear_example.cpp~
│       │   │   ├── get_kdtree_level.cpp~
│       │   │   ├── glove_flann_auto_example.cpp~
│       │   │   ├── glove_flann_h_kmeans_example.cpp~
│       │   │   ├── glove_flann_kdtree_example.cpp~
│       │   │   ├── glove_flann_linear_example.cpp~
│       │   │   ├── hard_flann_auto_example.cpp~
│       │   │   ├── hard_flann_h_kmeans_example.cpp~
│       │   │   ├── hard_flann_kdtree_example.cpp~
│       │   │   ├── hard_flann_linear_example.cpp~
│       │   │   ├── linear.cpp
│       │   │   ├── measure_flann.cpp~
│       │   │   ├── measure_hkmeans.cpp~
│       │   │   ├── ran_flann_auto_example.cpp~
│       │   │   ├── ran_flann_h_kmeans_example.cpp~
│       │   │   ├── ran_flann_kdtree_example.cpp~
│       │   │   ├── ran_flann_linear_example.cpp~
│       │   │   ├── search_auto.cpp
│       │   │   ├── search_auto.cpp~
│       │   │   ├── search_hkmeans.cpp
│       │   │   ├── search_hkmeans.cpp~
│       │   │   ├── search_kdtree.cpp
│       │   │   ├── search_kdtree.cpp~
│       │   │   ├── sun_flann_linear_example.cpp~
│       │   │   ├── trevi_flann_linear_example.cpp~
│       │   │   └── youtube_flann_linear_example.cpp~
│       │   └── src/
│       │       ├── CMakeLists.txt
│       │       ├── cpp/
│       │       │   ├── CMakeLists.txt
│       │       │   └── flann/
│       │       │       ├── algorithms/
│       │       │       │   ├── #kmeans_index.h
│       │       │       │   ├── #kmeans_index.h~
│       │       │       │   ├── #nn_index.h
│       │       │       │   ├── all_indices.h
│       │       │       │   ├── autotuned_index.h
│       │       │       │   ├── autotuned_index.h~
│       │       │       │   ├── center_chooser.h
│       │       │       │   ├── center_chooser.h~
│       │       │       │   ├── composite_index.h
│       │       │       │   ├── dist.h
│       │       │       │   ├── dist.h~
│       │       │       │   ├── hierarchical_clustering_index.h
│       │       │       │   ├── hierarchical_clustering_index.h~
│       │       │       │   ├── kdtree_cuda_3d_index.cu
│       │       │       │   ├── kdtree_cuda_3d_index.h
│       │       │       │   ├── kdtree_cuda_builder.h
│       │       │       │   ├── kdtree_index.h
│       │       │       │   ├── kdtree_index.h~
│       │       │       │   ├── kdtree_single_index.h
│       │       │       │   ├── kmeans_index.h
│       │       │       │   ├── kmeans_index.h~
│       │       │       │   ├── kmeans_index_print.h
│       │       │       │   ├── linear_index.h
│       │       │       │   ├── linear_index.h~
│       │       │       │   ├── lsh_index.h
│       │       │       │   ├── nn_index.h
│       │       │       │   └── nn_index.h~
│       │       │       ├── config.h
│       │       │       ├── config.h.in
│       │       │       ├── defines.h
│       │       │       ├── flann.cpp
│       │       │       ├── flann.h
│       │       │       ├── flann.hpp
│       │       │       ├── flann.hpp~
│       │       │       ├── flann_cpp.cpp
│       │       │       ├── general.h
│       │       │       ├── io/
│       │       │       │   └── hdf5.h
│       │       │       ├── kmeans_index.h
│       │       │       ├── mpi/
│       │       │       │   ├── client.h
│       │       │       │   ├── flann_mpi_client.cpp
│       │       │       │   ├── flann_mpi_server.cpp
│       │       │       │   ├── index.h
│       │       │       │   ├── matrix.h
│       │       │       │   ├── queries.h
│       │       │       │   └── server.h
│       │       │       ├── nn/
│       │       │       │   ├── ground_truth.h
│       │       │       │   ├── index_testing.h
│       │       │       │   ├── index_testing.h~
│       │       │       │   └── simplex_downhill.h
│       │       │       └── util/
│       │       │           ├── #result_set.h
│       │       │           ├── allocator.h
│       │       │           ├── any.h
│       │       │           ├── cuda/
│       │       │           │   ├── heap.h
│       │       │           │   └── result_set.h
│       │       │           ├── cutil_math.h
│       │       │           ├── dynamic_bitset.h
│       │       │           ├── heap.h
│       │       │           ├── logger.h
│       │       │           ├── lsh_table.h
│       │       │           ├── matrix.h
│       │       │           ├── object_factory.h
│       │       │           ├── params.h
│       │       │           ├── random.h
│       │       │           ├── random.h~
│       │       │           ├── result_set.h
│       │       │           ├── result_set.h~
│       │       │           ├── sampling.h
│       │       │           ├── saving.h
│       │       │           ├── serialization.h
│       │       │           └── timer.h
│       │       ├── matlab/
│       │       │   ├── CMakeLists.txt
│       │       │   ├── flann_build_index.m
│       │       │   ├── flann_free_index.m
│       │       │   ├── flann_load_index.m
│       │       │   ├── flann_save_index.m
│       │       │   ├── flann_search.m
│       │       │   ├── flann_set_distance_type.m
│       │       │   ├── nearest_neighbors.cpp
│       │       │   └── test_flann.m
│       │       └── python/
│       │           ├── CMakeLists.txt
│       │           ├── pyflann/
│       │           │   ├── __init__.py
│       │           │   ├── exceptions.py
│       │           │   ├── flann_ctypes.py
│       │           │   └── index.py
│       │           ├── setup.py
│       │           └── setup.py.tpl
│       └── script/
│           ├── build_auto.sh
│           ├── build_hkmeans.sh
│           ├── build_kdtree.sh
│           ├── run_linear.sh
│           ├── search_auto.sh
│           ├── search_hkmeans.sh
│           └── search_kdtree.sh
└── data/
    ├── Dataset_Link
    ├── README.html
    ├── README.md
    └── transformer/
        ├── README.md
        ├── script/
        │   └── run.sh
        └── src/
            ├── build.sh
            ├── compute_gnd.cpp
            ├── compute_groundtruth
            ├── gnd.h
            ├── load_from_hdf
            ├── load_from_hdf.cpp
            └── util.h

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
# mac file
.DS_Store

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app




================================================
FILE: README.md
================================================
# NNS Benchmark: Evaluating Approximate Nearest Neighbor Search Algorithms in High Dimensional Euclidean Space

Nearest neighbor search (NNS) is a fundamental and essential operation in applications from many domains, such as databases, machine learning, multimedia, and computer vision. Hundreds of algorithms have been proposed to attack the problem from different perspectives, yet there is no **open** and **comprehensive** comparison. By "comprehensive", we mean using state-of-the-art algorithms proposed from different research areas, and evaluating them on a diverse range of datasets.

To aid researchers and practitioners working on or whose work depends on the problem, we setup this benchmark for Nearest Neighbor Search (NNS) based on the Euclidean distance on High Dimensional Data. The benefit is twofold:

- For researchers, it allows one to **easily** compare their new algorithms with state-of-the-art ones and on a diverse set of datasets. The latter is especially important to gain a **complete** picture of the performance of an algorithm.
- For practitioners, it allows one to **easily** understand the performances of different algorithms and their **tradeoffs**. This helps them to choose the best implementation meeting their own goals and constraints.

We also would like to leverage the entire community to collaboratively build and maintain this benchmark. For example, submitting new algorithms, useful datasets, or offering suggestions or improvements.

## Scope

We limit the scope of this benchmark by imposing the following constraints. 

- **Representative and competitive approximate NNS algorithms**. It has been well recognized that the exact NNS algorithms often cannot even outperform even the simple linear scan algorithm when the dimensionality is high. We therefore only consider the approximate solutions. In this benchmark, we consider the state-of-the-art algorithms in several research areas and those from practitioners.

- **No hardware specific optimizations**.  Not all the implementations we obtained or implemented have the same level of sophistication in utilizing the hardware specific features to speed up the query processing. To perform a (relatively) fair comparison and gain insight into the real strength and weakness of algorithms, we modified several implementations so that, as far as we are aware, no implementation of algorithm in this benchmark uses multiple threads, multiple CPUs, SIMD instructions, hardware pre-fetching, or GPUs.

- **Dense vectors**. We mainly focus on the case where the input data vectors are dense, i.e., non-zero in most of the dimensions.

- **Support the Euclidian distance**. The Euclidean distance is one of the most widely used measures on high-dimensional datasets. It is also supported by most of the NNS algorithms.

- **Exact kNN as the ground truth**. In some existing works, each data point has a label (typically in classification or clustering applications) and the labels are regarded as the ground truth when evaluating the recall of approximate NN algorithms. In our benchmark, we use the exact kNN points as the ground truth as this works for all datasets and majority of the applications.

Currently, we evaluate **15 representative NNS algorithms** on **20 datasets** where details are reported in our [Nearest Neighbor Search (NNS) Experimental Evaluation Paper](https://arxiv.org/abs/1610.02455)[1].

## Algorithms Evaluted 

Thanks to the original authors, all the algorithms considered in this benchmark have their sources publicly available. Algorithms are implemented in C++ unless otherwise specified. We carefully go through all the implementations and make necessary modifications to for fair comparisons. For instance, we re-implement the search process of some algorithms in C++. We also disable the multi-threads, SIMD instructions, fast-math, and hardware prefetching technique.

Below are brief introuductions of the algorithms evaluated in the benchmark as well as our revisions, which are grouped into three/four categories.

### 1. Locality Sensitive Hashing (LSH)-Based Methods

- **QALSH** Query-Aware LSH ([2], PVLDB’15). 
[Originial source code](http://ss.sysu.edu.cn/~fjl/qalsh/qalsh_1.1.2.tar.gz)

- **SRS** ([3], PVLDB’14).
[Originial source code](https://github.com/DBWangGroupUNSW/SRS). 
Note that both external memory and in-memory versions of **SRS** are available.

### 2. Space Partitioning-based Methods

#### 2.1. Encoding-Based Space Partitioning Methods

- **SGH** Scalable Graph Hashing ([4], IJCAI’15). 
[Originial source code](http://cs.nju.edu.cn/lwj). 
    * Source codes (index construction and search) are implemented by MATLAB. 
    * In our implementation, we use the hierarchical clustering trees in **FLANN** (C++) to index the resulting binary vectors to support more efficient search.

- **AGH** Anchor Graph Hashing ([5], ICML’11). 
[Originial source code](http://www.ee.columbia.edu/ln/dvmm/downloads)
    * Source codes (index construction and search) are implemented by MATLAB. 
    * In our implementation, we use the hierarchical clustering trees in **FLANN** (C++) to index the resulting binary vectors to support more efficient search.


- **NSH** Neighbor-Sensitive Hashing ([6], PVLDB’15). 
[Originial source code](https://github.com/pyongjoo/nsh)
    * Source codes (index construction and search) are implemented by MATLAB. 
    * In our implementation, we use the hierarchical clustering trees in **FLANN** (C++) to index the resulting binary vectors to support more efficient search.

- **SH** Selective Hashing ([7], KDD’15). 
[Originial source code](http://www.comp.nus.edu.sg/~dsh/download.html).
    Note that we have confirmed with the authors that the source code released implements the algorithm in their KDD'15 paper, not that in their previous SIGMOD'14 paper.  

- **OPQ** Optimal Product Quantization ([8], TPAMI’14). 
[Originial source code](http://research.microsoft.com/en-us/um/people/kahe). 
Note that, in our impementation, we use the [inverted multi-indexing technique](http://arbabenko.github.io/MultiIndex/index.html) [17] to perform non-exhaustive search for **OPQ**.

- **NAPP** Neighborhood APProximation index ([9], PVLDB’15). 
[Originial source code](https://github.com/searchivarius/nmslib)
    * We disable the SIMD, multi-threading, and `-Ofast` compiler option.

#### 2.2. Tree-Based Space Partitioning Methods

- **FLANN** ([10], TPAMI’14). 
[Originial source code](http://www.cs.ubc.ca/research/flann)
    * We disable the multi-threading techniques in **FLANN**.

- **Annoy** ([11]). 
[Originial source code](https://github.com/spotify/annoy)
    * Source codes are implemented by C++ (core algorithms) and Python (for binding). We re-implemente the Python binding part with C++. 
    * We disable `-ffast-math` compiler option in **Annoy**.

- **VP-Tree** Vantage-Point tree ([12], NIPS’13). 
[Originial source code](https://github.com/searchivarius/nmslib)
    * We disable the SIMD, multi-threading, and `-Ofast` compiler option.

### 3. Neighborhood-Based Methods

- **SW** Small World Graph ([13], IS'14). 
[Originial source code](https://github.com/searchivarius/nmslib)  
  * We disable the SIMD, multi-threading, and `-Ofast` compiler option.

- **HNSW** Hierarchical Navigable Small World ([20], arXiv'16). 
[Originial source code](https://github.com/searchivarius/nmslib)  
  * We disable the SIMD, multi-threading, and `-Ofast` compiler option.

- **RCT** Rank Cover Tree ([14], TPAMI'15).
  Originial source code is obtained from authors by email, who kindly allow us to release them through this benchmark. 

- **KGraph** ([15] [16], WWW'11). 
  [Originial source code](https://github.com/aaalgo/kgraph)
  * We disable SIMD and multi-threading techniques in **KGraph**. Note the besides the compiler flag, we also comment out the SIMD related code in `metric.cpp`
  * We reduce the index size of KGraph by discarding the distances of the edges, which is not used in the search process anyway. 

- **DPG** Diversified Proximity Graph ([1]). 
[Originial source code](https://github.com/DBWangGroupUNSW/nns_benchmark/tree/master/algorithms/DPG)
    We engineered a new algorithm, DPG, that constructs an alternative neighborhood graph index, yet uses the same search algorithm as the KGraph. DPG is more robust than KGraph across different datasets. For more details about the algorithm and its analysis, please refer to our [NNS Experimental Evaluation Paper](https://arxiv.org/abs/1610.02455)[1]. 
    
- **NSG**  Navigating Spreading-out Graph ([21], VLDB 2019). 
[Originial source code](https://github.com/ZJULearning/nsg)
   * NSG is a newly graph-based algorithm. We disable the SIMD instructions and the hardware prefetching technique. 


## Datasets Used 

Currently, we use

- **18 real datasets** that are used by existing work and cover a wide range of application and data types, including image, audio, video, text, and deep-learning data. 
- **2 sythetic datasets**: Rand (for Random) and Gauss (for mixed Gaussian). 

Table 1 summarizes the characteristics of the datasets including the number of data points (*n*), dimensionality (*d*), Relative Contrast (*RC* [18]), local intrinsic dimensionality (*LID* [19]), and data type, where RC and LID are used to describe the hardness of the datasets.

| **Name** | **n X 10^3** | **d** | **RC** | **LID** | **Type**|
| ------ | ------ | ------ | ------ | ------ | -------- |
| Nus*   | 269    |  500    |  1.67 |  24.5 | Image |
| Gist*  | 983    |  960    |  1.94   | 18.9  | Image |
| Rand*  | 1,000  |  100    | 3.05    | 58.7  | Synthetic |
| Glove* | 1,192  |  100    | 1.82    | 20.0  | Text  | 
| Cifa   | 50     |  512    | 1.97    | 9.0   | Image |
| Audio  | 53     |  192    | 2.97    | 5.6   | Audio |
| Mnist  | 69     |  784    | 2.38    | 6.5   | Image |
| Sun    | 79     |  512    | 1.94    | 9.9   | Image |
| Enron  | 95     |  1,369  | 6.39    | 11.7  | Text  |
| Trevi  | 100    |  4,096  | 2.95    | 9.2   | Image |
| Notre  | 333    |  128    | 3.22    | 9.0   | Image |
| Yout   | 346    |  1,770  | 2.29    | 12.6  | Video |
| Msong  | 922    |  420    | 3.81    | 9.5   | Audio |
| Sift   | 994    |  128    | 3.50    | 9.3   | Image |
| Deep   | 1,000  |  128    | 1.96    | 12.1  | Image |
| Ben    | 1,098  |  128    | 1.96    | 8.3   | Image |
| Imag   | 2,340  |  150    | 2.54    | 11.6  | Image |
| Gauss  | 2,000  |  512    | 3.36    | 19.6  | Synthetic   |
| UQ-V   | 3,038  |  256    | 8.39    | 7.2   | Video |
| BANN   | 10,000 |  128    | 2.60    | 10.3  | Image |

**Table 1: Dataset Summary**

We mark the first four datasets in Table 1 with asterisks to indicate that they are **hard datasets** compared with
others.

Below, we give more descriptions of these datasets.

- [**Sift**](http://corpus-texmex.irisa.fr) consists of 1 million 128-d SIFT vectors.

- [**Nusw**](http://lms.comp.nus.edu.sg/research/NUS-WIDE.htm) includes around $2.7$ million web images,
each as a 500-dimensional bag-of-words vector.

- [**Msong**](http://www.ifs.tuwien.ac.at/mir/msd/download.html) is a collection of audio features and metadata for a million contemporary popular music tracks with $420$ dimensions.

- [**Gist**]() is is an image dataset which contains about 1 million data points with 960 dimensions.

- [**Deep**](https://yadi.sk/d/I_yaFVqchJmoc) contains deep neural codes of natural images obtained from the activations of a convolutional neural network, which contains about 1 million data points with 256 dimensions.

- [**Bann**](http://corpus-texmex.irisa.fr/) is used to evaluate the scalability of the algorithms, where 1M, 2M, 4M, 6M, 8M, and 10M data points are sampled from 128-dimensional SIFT descriptors extracted from natural images.

- **Guass** is generated by randomly choosing $1000$ cluster centers with in space $[0,10]^512$, and each cluster follows the a Gaussian distribution with deviation 1 on each dimension.

- **Random** contains $1$M randomly chosen points in a unit hypersphere with dimensionality 100.

- [**Audio**](http://www.cs.princeton.edu/cass/audio.tar.gz) has about 0.05 million 192-d audio feature vectors extracted by Marsyas library from DARPA TIMIT audio speed dataset.

- [**Cifar**](http://www.cs.toronto.edu/~kriz/cifar.html) is a labeled subset of *TinyImage* dataset, which consists of 60000 32 X color images in 10 classes, with each image represented by a 512-d GIST feature vector.

- [**Enron**](http://www.cs.cmu.edu/~enron) origins from a collection of emails. Yifang et. al. extract bi-grams and form feature vectors of 1369 dimensions. 

- [**Glove**](http://nlp.stanford.edu/projects/glove) contains 1.2 million 100-d word feature vectors extracted from Tweets.

- [**Imag**](http://cloudcv.org/objdetect) is introduced and employed by [The ImageNet Large Scale Visual Recognition Challenge (ILSVRC)](http://www.image-net.org/challenges/LSVRC/), which contains about 2.4 million data points with 150-d dense SIFT features.

- [**Mnist**](http://yann.lecun.com/exdb/mnist) consists of 70k images of hand-written digits, each as a 784-d vector concatenating all pixels. we randomly sample 1k as the queries and use the remaining as the data base.
 
- [**Sun**](http://groups.csail.mit.edu/vision/SUN) contains about 0.08 million 512-d GIST features of images.

- [**Notre**](http://phototour.cs.washington.edu/datasets) contains about 0.3 million 128-d features of a set of Flickr images and a reconstruction.

- [**UKbench**](http://vis.uky.edu/~stewe/ukbench) contains about 1 million 128-d features of images.

- [**Trevi**](http://phototour.cs.washington.edu/patches/default.htm) consists of 0.4 million X 1024 bitmap(.bmp) images, each containing a `16 X 16` array of image patch. Each patch is sampled as `64 X 64` grayscale, with a canonical scale and orientation. Therefore, Trevi patch dataset consists of around 100,000 4096-d vectors.

- [**UQ_V**](http://staff.itee.uq.edu.au/shenht/UQ_VIDEO/) is a video dataset. A
  local feature based on some keyframes are extracted which include 256
  dimensions.
  
- [**Yout**](http://www.cs.tau.ac.il/~wolf/ytfaces/index.html) contains 3,425 videos of 1,595 different people. All the videos were downloaded from YouTube. An average of 2.15 videos are available for each subject. The shortest clip duration is 48 frames, the longest clip is 6,070 frames, and the average length of a video clip is 181.3 frames.

## PERFORMANCE EVALUATION and ANALYSES 

Please refer to our [NNS Experimental Evaluation paper](https://arxiv.org/abs/1610.02455)[1]. 

## License

Our own code is released under the [Apache License Version 2.0](http://www.apache.org/licenses/). Copyright is owned by DBWang Group (University of New South Wales, Australia) and Database group at QCIS, UTS (Centre for Quantum Computation & Intelligent Systems, The University of Technology Sydney, Australia). 

Below are the license information for the included implementations: 

1. KGraph: BSD license. Users are still encouraged to download the binary distributions from [its home site](https://github.com/aaalgo/kgraph) so building issues can be avoided.

2. NMSLib and Annoy: [Apache License Version 2.0](http://www.apache.org/licenses/).

3. AGH: License information below

```
Terms of Use
--
Copyright (c) 2009-2011 by
--
DVMM Laboratory
Department of Electrical Engineering
Columbia University
Rm 1312 S.W. Mudd, 500 West 120th Street
New York, NY 10027
USA
--
If it is your intention to use this code for non-commercial purposes, such as in academic research, this code is free.
--
If you use this code in your research, please acknowledge the authors, and cite our related publication:
--

Wei Liu, Jun Wang, Sanjiv Kumar, and Shih-Fu Chang, "Hashing with Graphs," International Conference on Machine Learning (ICML), Bellevue, Washington, USA, 2011
```

4. SRS: GPL License.

5. FLANN: BSD License. 

6. RCT: The Authors grant us the permission to release source code by email.

7. Algorithms whose license information are not mentioned: NSH,  OPQ, QALSH, SGH, and SH. 

## Recall vs Speedup
Here, we present the Recall with respect to Speedup of all the algorithms on four datasets, the k is set to be 20.

![image](https://github.com/MingjieL/ANN/blob/master/sift_Recall_speedup.jpg "Sift")
  **Sift**
![image](https://github.com/MingjieL/ANN/blob/master/gist_Recall_speedup.jpg "Gist")
  **Gist**
![image](https://github.com/MingjieL/ANN/blob/master/glove_Recall_speedup.jpg "Glove")
  **Glove**
![image](https://github.com/MingjieL/ANN/blob/master/millionSong_Recall_speedup.jpg "MillionSong")
  **MillionSong**


 
## REFERENCES 

[1] W. Li, Y. Zhang, Y. Sun, W. Wang, W. Zhang, X. Lin, *Nearest Neighbor Search on High Dimensional Data — Experiments, Analyses, and Improvement (v1.0)*. CoRR, vol. abs/1610.02455, 2016. [Online version](https://arxiv.org/abs/1610.02455)

[2] Q. Huang, J. Feng, Y. Zhang, Q. Fang, and W. Ng. *Query-aware locality-sensitive hashing for approximate nearest neighbor search*. PVLDB, 9(1):1–12, 2015.

[3] Y. Sun, W. Wang, J. Qin, Y. Zhang, and X. Lin. *SRS: solving c-approximate nearest neighbor queries in high
dimensional euclidean space with a tiny index*. PVLDB,8(1):1–12, 2014

[4] Q. Jiang and W. Li. *Scalable graph hashing with feature transformation*. In IJCAI, pages 2248–2254, 2015.

[5] W. Liu, J. Wang, S. Kumar, and S. Chang. *Hashing with graphs*. In ICML, pages 1–8, 2011.

[6] Y. Park, M. J. Cafarella, and B. Mozafari. *Neighbor-sensitive hashing*. In PVLDB, 9(3):144–155, 2015.

[7] J. Gao, H. V. Jagadish, B. C. Ooi, and S. Wang. *Selective hashing: Closing the gap between radius search and k-nn search*. In SIGKDD, 2015.

[8] T. Ge, K. He, Q. Ke, and J. Sun. *Optimized product quantization*. IEEE Trans. Pattern Anal. Mach. Intell., 36(4):744–755, 2014.

[9] B. Naidan, L. Boytsov, and E. Nyberg. *Permutation search methods are efficient, yet faster search is possible*. PVLDB,
8(12):1618–1629, 2015.

[10] M. Muja and D. G. Lowe. *Scalable nearest neighbor algorithms for high dimensional data*. IEEE Trans. Pattern
Anal. Mach. Intell., 36(11):2227–2240, 2014.

[11] E. Bernhardsson. [*Annoy at github*](https://github.com/spotify/annoy).

[12] L. Boytsov and B. Naidan. *Learning to prune in metric and non-metric spaces*. In NIPS, 2013.

[13] Y. Malkov, A. Ponomarenko, A. Logvinov, and V. Krylov. *Approximate nearest neighbor algorithm based on navigable small world graphs*.  Inf. Syst., 45:61–68, 2014

[14] M. E. Houle and M. Nett. *Rank-based similarity search: Reducing the dimensional dependence*. IEEE TPAMI, 37(1):136–150, 2015.

[15] W. Dong. [*Kgraph website*](http://www.kgraph.org).

[16] W. Dong, M. Charikar, and K. Li. *Efficient k-nearest neighbor graph construction for generic similarity measures*. In WWW, 2011.

[17] A. Babenko and V. S. Lempitsky. *The inverted multi-index*. In CVPR, pages 3069–3076, 2012.

[18] J. He, S. Kumar, and S. Chang. *On the difficulty of nearest neighbor search*. In ICML, 2012.

[19] L. Amsaleg, O. Chelly, T. Furon, S. Girard, M. E. Houle, K. Kawarabayashi, and M. Nett. *Estimating local intrinsic dimensionality*. In SIGKDD, 2015.

[20] Yu. A. Malkov and D. A. Yashunin   *Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphs*, In arXiv, 2016	

[21] C. Fu, C. Wang, and D. Cai.  *Fast approximate nearest neighbor search with navigating spreading-out graphs*. In VLDB, pages 461- 474, 2019.








================================================
FILE: algorithms/AGH/README.md
================================================
# AGH - Anchor-based Graph Hashing

This is a modified version of AGH. The original version can be downloaded from [here](http://www.ee.columbia.edu/ln/dvmm/downloads/WeiGraphConstructCode2011/dlform.htm), which is implemented with MATLAB. 

We use the original code to generate the hashcodes of the data points and transformation parameters. We rewrite the searching part in C++ to transform the query points to binary vectors and use the hierarchical clustering trees in FLANN (C++) to index the data binary vectors to support more efficient search.

## Compile (AGH/src)

To compile AGH, go to AGH/src and run 

```
make
```

to get the executable file.

## Index (AGH/preprocess)

To build the index of AGH, enter into preprocess folder and run 
```
main.m
```
in MATLAB to get the transformed data and transformation parameters.
Alternatively, one may run 
```
matlab -nodisplay -nojvm -nosplash -nodesktop -r "try, run('main.m'), end, exit(0)"
``` 

Note that main.m will build the index for 1-AGH and 2-AGH. One could choose to generate only one of them.

## Search (AGH/script)

go to AGH/script and run 
```
searcher.sh 
```
to obtain the searching performance of AGH. We use c value (e.g. the number of the visited points) to  achieve the trade-off between search speed and search quality (recall).




================================================
FILE: algorithms/AGH/preprocess/OneLayerAGH_Test.m
================================================
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function Y = OneLayerAGH_Test(X, Anchor, W, s, sigma)
%
% One-Layer Anchor Graph Hashing Test 
% Written by Wei Liu (wliu@ee.columbia.edu)
% X = nXdim input data 
% Anchor = mXdim anchor points (m<<n)
% W = mXr projection matrix in spectral space
% s = number of nearest anchors
% sigma: Gaussian RBF kernel width parameter 
% Y = nXr binary codes (Y_ij in {1,0})
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[n,dim] = size(X);
m = size(Anchor,1);


%% get Z
Z = zeros(n,m);
Dis = sqdist(X',Anchor');
clear X;
clear Anchor;

val = zeros(n,s);
pos = val;
for i = 1:s
    [val(:,i),pos(:,i)] = min(Dis,[],2);
    tep = (pos(:,i)-1)*n+[1:n]';
    Dis(tep) = 1e60; 
end
clear Dis;
clear tep;
val = exp(-val/(1/1*sigma^2));
val = repmat(sum(val,2).^-1,1,s).*val; %% normalize
tep = (pos-1)*n+repmat([1:n]',1,s);
Z([tep]) = [val];
Z = sparse(Z);
clear tep;
clear val;
clear pos;


%% get binary codes
Y = (Z*W>0);  %% logical format
clear Z;


================================================
FILE: algorithms/AGH/preprocess/OneLayerAGH_Train.m
================================================
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [Y, W, sigma] = OneLayerAGH_Train(X, Anchor, r, s, sigma)
%
% One-Layer Anchor Graph Hashing Training 
% Written by Wei Liu (wliu@ee.columbia.edu)
% X = nXdim input data 
% Anchor = mXdim anchor points (m<<n)
% r = number of hash bits
% s = number of nearest anchors
% sigma: Gaussian RBF kernel width parameter; if no input (sigma=0) this function will
%        self-estimate and return a value. 
% Y = nXr binary codes (Y_ij in {1,0})
% W = mXr projection matrix in spectral space
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[n,dim] = size(X);
m = size(Anchor,1);


%% get Z
Z = zeros(n,m);
Dis = sqdist(X',Anchor');
clear X;
clear Anchor;

val = zeros(n,s);
pos = val;
for i = 1:s
    [val(:,i),pos(:,i)] = min(Dis,[],2);
    tep = (pos(:,i)-1)*n+[1:n]';
    Dis(tep) = 1e60; 
end
clear Dis;
clear tep;

if sigma == 0
   sigma = mean(val(:,s).^0.5);
end
val = exp(-val/(1/1*sigma^2));
val = repmat(sum(val,2).^-1,1,s).*val; %% normalize
tep = (pos-1)*n+repmat([1:n]',1,s);
Z([tep]) = [val];
Z = sparse(Z);
clear tep;
clear val;
clear pos;


%% compute eigensystem 
lamda = sum(Z);
M = Z'*Z;
M = diag(lamda.^-0.5)*M*diag(lamda.^-0.5);
[W,V] = eig(full(M));
clear M;
eigenvalue = diag(V)';
clear V;
[eigenvalue,order] = sort(eigenvalue,'descend');
W = W(:,order);
clear order;
ind = find(eigenvalue>0 & eigenvalue<1-1e-3);
eigenvalue = eigenvalue(ind);
W = W(:,ind);
W = diag(lamda.^-0.5)*W(:,1:r)*diag(eigenvalue(1:r).^-0.5);
clear ind;
clear eigenvalue;
clear lambda;


%% get binary codes
Y = (Z*W>0); %% logical format
clear Z;


================================================
FILE: algorithms/AGH/preprocess/TwoLayerAGH_Test.m
================================================
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function Y = TwoLayerAGH_Test(X, Anchor, W, Thres, s, sigma)
%
% Two-Layer Anchor Graph Hashing Test 
% Written by Wei Liu (wliu@ee.columbia.edu)
% X = nXdim input data 
% Anchor = mXdim anchor points (m<<n)
% W = mX(r/2) projection matrix in spectral space
% Thres = 2X(r/2) threshold matrix
% s = number of nearest anchors
% sigma: Gaussian RBF kernel width parameter 
% Y = nXr binary codes (Y_ij in {1,0})
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[n,dim] = size(X);
m = size(Anchor,1);
r1 = size(W,2);


%% get Z
Z = zeros(n,m);
Dis = sqdist(X',Anchor');
clear X;
clear Anchor;

val = zeros(n,s);
pos = val;
for i = 1:s
    [val(:,i),pos(:,i)] = min(Dis,[],2);
    tep = (pos(:,i)-1)*n+[1:n]';
    Dis(tep) = 1e60; 
end
clear Dis;
clear tep;
val = exp(-val/(1/1*sigma^2));
val = repmat(sum(val,2).^-1,1,s).*val; %% normalize
tep = (pos-1)*n+repmat([1:n]',1,s);
Z([tep]) = [val];
Z = sparse(Z);
clear tep;
clear val;
clear pos;


%% get binary codes
Y = Z*W;
Y1 = Y; 
for k = 1:r1
    pos = find(Y1(:,k)>0);
    neg = setdiff([1:n],pos);
    Y1(pos,k) = Y1(pos,k)-Thres(1,k);
    Y1(neg,k) = -Y1(neg,k)+Thres(2,k);
end
Y = [Y,Y1];

Y = (Y>0); %% logical format


================================================
FILE: algorithms/AGH/preprocess/TwoLayerAGH_Train.m
================================================
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [Y, W, Thres, sigma] = TwoLayerAGH_Train(X, Anchor, r, s, sigma)
%
% Two-Layer Anchor Graph Hashing Training 
% Written by Wei Liu (wliu@ee.columbia.edu)
% X = nXdim input data 
% Anchor = mXdim anchor points (m<<n)
% r = number of hash bits
% s = number of nearest anchors
% sigma: Gaussian RBF kernel width parameter; if no input (sigma=0) this function will
%        self-estimate and return a value. 
% Y = nXr binary codes (Y_ij in {1,0})
% W = mX(r/2) projection matrix in spectral space
% Thres = 2X(r/2) threshold matrix
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[n,dim] = size(X);
m = size(Anchor,1);


%% get Z
Z = zeros(n,m);
Dis = sqdist(X',Anchor');
clear X;
clear Anchor;

val = zeros(n,s);
pos = val;
for i = 1:s
    [val(:,i),pos(:,i)] = min(Dis,[],2);
    tep = (pos(:,i)-1)*n+[1:n]';
    Dis(tep) = 1e60; 
end
clear Dis;
clear tep;

if sigma == 0
   sigma = mean(val(:,s).^0.5);
end
val = exp(-val/(1/1*sigma^2));
val = repmat(sum(val,2).^-1,1,s).*val; %% normalize
tep = (pos-1)*n+repmat([1:n]',1,s);
Z([tep]) = [val];
Z = sparse(Z);
clear tep;
clear val;
clear pos;


%% compute eigensystem 
lamda = sum(Z);
M = Z'*Z;
M = diag(lamda.^-0.5)*M*diag(lamda.^-0.5);
[W,V] = eig(full(M));
clear M;
eigenvalue = diag(V)';
clear V;
[eigenvalue,order] = sort(eigenvalue,'descend');
W = W(:,order);
clear order;
ind = find(eigenvalue>0 & eigenvalue<1-1e-3);
eigenvalue = eigenvalue(ind);
W = W(:,ind);
W = diag(lamda.^-0.5)*W(:,1:r/2)*diag(eigenvalue(1:r/2).^-0.5)*sqrt(n);
clear ind;
clear eigenvalue;
clear lambda;


%% get binary codes
Y = Z*W;
Y1 = Y;
Thres = zeros(2,r/2);
for k = 1:r/2
    pos = find(Y(:,k)>0);
    neg = setdiff([1:n],pos);
    n1 = length(pos);
    n2 = n-n1;
    get = Y(:,k);
    get(neg) = -1*get(neg);
    right = full(get'*Z);
    clear get;
    right = right./lamda;
    left = sum(Z(pos,:));
    s1 = sum(left.*right,2);
    left1 = left./lamda;
    s2 = n1-sum(left.*left1,2);
    s3 = sum(Y(pos,k),1);
    clear left
    clear left1;
    clear right;
    
    Thres(1,k) = (2*s3+n2*(s3-s1)/s2)/n;
    Thres(2,k) = (n1*(s3-s1)/s2-2*s3)/n;
    Y1(pos,k) = Y1(pos,k)-Thres(1,k);
    Y1(neg,k) = -Y1(neg,k)+Thres(2,k);
    clear pos;
    clear neg;
end
clear Z;
Y = [Y,Y1];
clear Y1;

Y = (Y>0); %% logical format


================================================
FILE: algorithms/AGH/preprocess/compactbit.m
================================================
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function cb = compactbit(b)
%
% Written by Rob Fergus
% b = bits array
% cb = compacted string of bits (using words of 'word' bits)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

[nSamples nbits] = size(b);
nwords = ceil(nbits/8);
cb = zeros([nSamples nwords], 'uint8');

for j = 1:nbits
    w = ceil(j/8);
    cb(:,w) = bitset(cb(:,w), mod(j-1,8)+1, b(:,j));
end

================================================
FILE: algorithms/AGH/preprocess/fvecs_read.m
================================================
% Read a set of vectors stored in the fvec format (int + n * float)
% The function returns a set of output vector (one vector per column)
%
% Syntax: 
%   v = fvecs_read (filename)     -> read all vectors
%   v = fvecs_read (filename, n)  -> read n vectors 
%   v = fvecs_read (filename, [a b]) -> read the vectors from a to b (indices starts from 1)
function v = fvecs_read (filename, bounds)

% open the file and count the number of descriptors
fid = fopen (filename, 'rb');
 
if fid == -1
  error ('I/O error : Unable to open the file %s\n', filename)
end

% Read the vector size
d = fread (fid, 1, 'int');
vecsizeof = 1 * 4 + d * 4;

% Get the number of vectrors
fseek (fid, 0, 1);
a = 1;
bmax = ftell (fid) / vecsizeof;
b = bmax;

if nargin >= 2
  if length (bounds) == 1
    b = bounds;
   
  elseif length (bounds) == 2
    a = bounds(1);
    b = bounds(2);    
  end
end

assert (a >= 1);
if b > bmax
  b = bmax;
end

if b == 0 | b < a
  v = [];
  fclose (fid);
  return;
end

% compute the number of vectors that are really read and go in starting positions
n = b - a + 1;
fseek (fid, (a - 1) * vecsizeof, -1);

% read n vectors
v = fread (fid, (d + 1) * n, 'float=>single');
v = reshape (v, d + 1, n);

% Check if the first column (dimension of the vectors) is correct
assert (sum (v (1, 2:end) == v(1, 1)) == n - 1);
v = v (2:end, :);
  
fclose (fid);



================================================
FILE: algorithms/AGH/preprocess/get_anchor.m
================================================
function get_anchor(data_path,anchor_path,m)
dataset = fvecs_read(data_path);
dataset=dataset';
n=size(dataset,1);
p=2000;
idx=randsample(n,p);
Xtraining = dataset(idx,:);
tic;
opts = statset('Display','off','MaxIter',30);
[idc, anchor] = kmeans(Xtraining, m, 'Options', opts, 'EmptyAction', 'singleton');
save([anchor_path '.mat'],'anchor');
anchor_time=toc;

%file = fopen('anchor_time.txt', 'a+');
%fprintf(file,'%f #%s \n',anchor_time,data_name);
%fclose(file);

end


================================================
FILE: algorithms/AGH/preprocess/hammingDist.m
================================================
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function Dh=hammingDist(B1, B2)
%
% Written by Rob Fergus
% Compute hamming distance between two sets of samples (B1, B2)
%
% Dh=hammingDist(B1, B2);
%
% Input
%    B1, B2: compact bit vectors. Each datapoint is one row.
%    size(B1) = [ndatapoints1, nwords]
%    size(B2) = [ndatapoints2, nwords]
%    It is faster if ndatapoints1 < ndatapoints2
% 
% Output
%    Dh = hamming distance. 
%    size(Dh) = [ndatapoints1, ndatapoints2]
%
% example query
% Dhamm = hammingDist(B2, B1);
% this will give the same result than:
%    Dhamm = distMat(U2>0, U1>0).^2;
% the size of the distance matrix is:
%    size(Dhamm) = [Ntest x Ntraining]
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% loop-up table:
bit_in_char = uint16([...
    0 1 1 2 1 2 2 3 1 2 2 3 2 3 3 4 1 2 2 3 2 3 ...
    3 4 2 3 3 4 3 4 4 5 1 2 2 3 2 3 3 4 2 3 3 4 ...
    3 4 4 5 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 1 2 ...
    2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3 4 4 5 ...
    3 4 4 5 4 5 5 6 2 3 3 4 3 4 4 5 3 4 4 5 4 5 ...
    5 6 3 4 4 5 4 5 5 6 4 5 5 6 5 6 6 7 1 2 2 3 ...
    2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3 4 4 5 3 4 ...
    4 5 4 5 5 6 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 ...
    3 4 4 5 4 5 5 6 4 5 5 6 5 6 6 7 2 3 3 4 3 4 ...
    4 5 3 4 4 5 4 5 5 6 3 4 4 5 4 5 5 6 4 5 5 6 ...
    5 6 6 7 3 4 4 5 4 5 5 6 4 5 5 6 5 6 6 7 4 5 ...
    5 6 5 6 6 7 5 6 6 7 6 7 7 8]);

n1 = size(B1,1);
[n2, nwords] = size(B2);

Dh = zeros([n1 n2], 'uint16');
for j = 1:n1
    for n=1:nwords
        y = bitxor(B1(j,n),B2(:,n));
        Dh(j,:) = Dh(j,:) + bit_in_char(y+1);
    end
end


================================================
FILE: algorithms/AGH/preprocess/ivecs_read.m
================================================
% Read a set of vectors stored in the ivec format (int + n * int)
% The function returns a set of output vector (one vector per column)
%
% Syntax: 
%   v = ivecs_read (filename)     -> read all vectors
%   v = ivecs_read (filename, n)  -> read n vectors 
%   v = ivecs_read (filename, [a b]) -> read the vectors from a to b (indices starts from 1)
function v = ivecs_read (filename, bounds)

% open the file and count the number of descriptors
fid = fopen (filename, 'rb');
 
if fid == -1
  error ('I/O error : Unable to open the file %s\n', filename)
end

% Read the vector size
d = fread (fid, 1, 'int');
vecsizeof = 1 * 4 + d * 4;

% Get the number of vectrors
fseek (fid, 0, 1);
a = 1;
bmax = ftell (fid) / vecsizeof;
b = bmax;

if nargin >= 2
  if length (bounds) == 1
    b = bounds;
   
  elseif length (bounds) == 2
    a = bounds(1);
    b = bounds(2);    
  end
end

assert (a >= 1);
if b > bmax
  b = bmax;
end

if b == 0 | b < a
  v = [];
  fclose (fid);
  return;
end

% compute the number of vectors that are really read and go in starting positions
n = b - a + 1;
fseek (fid, (a - 1) * vecsizeof, -1);

% read n vectors
v = fread (fid, (d + 1) * n, 'int=>double');
v = reshape (v, d + 1, n);

% Check if the first column (dimension of the vectors) is correct
assert (sum (v (1, 2:end) == v(1, 1)) == n - 1);
v = v (2:end, :);
fclose (fid);



================================================
FILE: algorithms/AGH/preprocess/ivecs_write.m
================================================
% This function writes a vector from a file in the ivecs format

function ivecs_write (filename, v)

% open the file and count the number of descriptors
fid = fopen (filename, 'wb');
d = size (v, 1);
n = size (v, 2);

for i = 1:n
  
  % first write the vector size
  count = fwrite (fid, d, 'int');

  if count ~= 1 
    error ('Unable to write vector dimension: count !=1 \n');
  end

  % write the vector components
  count = fwrite (fid, v(:,i), 'int');

  if count ~= d 
    error ('Unable to write vector elements: count !=1 \n');
  end
end

fclose (fid);


================================================
FILE: algorithms/AGH/preprocess/main.m
================================================
% data_path: the full path of the dataset
% m: the number of anchor
% s: the number of the nearest anchors need to be considered
% bit: the length of the hashcode

data_name='audio';
data_path=['../../../data/' data_name '_base.fvecs'];
    
index_path = ['../index/' data_name];
mkdir(index_path);

anchor_path=[index_path '/' data_name '_anchor'];
L1_params_path=[index_path '/' data_name '_params.L1']; % the transformation parameters for 1-AGH
L1_data_path=[index_path '/' data_name '_B1.L1'];% the binary format of the dataset

L2_params_path=[index_path '/' data_name '_params.L2'];
L2_data_path=[index_path '/' data_name '_B1.L2'];

m=300;
s=5;
bit=8;

get_anchor(data_path,anchor_path,m);
main_OneLayer(data_path,anchor_path,L1_params_path,L1_data_path,s,bit);
main_TwoLayer(data_path,anchor_path,L2_params_path,L2_data_path,s,bit);


================================================
FILE: algorithms/AGH/preprocess/main_OneLayer.m
================================================
function main_c_OneLayer(data_path, anchor_path, params_path,B1_path,s,bit)

dataset = fvecs_read(data_path); 
dataset=dataset'; % dataset = [n,d] 

[n,dim] = size(dataset);

anchor=load([anchor_path '.mat']);
anchor=anchor.anchor;
m=size(anchor,1);

tic;
[Y, W, sigma] = OneLayerAGH_Train(dataset, anchor, bit, s, 0);
B1 = compactbit(Y);
index_time=toc;
    
file = fopen(params_path, 'w');
fprintf(file,'%d\n',bit);
fprintf(file,'%f\n',sigma);
for t=1:m %anchor
    p_=anchor(t,:);
    fprintf(file,'%f ',p_);
    fprintf(file,'\n');
end
for t=1:m %W
    p_=W(t,:);
    fprintf(file,'%f ',p_);
    fprintf(file,'\n');
end
fclose(file);  
ivecs_write(B1_path,B1');

end


================================================
FILE: algorithms/AGH/preprocess/main_TwoLayer.m
================================================
function main_c_TwoLayer(data_path, anchor_path, params_path,B1_path,s,bit)

traindata = fvecs_read(data_path);
traindata=traindata';

[n,dim] = size(traindata); 

anchor=load([anchor_path '.mat']);
anchor=anchor.anchor;
m=size(anchor,1);

    
tic;
[Y, W, thres, sigma] = TwoLayerAGH_Train(traindata, anchor, bit, s, 0);
B1 = compactbit(Y);
index_time=toc;
    
file = fopen(params_path, 'w');
fprintf(file,'%d\n',bit);
fprintf(file,'%f\n',sigma);
for t=1:m %anchor
    p_=anchor(t,:);
    fprintf(file,'%f ',p_);
    fprintf(file,'\n');
end
for t=1:m %W
    p_=W(t,:);
    fprintf(file,'%f ',p_);
    fprintf(file,'\n');
end
    
for t=1:2 %Thres
    p_=thres(t,:);
    fprintf(file,'%f ',p_);
    fprintf(file,'\n');
end
fclose(file);
    
ivecs_write(B1_path,B1');
    
end


================================================
FILE: algorithms/AGH/preprocess/main_c_OneLayer.m~
================================================
function main_c_OneLayer(data_path, anchor_path,indices_path,B1_path,s,bit)

dataset = fvecs_read(data_path); 
dataset=dataset'; % dataset = [n,d] 

[n,dim] = size(dataset);

anchor=load([anchor_path '.mat']);
anchor=anchor.anchor;
m=size(anchor,1);

tic;
[Y, W, sigma] = OneLayerAGH_Train(dataset, anchor, bit, s, 0);
B1 = compactbit(Y);
index_time=toc;
    
file = fopen(indices_path, 'w');
fprintf(file,'%d\n',bit);
fprintf(file,'%f\n',sigma);
for t=1:m %anchor
    p_=anchor(t,:);
    fprintf(file,'%f ',p_);
    fprintf(file,'\n');
end
for t=1:m %W
    p_=W(t,:);
    fprintf(file,'%f ',p_);
    fprintf(file,'\n');
end
fclose(file);  
ivecs_write(B1_path,B1');

end


================================================
FILE: algorithms/AGH/preprocess/main_c_TwoLayer.m~
================================================
function main_c_TwoLayer(data_path, anchor_path,indices_path,B1_path,s,bit)

traindata = fvecs_read(data_path);
traindata=traindata';

[n,dim] = size(traindata); 

anchor=load(anchor_path);
anchor=anchor.anchor;
m=size(anchor,1);

    
tic;
[Y, W, thres, sigma] = TwoLayerAGH_Train(traindata, anchor, bit, s, 0);
B1 = compactbit(Y);
index_time=toc;
    
file = fopen(indices_path, 'w');
fprintf(file,'%d\n',bit);
fprintf(file,'%f\n',sigma);
for t=1:m %anchor
    p_=anchor(t,:);
    fprintf(file,'%f ',p_);
    fprintf(file,'\n');
end
for t=1:m %W
    p_=W(t,:);
    fprintf(file,'%f ',p_);
    fprintf(file,'\n');
end
    
for t=1:2 %Thres
    p_=thres(t,:);
    fprintf(file,'%f ',p_);
    fprintf(file,'\n');
end
fclose(file);
    
ivecs_write(B1_path,B1');
    
end


================================================
FILE: algorithms/AGH/preprocess/sqdist.m
================================================
function d=sqdist(a,b)
% SQDIST - computes squared Euclidean distance matrix
%          computes a rectangular matrix of pairwise distances
% between points in A (given in columns) and points in B

% NB: very fast implementation taken from Roland Bunschoten

aa = sum(a.*a,1); bb = sum(b.*b,1); ab = a'*b; 
d = abs(repmat(aa',[1 size(bb,2)]) + repmat(bb,[size(aa,2) 1]) - 2*ab);



================================================
FILE: algorithms/AGH/script/searcher.sh
================================================

data_path="../../../data"
result_path="../results"
mkdir ${result_path}

cd ../src

k=20

for data in "audio"
do

dataset_path="${data_path}/${data}_base.fvecs"
query_path="${data_path}/${data}_query.fvecs"
gnd_path="${data_path}/${data}_groundtruth.ivecs"
 
for layer in 1 2         # the layer of AGH
do

params_path=../index/${data}/${data}_params.L${layer}   # file stored the transformation parameters
dataset_binary_path=../index/${data}/${data}_B1.L${layer}  # the file stored the binary dataset
nbit=8          #  the length of the hash code
m=300            # the number of the anchors
t=5             # the number of the nearest anchors used to build the app. graph
radis=-2          # searching limited by the number of the maximum visited points

for c in 100 500 1000
do

./AGH -s ${dataset_path} -q ${query_path} -g ${gnd_path} -k $k -a $m -t $t -l ${layer} -c $c -r ${radis} -b "${dataset_binary_path}" -p "${params_path}" >> "${result_path}/${data}_${layer}AGH.txt"

done
done
done



================================================
FILE: algorithms/AGH/src/AGH.cpp
================================================
#include "data_util.h"
#include "AGH.h"
#include "hammingDist.h"
#include "eval.h"

#include <cstring>
#include <malloc.h>
#include <vector>
#include <cmath>
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <getopt.h>
#include <cstdlib>
#include <dirent.h>
#include <time.h>
#include <sys/time.h>
#include <stdexcept>

using namespace std;
using std::string;
using std::vector;
using std::cout;
using std::ifstream;
using std::ios;
using std::endl;

vector<vector <float> > points;
vector<vector <float > > query;
vector<vector <int> > gnds;
vector<int> maxChecks;

int n;
int nq;
int dim;
int k;
int radis;
int Layer;
int anchor_size;
int nearest_size;

float diff_timeval(timeval t1, timeval t2) {
  return (float) (t1.tv_sec - t2.tv_sec) + (t1.tv_usec - t2.tv_usec) * 1e-6;
}

int main(int argc, char * argv[]) {
	const struct option longopts[] ={
	    {"help",                        no_argument,       0, 'h'},
	    {"dataset_filepath",            required_argument, 0, 's'},
	    {"query_filepath" ,             required_argument, 0, 'q'},
	    {"groundtruth_filepath",        required_argument, 0, 'g'},
	    {"Layer",                       required_argument, 0, 'l'},
		{"k",                           required_argument, 0, 'k'},
		{"r",                           required_argument, 0, 'r'},
		{"c",                           required_argument, 0, 'c'},
		{"t",                           required_argument, 0, 't'},
		{"a",                           required_argument, 0, 'a'},
	    {"dataset_binary_path",         required_argument, 0, 'b'},
	    {"params_path",                 required_argument, 0, 'p'},
	  };
	  int ind;
	  int iarg = 0;
	  opterr = 1;
	  int checks;

	  char groundtruth_filepath[100] = "";
	  char query_filepath[100] = "";
	  char dataset_filepath[100] = "";
	  char dataset_binary_path[100] = "";
	  char params_path[100] = "";
	  //char checks_path[20] ="";


	  while (iarg != -1) {
	    iarg = getopt_long(argc, argv, "s:q:g:l:k:t:a:r:c:b:p:h",
	                       longopts, &ind);

	    switch (iarg) {
	      case 's':
	        if (optarg) {
	        	strcpy(dataset_filepath, optarg);
	        }
	        break;
	      case 'q':
	        if (optarg) {
	        	strcpy(query_filepath, optarg);
	        }
	        break;
	      case 'g':
	        if (optarg) {
	        	strcpy(groundtruth_filepath, optarg);
	        }
	        break;
	      case 'l':
	    	  if (optarg) {
	    	  Layer = atoi(optarg);
	    	  }
	    	  break;
		  case 'k':
	    	  if (optarg) {
	    	  k = atoi(optarg);
	    	  }
	    	  break;
	      case 'a':
	    	  if (optarg) {
	    	  anchor_size = atoi(optarg);
	    	  }
	    	  break;
		  case 't':
	    	  if (optarg) {
	    	  nearest_size = atoi(optarg);
	    	  }
	    	  break;
		  case 'c':
	    	  if (optarg) {
			  //strcpy(checks_path, optarg);
			  checks = atoi(optarg);
	    	  }
	    	  break;
		  case 'r':
	    	  if (optarg) {
	    	  radis = atoi(optarg);
	    	  }
	    	  break;
	      case 'b':
	        if (optarg) {
	        	strcpy(dataset_binary_path, optarg);
	        }
	        break;
	      case 'p':
	        if (optarg) {
	        	strcpy(params_path, optarg);
	        }
	        break;
	     }
	  }
	  ReadPoints(dataset_filepath, &points, &n, &dim);
	  ReadPoints(query_filepath, &query,&nq, &dim);
	  ReadGroundtruth(groundtruth_filepath, &gnds, &nq, &k);
 	  //ReadChecks(checks_path,&maxChecks);

	  //read SH params
	  AGH AGH_;
	  AGH_.ReadAGHParams(params_path,anchor_size,dim,Layer);
	  int nbits = AGH_.nbits;

	  vector<vector<unsigned> > B1;
	  ReadB1(dataset_binary_path,&B1,n);
	  //SH_.compressSH(&points,&B1);

	  HierarchicalClusteringIndex HCI_ ;
	  HCI_.set_params(B1,32,4,100);
	  if(radis==-2)
	  	HCI_.buildIndex();

	  timeval start;
      gettimeofday(&start, NULL);

	  // compress query
	  vector<vector<unsigned> > B2;
	  if(Layer==1)
		AGH_.compressAGH_OneLayer(&query,&B2,nearest_size);
	  else
		AGH_.compressAGH_TwoLayer(&query,&B2,nearest_size);
	
	  timeval end;
	  gettimeofday(&end, NULL);
	  double transform_time = diff_timeval(end, start);
	
	  gettimeofday(&start, NULL);

	  vector<vector<int> > indices;
	  vector<vector<int> > dists;

      if(radis==-1)
		  hammingDist(&B2,&B1,&indices,checks);
	  else if(radis==-2)
		  HCI_.knnSearch(B2,indices,dists,checks,checks);
	  else
		  hammingDist_ByRange(&B2,&B1,&indices,radis);
      
		// get results after re-ranking
	  vector<vector<int> > results;
	  results = Search(&points, &query, &indices, k);

      gettimeofday(&end, NULL);
      double search_time = diff_timeval(end, start) + transform_time;

	  float recall = compute_recall(&gnds, &results);
		  
	  cout<<recall<< " "<< search_time/nq << " #N_"<<checks<<" #bit_"<< nbits<<" #Layer_"<<Layer<<" #t_"<<nearest_size<<" "<< endl;

}






================================================
FILE: algorithms/AGH/src/AGH.h
================================================
#include <vector>
#include <cmath>
#include <cstring>
#include <malloc.h>
#include <getopt.h>
#include <cstdlib>
#include <iostream>
#include <fstream>

using namespace std;
using std::string;
using std::vector;
using std::cout;
using std::ifstream;
using std::ios;
using std::endl;

#ifndef AGH_H_
#define AGH_H_

class AGH
{
	public:
	int nbits;
	int m;
	int s;
	float sigma;
	vector<vector<float> > anchor;
	vector<vector<float> > W;
	vector<vector<float> > Thres;
    
	void ReadAGHParams(string filename, int m_,int dim, int isTwo)
	{
		m = m_;
		FILE* fp=fopen(filename.c_str(),"r");
		//read nbits
		fscanf(fp,"%d",&nbits);

		// read delta
		fscanf(fp,"%f",&sigma);
		
		//read anchor
		for (int i=0;i<m;i++)
		{
			vector<float> tmp;
			tmp.resize(dim);
			for(int d = 0; d < dim; ++d) 
			{
		   		fscanf(fp,"%f",&tmp[d]);
			}
			anchor.push_back(tmp);
		}

		//read W
		if(isTwo==1)
		{
			for (int i=0; i<m; i++)
			{
				vector<float> tmp;
				tmp.resize(nbits);
				for(int d = 0; d < nbits; ++d)
				{
					fscanf(fp,"%f",&tmp[d]);
				}
				W.push_back(tmp);
			}
		}
		else
		{
			for (int i=0; i<m; i++)
			{
				vector<float> tmp;
				tmp.resize(nbits/2);
				for(int d = 0; d < nbits/2; ++d)
				{
					fscanf(fp,"%f",&tmp[d]);
				}
				W.push_back(tmp);
			}
		}
		
		//read Thres
		if(isTwo==2)
		{
			for (int i=0; i<2; i++)
			{
				vector<float> tmp;
				tmp.resize(nbits/2);
				for(int d = 0; d < nbits/2; ++d)
				{
					fscanf(fp,"%f",&tmp[d]);
				}
				Thres.push_back(tmp);
			}
		}
	}
	
	void compactBits(vector<vector<float> > U,vector<vector<unsigned> >* B)
	{
		//U n*nbits
		int n = U.size();
		int nbits = U.at(0).size();
		for(int i=0;i<n;i++)
		{
			vector<unsigned> B_;
			unsigned tmp=0;
			for(int j=0;j<=nbits;j++)
			{
				if(j==nbits)
				{
					B_.push_back(tmp);
					break;
				}
				if(j%8==0 && j!=0)
				{
					B_.push_back(tmp);
					tmp=0;
				}
				if(U.at(i)[j]>0)
				{
					unsigned pos=1<<(j%8);
					tmp |= pos;
				}
			}
			B->push_back(B_);
		}
	}
	
	struct L_Neighbor{
		int pos;
		float val;
		L_Neighbor()
		{
			pos=0;
			val=-1;
		}
	};

	void UpdatePriorityList(L_Neighbor *BList, L_Neighbor tmp) {
	// find the location to insert
	int j;
    int i = s;
    while (i > 0) {
        j = i - 1;
        if (BList[j].val <= tmp.val && BList[j].val!=-1) break;
        i = j;
    }
	if(i < s)
	{
    	j = s-1;
    	while (j > i) {
        	BList[j] = BList[j-1];
        	--j;
    	}
    	BList[i] = tmp;
	}
	}
	float get_distance(vector<float> point, vector<float> query)
	{
		int dim = query.size();
		float dist=0.0;
		for(int i=0; i<dim; i++)
		{
			dist += pow(point[i]-query[i],2);
		}
		return dist;
	}

	void compressAGH_OneLayer(vector<vector<float> >* X, vector<vector<unsigned> >* B,int s_)
	{
		s = s_;
		int nq = X->size();
		int dim = X->at(0).size();
		
		vector<vector<L_Neighbor> > Y;
		
		vector<vector<float> > Z;
		for(int i=0; i<nq; i++)
		{
			vector<float> Z_(m,0);
			Z.push_back(Z_);

			vector<L_Neighbor> LNN(s);
			for(int j=0; j<m; j++)
			{
				float dist = get_distance(X->at(i),anchor[j]);
				L_Neighbor L_;
				L_.pos=j;
				L_.val=dist;
				UpdatePriorityList(&LNN[0],L_);
			}
			float sum = 0.0;
			for(int j=0;j<s;j++)
			{
				L_Neighbor L_= LNN[j];
				float val=exp((-1)* L_.val/pow(sigma,2));
				L_.val=val;
				LNN[j]=L_;
				sum += val;
			}
			sum = 1.0/sum;
			for(int j=0; j<s; j++)
			{
				L_Neighbor L_=LNN[j];
				float val= L_.val*sum;
				L_.val=val;
				LNN[j] = L_;
			}

			Y.push_back(LNN);		
		}
		for(int i=0; i<nq; i++)
		{
			for(int j=0; j<s; j++)
			{
				int tep = Y[i][j].pos*nq+i;
				Z[tep%nq][ceil(tep/nq)] = Y[i][j].val;
			}
		}
		vector<vector<float> > U;
		for(int i=0; i<nq; i++)
		{
			vector<float> U_;
			for(int j=0; j<nbits; j++)
			{
				float tmp=0.0;
				for(int t=0; t<m; t++)
				{
					tmp += Z[i][t]*W[t][j];
				}
				U_.push_back(tmp);
			}
			U.push_back(U_);
		}
		compactBits(U,B);
	}

	void compressAGH_TwoLayer(vector<vector<float> >* X, vector<vector<unsigned> >* B,int s_)
	{
		s = s_;
		int nq = X->size();
		
		vector<vector<L_Neighbor> > T;
		
		vector<vector<float> > Z;
		for(int i=0; i<nq; i++)
		{
			vector<float> Z_(m,0);
			Z.push_back(Z_);

			vector<L_Neighbor> LNN(s);
			for(int j=0; j<m; j++)
			{
				float dist = get_distance(X->at(i),anchor[j]);
				L_Neighbor L_;
				L_.pos=j;
				L_.val=dist;
				UpdatePriorityList(&LNN[0],L_);
			}
			float sum = 0.0;
			for(int j=0;j<s;j++)
			{
				L_Neighbor L_= LNN[j];
				float val=exp((-1)* L_.val/pow(sigma,2));
				L_.val=val;
				LNN[j]=L_;
				sum += val;
			}
			sum = 1.0/sum;
			for(int j=0; j<s; j++)
			{
				L_Neighbor L_=LNN[j];
				float val= L_.val*sum;
				L_.val=val;
				LNN[j] = L_;
			}

			T.push_back(LNN);		
		}
		for(int i=0; i<nq; i++)
		{
			for(int j=0; j<s; j++)
			{
				int tep = T[i][j].pos*nq+i;
				Z[tep%nq][ceil(tep/nq)] = T[i][j].val;
			}
		}
		vector<vector<float> > Y;
		for(int i=0; i<nq; i++)//nq
		{
			vector<float> U_;
			U_.resize(nbits);
			for(int j=0; j<nbits/2; j++)
			{
				float tmp=0.0;
				for(int t=0; t<m; t++)
				{
					tmp += Z[i][t]*W[t][j];
				}
				U_[j]=tmp;
				if(tmp > 0)
				{
					U_[nbits/2+j]=tmp-Thres[0][j];
				}
				else
				{
					U_[nbits/2+j]=-tmp+Thres[1][j];
				};
			}
			Y.push_back(U_);
		}
		compactBits(Y,B);
	}
};

#endif 


================================================
FILE: algorithms/AGH/src/Makefile
================================================
##############
# Make the AGH project
##############

PROD	:= DEBUG
OPT     := -O3 -march=native 
VERSION := \"0.1_${PROD}\"
TARGETS := AGH
SRCS    := AGH.cpp

CCFLAGS = ${OPT} -Wno-deprecated -ggdb -D${PROD} -I./ -DVERSION=${VERSION}
LDFLAGS = ${OPT} -ggdb  
LIBS    = 
CC	= g++ 
OBJS    := ${SRCS:.cpp=.o}


.PHONY: all clean distclean 
all:: ${TARGETS} 

srs: AGH.o
	${CC} ${LDFLAGS} -o $@ $^ ${LIBS}

${OBJS}: %.o: %.cpp
	${CC} ${CCFLAGS} -o $@ -c $< 

clean:: 
	-rm -f *~ *.o ${TARGETS}

distclean:: clean


================================================
FILE: algorithms/AGH/src/center_chooser.h
================================================
#include "random.h"
#include "char_bit_cnt.h"

class CenterChooser
{
	vector<vector<unsigned>* > dataset_;
public:

	void setDataset(vector<vector<unsigned> >& dataset)
    {
		size_t size_ = dataset.size();

		dataset_.resize(size_);
		for (size_t i=0;i<size_;i++)
			dataset_.at(i) = &dataset.at(i);

    }
///*
	int get_distance(int p1, int p2)
	{
		int dist=0;
		int cbits = dataset_.at(0)->size();
		for(int t=0; t<cbits; t++)
		{
			unsigned y = dataset_.at(p1)->at(t) ^ dataset_.at(p2)->at(t);
			dist += char_bit_cnt[y];
		}
		return dist;
	} //*/

	void chooseCenters(int k, int* indices, int indices_length, int* centers, int& centers_length)
	{
		UniqueRandom r(indices_length);

        int index;
        for (index=0; index<k; ++index) {
            bool duplicate = true;
            int rnd;
            while (duplicate) {
                duplicate = false;
                rnd = r.next();
                if (rnd<0) {
                    centers_length = index;
                    return;
                }

                centers[index] = indices[rnd];

                for (int j=0; j<index; ++j) {
                    int sq = get_distance(centers[index], centers[j]);//(dataset_.at(centers[index]), dataset_.at(centers[j]));
                    if (sq <1e-16 ) {//<1e-16
                        duplicate = true;
                    }
                }
            }
        }
        centers_length = index;
	}
};


================================================
FILE: algorithms/AGH/src/char_bit_cnt.h
================================================
unsigned char_bit_cnt [] = {
0x0,
0x1,
0x1,
0x2,
0x1,
0x2,
0x2,
0x3,
0x1,
0x2,
0x2,
0x3,
0x2,
0x3,
0x3,
0x4,
0x1,
0x2,
0x2,
0x3,
0x2,
0x3,
0x3,
0x4,
0x2,
0x3,
0x3,
0x4,
0x3,
0x4,
0x4,
0x5,
0x1,
0x2,
0x2,
0x3,
0x2,
0x3,
0x3,
0x4,
0x2,
0x3,
0x3,
0x4,
0x3,
0x4,
0x4,
0x5,
0x2,
0x3,
0x3,
0x4,
0x3,
0x4,
0x4,
0x5,
0x3,
0x4,
0x4,
0x5,
0x4,
0x5,
0x5,
0x6,
0x1,
0x2,
0x2,
0x3,
0x2,
0x3,
0x3,
0x4,
0x2,
0x3,
0x3,
0x4,
0x3,
0x4,
0x4,
0x5,
0x2,
0x3,
0x3,
0x4,
0x3,
0x4,
0x4,
0x5,
0x3,
0x4,
0x4,
0x5,
0x4,
0x5,
0x5,
0x6,
0x2,
0x3,
0x3,
0x4,
0x3,
0x4,
0x4,
0x5,
0x3,
0x4,
0x4,
0x5,
0x4,
0x5,
0x5,
0x6,
0x3,
0x4,
0x4,
0x5,
0x4,
0x5,
0x5,
0x6,
0x4,
0x5,
0x5,
0x6,
0x5,
0x6,
0x6,
0x7,
0x1,
0x2,
0x2,
0x3,
0x2,
0x3,
0x3,
0x4,
0x2,
0x3,
0x3,
0x4,
0x3,
0x4,
0x4,
0x5,
0x2,
0x3,
0x3,
0x4,
0x3,
0x4,
0x4,
0x5,
0x3,
0x4,
0x4,
0x5,
0x4,
0x5,
0x5,
0x6,
0x2,
0x3,
0x3,
0x4,
0x3,
0x4,
0x4,
0x5,
0x3,
0x4,
0x4,
0x5,
0x4,
0x5,
0x5,
0x6,
0x3,
0x4,
0x4,
0x5,
0x4,
0x5,
0x5,
0x6,
0x4,
0x5,
0x5,
0x6,
0x5,
0x6,
0x6,
0x7,
0x2,
0x3,
0x3,
0x4,
0x3,
0x4,
0x4,
0x5,
0x3,
0x4,
0x4,
0x5,
0x4,
0x5,
0x5,
0x6,
0x3,
0x4,
0x4,
0x5,
0x4,
0x5,
0x5,
0x6,
0x4,
0x5,
0x5,
0x6,
0x5,
0x6,
0x6,
0x7,
0x3,
0x4,
0x4,
0x5,
0x4,
0x5,
0x5,
0x6,
0x4,
0x5,
0x5,
0x6,
0x5,
0x6,
0x6,
0x7,
0x4,
0x5,
0x5,
0x6,
0x5,
0x6,
0x6,
0x7,
0x5,
0x6,
0x6,
0x7,
0x6,
0x7,
0x7,
0x8,
0};


================================================
FILE: algorithms/AGH/src/data_util.h
================================================
#include <cstring>
#include <malloc.h>
#include <vector>
#include <cmath>
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <getopt.h>
#include <cstdlib>
#include <dirent.h>
#include <stdexcept>

using namespace std;
using std::string;
using std::vector;
using std::cout;
using std::ifstream;
using std::ios;
using std::endl;

void transpose(vector<vector<float> > X,vector<vector<float> >* Y)
{

	int dim=X.size();
	int n=X[0].size();

	for(int i=0;i<n;i++)
	{
		vector<float> y_;
		for(int j=0;j<dim;j++)
		{
			y_.push_back(X[j][i]);
		}
		Y->push_back(y_);
	}
}

void ReadPoints(char* filepath,vector<vector<float> >* points, int* len, int* d)
{
	FILE * dfp = fopen(filepath, "rb");
	int dim;
	fread(&dim,sizeof(int),1,dfp);
	fseek(dfp, 0, SEEK_END);
	off_t size = ftell(dfp);
    fseek(dfp, 0, SEEK_SET);
    int n = (int)(size / (sizeof(int)+ sizeof(float)*dim));
	*d = dim;
	*len = n;
	points->resize(n);
	for (int i=0;i<n;i++)
	{
		fread(&dim, sizeof(int),1,dfp);
		points->at(i).resize(dim);
    	for(int j = 0; j < dim; ++j) {
    		float buffer;
			fread(&(buffer), sizeof(float),1,dfp);
    		points->at(i)[j] = buffer;
    	}
	}
}


void ReadPoints(const string& filename, vector<vector<float> >* points, int count, int *dim) {
	//vector<vector<float> > X;
	ifstream input;
	input.open(filename.c_str(), ios::binary);
	if(!input.good()) {
		throw std::logic_error("Invalid filename");
	}
	//X.resize(count);
	points->resize(count);
	int dimension;
	for(int pid = 0; pid < count; ++pid) {
		input.read((char*)&dimension, sizeof(dimension));
		if(dimension <= 0) {
			throw std::logic_error("Bad file content: non-positive dimension");
		}
	//X.at(pid).resize(dimension);
	points->at(pid).resize(dimension);
    for(int d = 0; d < dimension; ++d) {
    	float buffer;
    	input.read((char*)&(buffer), sizeof(float));
    	//X.at(pid)[d] = buffer;
    	points->at(pid)[d] = buffer;
    }
  }
  *dim = dimension;
  //points = &X;
  //transpose(X,points);
}

void ReadGroundtruth(char* filepath, vector<vector<int> >* gnds, int* len, int* d)
{
	FILE * dfp = fopen(filepath, "rb");
	int k;
	fread(&k,sizeof(int),1,dfp);
	fseek(dfp, 0, SEEK_END);
	off_t size = ftell(dfp);
    fseek(dfp, 0, SEEK_SET);
    int n = (int)(size / (sizeof(int)+ sizeof(int)*k));
	*d = k;
	*len = n;
	gnds->resize(n);
	for (int i=0;i<n;i++)
	{
		fread(&k, sizeof(int),1,dfp);
		gnds->at(i).resize(k);
    	for(int j = 0; j < k; ++j) {
    		int buffer;
			fread(&(buffer), sizeof(int),1,dfp);
    		gnds->at(i)[j] = buffer;
    	}
	}
}

void ReadGroundtruth(const string& filename, vector<vector<int> >* gnds,int nq, int nn) {
  ifstream input;
	input.open(filename.c_str(), ios::binary);
  if(!input.good()) {
    throw std::logic_error("Invalid filename");
  }
  gnds->resize(nq);
  int k;
  for(int pid = 0; pid < nq; ++pid) {
    input.read((char*)&k, sizeof(k));
    if(k <= 0) {
      throw std::logic_error("Bad file content: non-positive dimension");
    }
    gnds->at(pid).resize(k);
    for(int d = 0; d < k; ++d) {
      int buffer;
      input.read((char*)&(buffer), sizeof(int));
      gnds->at(pid)[d] = buffer;
    }
  }
  //*nn = k;
}

void ReadB1(const string& filename, vector<vector<unsigned> >* B1,int n) {//
  ifstream input;
	input.open(filename.c_str(), ios::binary);
  if(!input.good()) {
    throw std::logic_error("Invalid filename");
  }
  B1->resize(n);
  int cbits;
  for(int pid = 0; pid < n; ++pid) {
    input.read((char*)&cbits, sizeof(cbits));
    if(cbits <= 0) {
      throw std::logic_error("Bad file content: non-positive dimension");
    }
    B1->at(pid).resize(cbits);
    for(int d = 0; d < cbits; ++d) {
      int buffer;
      input.read((char*)&(buffer), sizeof(int));
      B1->at(pid)[d] = (unsigned)buffer;//(unsigned)
    }
  }
}


void ReadChecks(const string& filename, vector<int>* checks) {
  FILE *fp = fopen(filename.c_str(), "r");
  int n;
  fscanf(fp, "%d ", &n);
  checks->resize(n);
  int tmp;
  for (int i = 0; i < n; ++i) {
    fscanf(fp, "%d ", &tmp);
    checks->at(i)=tmp;
  }
}







================================================
FILE: algorithms/AGH/src/dynamic_bitset.h
================================================
#include <limits.h>

class DynamicBitset
{
public:
    /** @param only constructor we use in our code
     * @param the size of the bitset (in bits)
     */
    DynamicBitset(size_t size)
    {
        resize(size);
        reset();
    }

    /** Sets all the bits to 0
     */
    void clear()
    {
        std::fill(bitset_.begin(), bitset_.end(), 0);
    }

    void reset()
    {
        std::fill(bitset_.begin(), bitset_.end(), 0);
    }

    
    void resize(size_t size)
    {
        size_ = size;
        bitset_.resize(size / cell_bit_size_ + 1);
    }
    size_t size() const
    {
        return size_;
    }

	void set(size_t index)
    {
        bitset_[index / cell_bit_size_] |= size_t(1) << (index % cell_bit_size_);
    }

    /** @param check if a bit is set
     * @param index the index of the bit to check
     * @return true if the bit is set
     */
    bool test(size_t index) const
    {
        return (bitset_[index / cell_bit_size_] & (size_t(1) << (index % cell_bit_size_))) != 0;
    }

private:
    std::vector<size_t> bitset_;
    size_t size_;
    static const unsigned int cell_bit_size_ = CHAR_BIT * sizeof(size_t);
};


================================================
FILE: algorithms/AGH/src/eval.h
================================================
#ifndef EVAL_H_
#define EVAL_H_

#include <vector>
#include <cmath>
#include <cstring>
#include <malloc.h>
#include <getopt.h>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <set>

using namespace std;
using std::string;
using std::vector;
using std::cout;
using std::ifstream;
using std::ios;
using std::endl;

float compute_recall(vector<vector<int> >* gnds, vector<vector<int> >* results)
{
	size_t nq = results->size();
	size_t nn = results->at(0).size();
	int avg = 0;
	for (size_t i=0; i<nq; ++i) {
		for (size_t j=0; j<nn; ++j) {
			for (size_t k=0;k<nn;++k) {
				if (results->at(i)[j] == gnds->at(i)[k]) {
					avg ++;
				}
			}
		}
	}
	return float(avg)/(nn*nq);
}

float compute_mean_reciprocal_rank(vector<vector<int> >* gnds, vector<vector<int> >* results)
{
	size_t nq = results->size();
	size_t nn = results->at(0).size();
	float avg = 0.0;
	for (size_t i=0; i<nq; ++i) 
	{
		float rate=0.0;
		for(size_t k=0;k<nn;k++)
		{
			if(gnds->at(i)[0]==results->at(i)[k])
			{
				rate +=1.0/(k+1);
				break;
			}
		}
		avg+=rate;
	}
	return avg/nq;
}

float compute_number_closer(vector<vector<int> >* gnds, vector<vector<int> >* results)
{
	size_t nq = results->size();
	size_t nn = results->at(0).size();
	float avg = 0.0;
	for (size_t i=0; i<nq; ++i)
	{
		float rate=0.0;
		for(size_t j=0;j<nn;j++)
		{
			for(size_t k=0;k<nn;k++)
			{
				if(gnds->at(i)[j]==results->at(i)[k])
				{
					rate +=(float)(j+1)/(k+1);
					break;
				}
			}
		}
		avg+=rate/nn;
	}
	return avg/nq;
}

float compute_relative_distance_error(vector<vector<float> >* points, vector<vector<float> >* query, vector<vector<int> >* gnds, vector<vector<int> >* results)
{
	size_t nq = results->size();
	size_t nn = results->at(0).size();
	float count = 0.0;
	for (size_t i=0; i<nq; ++i) 
	{
		float sum=0.0;

		for (size_t j=0;j<nn;++j)
		{
			float min_distance= get_distance(points->at(gnds->at(i)[j]),query->at(i));
			float test_distance = get_distance(points->at(results->at(i)[j]),query->at(i));
			float d= (test_distance - min_distance )/min_distance;
			if(d >4)
				sum +=4;
			else
				sum +=d;
		}
		count += sum /nn;
	}
	return count/ nq;
}

float compute_mean_average_precision (vector<vector<int> >* gnds, vector<vector<int> >* results)
{
	int nq = results->size();
	int nn = results->at(0).size();
	float sum = 0;
	for (int i = 0; i < nq; ++i)
	{
		float rate = 0.0;
		int found = 0;

		std::set<int> gnd_row;
  		for(int j = 0; j <nn; ++j) {
      		gnd_row.insert(gnds->at(i)[j]);
  		}

		for(int j=0;j <nn; j++)
		{
      		if(gnd_row.find(results->at(i)[j]) != gnd_row.end()) 
			{
				found ++;
				rate += 1.0 * found/(j+1);
      		}
    	}
		sum += rate/nn;
	}
	return sum / nq;
}

float compute_discounted_culmulative_gain (vector<vector<int> >* gnds, vector<vector<int> >* results) 
{
	size_t nq = results->size();
	size_t nn = results->at(0).size();
	float sum = 0;
	for (size_t i = 0; i < nq; ++i) 
	{
		float rate = 0.0;

		std::set<int> gnd_row;
  		for(size_t j = 0; j <nn; ++j) {
      		gnd_row.insert(gnds->at(i)[j]);
  		}

		for(size_t j=0;j <nn; j++)
		{
      		if(gnd_row.find(results->at(i)[j]) != gnd_row.end()) 
			{
				rate += 1.0 /log2(j+2);
      		}
    	}
		sum += rate;
	}
	return sum / nq;
}

float compute_recall(vector<vector<int> >* gnds, vector<vector<E_Neighbor> >* results, float* recall)
{
	size_t nq = results->size();
	size_t nn = results->at(0).size();
	cout<<"nq:"<<nq<<" "<<nn<<endl;
	int avg = 0;
	for (size_t i=0; i<nq; ++i) {
		for (size_t j=0; j<nn; ++j) {
			for (size_t k=0;k<nn;++k) {
				if (results->at(i)[j].id == gnds->at(i)[k]) {
					avg ++;
				}
			}
		}
	}
	return float(avg)/(nn*nq);
}

float compute_mean_reciprocal_rank(vector<vector<int> >* gnds, vector<vector<E_Neighbor> >* results)
{
	size_t nq = results->size();
	size_t nn = results->at(0).size();
	float avg = 0.0;
	for (size_t i=0; i<nq; ++i) 
	{
		float rate=0.0;
		for(size_t k=0;k<nn;k++)
		{
			if(gnds->at(i)[0]==results->at(i)[k].id)
			{
				rate +=1.0/(k+1);
				break;
			}
		}
		avg+=rate;
	}
	return avg/nq;
}

float compute_number_closer(vector<vector<int> >* gnds, vector<vector<E_Neighbor> >* results)
{
	size_t nq = results->size();
	size_t nn = results->at(0).size();
	float avg = 0.0;
	for (size_t i=0; i<nq; ++i)
	{
		float rate=0.0;
		for(size_t j=0;j<nn;j++)
		{
			for(size_t k=0;k<nn;k++)
			{
				if(gnds->at(i)[j]==results->at(i)[k].id)
				{
					rate +=(float)(j+1)/(k+1);
					break;
				}
			}
		}
		avg+=rate/nn;
	}
	return avg/nq;
}

float compute_relative_distance_error(vector<vector<float> >* points, vector<vector<float> >* query, vector<vector<int> >* gnds, vector<vector<E_Neighbor> >* results)
{
	size_t nq = results->size();
	size_t nn = results->at(0).size();
	float count = 0.0;
	for (size_t i=0; i<nq; ++i) 
	{
		float sum=0.0;

		for (size_t j=0;j<nn;++j)
		{
			float min_distance= get_distance(points->at(gnds->at(i)[j]),query->at(i));
			float test_distance=results->at(i)[j].dist;
			float d= (test_distance - min_distance )/min_distance;
           
			if(d >4)
				sum +=4;
			else
				sum +=d;
		}
		count += sum /nn;
	}
	return count/ nq;
}


float compute_mean_average_precision (vector<vector<int> >* gnds, vector<vector<E_Neighbor> >* results)
{
	int nq = results->size();
	int nn = results->at(0).size();
	float sum = 0;
	for (int i = 0; i < nq; ++i)
	{
		float rate = 0.0;
		int found = 0;

		std::set<int> gnd_row;
  		for(int j = 0; j <nn; ++j) {
      		gnd_row.insert(gnds->at(i)[j]);
  		}

		for(int j=0;j <nn; j++)
		{
      		if(gnd_row.find(results->at(i)[j].id) != gnd_row.end()) 
			{
				found ++;
				rate += 1.0 * found/(j+1);
      		}
    	}
		sum += rate/nn;
	}
	return sum / nq;
}

float compute_discounted_culmulative_gain (vector<vector<int> >* gnds, vector<vector<E_Neighbor> >* results) 
{
	size_t nq = results->size();
	size_t nn = results->at(0).size();
	float sum = 0;
	for (size_t i = 0; i < nq; ++i) 
	{
		float rate = 0.0;

		std::set<int> gnd_row;
  		for(size_t j = 0; j <nn; ++j) {
      		gnd_row.insert(gnds->at(i)[j]);
  		}

		for(size_t j=0;j <nn; j++)
		{
      		if(gnd_row.find(results->at(i)[j].id) != gnd_row.end()) 
			{
				rate += 1.0 /log2(j+2);
      		}
    	}
		sum += rate;
	}
	return sum / nq;
}

#endif /* EVAL_H_ */


================================================
FILE: algorithms/AGH/src/hammingDist.h
================================================
#ifndef HAMMINGDIST_H_
#define HAMMINGDIST_H_

#include <vector>
#include <cmath>
#include <cstring>
#include <malloc.h>
#include <getopt.h>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include "hierarchical_clustering_index.h"

using namespace std;
using std::string;
using std::vector;
using std::cout;
using std::ifstream;
using std::ios;
using std::endl;

struct B_Neighbor{
	int id;
	int dist;
	B_Neighbor()
	{
		id=0;
		dist=-1;
	}
	int get_id(){return id;}
};

struct E_Neighbor{
	int id;
	float dist;
	E_Neighbor()
	{
		id=0;
		dist=-1;
	}
};

float get_distance(vector<float> point, vector<float> query)
{
	int dim = query.size();
	float dist=0.0;
	for(int i=0; i<dim; i++)
	{
		dist += pow(point[i]-query[i],2);
	}
	return dist;
}

void hammingDist(vector<vector<unsigned> >* B2,vector<vector<unsigned> >* B1, vector<vector<int> >* Dist)
{
	int n = B1->size();
	int nq = B2->size();
	int cbits = B2->at(0).size();
	for(int i=0; i<nq; i++)
	{
		vector<int> d_;
		for(int j=0; j<n; j++)
		{
			int tmp = 0;
			for(int t=0; t<cbits; t++)
			{
				unsigned y = B1->at(j)[t] ^ B2->at(i)[t];
				tmp += char_bit_cnt[y];
			}
			d_.push_back(tmp);
		}
		Dist->push_back(d_);
	}
}

void UpdatePriorityList_Binary (B_Neighbor *BList, B_Neighbor tmp, int len) {
	// find the location to insert
	int j;
    int i = len;
    while (i > 0) {
        j = i - 1;
        if (BList[j].dist <= tmp.dist && BList[j].dist!=-1) break;
        i = j;
    }
	if(i < len)
	{
    	j = len-1;
    	while (j > i) {
        	BList[j] = BList[j-1];
        	--j;
    	}
    	BList[i] = tmp;
	}
}

void hammingDist(vector<vector<unsigned> >* B2,vector<vector<unsigned> >* B1, vector<vector<int> >* Dist,int nn)
{
	int len = nn;
	int n = B1->size();
	int nq = B2->size();
	int cbits = B2->at(0).size();

	for(int i=0; i<nq; i++)//nq
	{
		vector<B_Neighbor> BNN(len);
		for(int j=0; j<n; j++)
		{
			int tmp = 0;
			for(int t=0; t<cbits; t++)
			{
				unsigned y = B1->at(j)[t] ^ B2->at(i)[t];
				tmp += char_bit_cnt[y];
			}

			B_Neighbor b_;
			b_.id=j;
			b_.dist=tmp;

			UpdatePriorityList_Binary ( &BNN[0], b_, len);
		}
		vector<int> d_;
		for(int j=0;j<len;j++)
		{
			d_.push_back(BNN.at(j).id);
		}
		Dist->push_back(d_);
	}
}

void hammingDist_ByRange(vector<vector<unsigned> >* B2,vector<vector<unsigned> >* B1, vector<vector<int> >* IDs,int radis)
{
	int n = B1->size();
	int nq = B2->size();
	int cbits = B2->at(0).size();

	for(int i=0; i<nq; i++)//nq
	{
		vector<int> BNN;
		for(int j=0; j<n; j++)
		{
			int tmp = 0;
			for(int t=0; t<cbits; t++)
			{
				unsigned y = B1->at(j)[t] ^ B2->at(i)[t];
				tmp += char_bit_cnt[y];
			}
			if(tmp<=radis)
				BNN.push_back(j);
		}
		IDs->push_back(BNN);
	}
}

void UpdatePriorityList_Euclidean (E_Neighbor *BList, E_Neighbor tmp, int len) {
	// find the location to insert
	int j;
    int i = len;
    while (i > 0) {
        j = i - 1;
        if (BList[j].dist <= tmp.dist && BList[j].dist!=-1) break;
        i = j;
    }
	if(i < len)
	{
    	j = len-1;
    	while (j > i) {
        	BList[j] = BList[j-1];
        	--j;
    	}
    	BList[i] = tmp;
	}
}

vector<vector<int> > Search(vector<vector<float> >* points, vector<vector<float> >* query, vector<vector<int> >* IDs, int K)
{
	int nq=query->size();
	vector<vector<int> > results;
	for(int i=0; i<nq; i++)
	{
		vector<int> result;
		vector<E_Neighbor> ENN(K);
		int len = IDs->at(i).size();
		vector<int> ids_ = IDs->at(i);
		for(int j=0; j<len; j++)
		{
			float dist = get_distance(query->at(i),points->at(ids_.at(j)));
			E_Neighbor e_;
			e_.id=ids_.at(j);
			e_.dist=dist;
			UpdatePriorityList_Euclidean (&ENN[0], e_, K);
		}
		for(int j=0;j<K;j++)
		{
			result.push_back(ENN[j].id);
		}
		results.push_back(result);
	}
	return results;
}


/*
vector<vector<E_Neighbor> > Search(vector<vector<float> >* points, vector<vector<float> >* query, vector<vector<int> > IDs, int K)
{
	int nq=query->size();
	vector<vector<E_Neighbor> > results;
	for(int i=0; i<nq; i++)
	{
		vector<E_Neighbor> ENN(K);
		int len = IDs.at(i).size();
		vector<int> ids_ = IDs.at(i);
		for(int j=0; j<len; j++)
		{
			float dist = get_distance(query->at(i),points->at(ids_.at(j)));
			E_Neighbor e_;
			e_.id=ids_.at(j);
			e_.dist=dist;
			UpdatePriorityList_Euclidean (&ENN[0], e_, K);
		}
		//for(int j=0;j<K;j++)
		//{
			//cout<<ENN[j].id<<" "<<ENN[j].dist<<endl;
		//}
		results.push_back(ENN);
	}
	return results;
}
*/

#endif /* HAMMINGDIST_H_ */


================================================
FILE: algorithms/AGH/src/heap.h
================================================
#include <algorithm>
#include <vector>


template <typename T>
class Heap
{

    /**
     * Storage array for the heap.
     * Type T must be comparable.
     */
    std::vector<T> heap;
    int length;

    /**
     * Number of element in the heap
     */
    int count;



public:
    /**
     * Constructor.
     *
     * Params:
     *     size = heap size
     */

    Heap(int size)
    {
        length = size;
        heap.reserve(length);
        count = 0;
    }

    /**
     *
     * Returns: heap size
     */
    int size()
    {
        return count;
    }

    /**
     * Tests if the heap is empty
     *
     * Returns: true is heap empty, false otherwise
     */
    bool empty()
    {
        return size()==0;
    }

    /**
     * Clears the heap.
     */
    void clear()
    {
        heap.clear();
        count = 0;
    }

    struct CompareT : public std::binary_function<T,T,bool>
    {
        bool operator()(const T& t_1, const T& t_2) const
        {
            return t_2 < t_1;
        }
    };

    /**
     * Insert a new element in the heap.
     *
     * We select the next empty leaf node, and then keep moving any larger
     * parents down until the right location is found to store this element.
     *
     * Params:
     *     value = the new element to be inserted in the heap
     */
    void insert(const T& value)
    {
        /* If heap is full, then return without adding this element. */
        if (count == length) {
            return;
        }

        heap.push_back(value);
        static CompareT compareT;
        std::push_heap(heap.begin(), heap.end(), compareT);
        ++count;
    }



    /**
     * Returns the node of minimum value from the heap (top of the heap).
     *
     * Params:
     *     value = out parameter used to return the min element
     * Returns: false if heap empty
     */
    bool popMin(T& value)
    {
        if (count == 0) {
            return false;
        }

        value = heap[0];
        static CompareT compareT;
        std::pop_heap(heap.begin(), heap.end(), compareT);
        heap.pop_back();
        --count;

        return true;  /* Return old last node. */
    }
};


template <typename T>
class IntervalHeap
{
	struct Interval
	{
		T left;
		T right;
	};

    /**
     * Storage array for the heap.
     * Type T must be comparable.
     */
    std::vector<Interval> heap;
    size_t capacity_;
    size_t size_;

public:
    /**
     * Constructor.
     *
     * Params:
     *     size = heap size
     */

    IntervalHeap(int capacity) : capacity_(capacity), size_(0)
    {
        heap.resize(capacity/2 + capacity%2 + 1); // 1-based indexing
    }

    /**
     * @return Heap size
     */
    size_t size()
    {
        return size_;
    }

    /**
     * Tests if the heap is empty
     * @return true is heap empty, false otherwise
     */
    bool empty()
    {
        return size_==0;
    }

    /**
     * Clears the heap.
     */
    void clear()
    {
        size_ = 0;
    }

    void insert(const T& value)
    {
        /* If heap is full, then return without adding this element. */
        if (size_ == capacity_) {
            return;
        }

        // insert into the root
        if (size_<2) {
        	if (size_==0) {
        		heap[1].left = value;
        		heap[1].right = value;
        	}
        	else {
        		if (value<heap[1].left) {
        			heap[1].left = value;
        		}
        		else {
        			heap[1].right = value;
        		}
        	}
        	++size_;
        	return;
        }

        size_t last_pos = size_/2 + size_%2;
        bool min_heap;

        if (size_%2) { // odd number of elements
        	min_heap = (value<heap[last_pos].left)? true : false;
        }
        else {
        	++last_pos;
        	min_heap = (value<heap[last_pos/2].left)? true : false;
        }

        if (min_heap) {
        	size_t pos = last_pos;
        	size_t par = pos/2;
        	while (pos>1 && value < heap[par].left) {
        		heap[pos].left = heap[par].left;
        		pos = par;
        		par = pos/2;
        	}
        	heap[pos].left = value;
        	++size_;

        	if (size_%2) { // duplicate element in last position if size is odd
        		heap[last_pos].right = heap[last_pos].left;
        	}
        }
        else {
        	size_t pos = last_pos;
        	size_t par = pos/2;
        	while (pos>1 && heap[par].right < value) {
        		heap[pos].right = heap[par].right;
        		pos = par;
        		par = pos/2;
        	}
        	heap[pos].right = value;
        	++size_;

        	if (size_%2) { // duplicate element in last position if size is odd
        		heap[last_pos].left = heap[last_pos].right;
        	}
        }
    }


    /**
     * Returns the node of minimum value from the heap
     * @param value out parameter used to return the min element
     * @return false if heap empty
     */
    bool popMin(T& value)
    {
        if (size_ == 0) {
            return false;
        }

        value = heap[1].left;
        size_t last_pos = size_/2 + size_%2;
        T elem = heap[last_pos].left;

        if (size_ % 2) { // odd number of elements
        	--last_pos;
        }
        else {
        	heap[last_pos].left = heap[last_pos].right;
        }
        --size_;
        if (size_<2) return true;

        size_t crt=1; // root node
        size_t child = crt*2;

        while (child <= last_pos) {
        	if (child < last_pos && heap[child+1].left < heap[child].left) ++child; // pick the child with min

        	if (!(heap[child].left<elem)) break;

        	heap[crt].left = heap[child].left;
        	if (heap[child].right<elem) {
        		std::swap(elem, heap[child].right);
        	}

        	crt = child;
    		child *= 2;
        }
        heap[crt].left = elem;
        return true;
    }


    /**
     * Returns the element of maximum value from the heap
     * @param value
     * @return false if heap empty
     */
    bool popMax(T& value)
    {
        if (size_ == 0) {
            return false;
        }

        value = heap[1].right;
        size_t last_pos = size_/2 + size_%2;
        T elem = heap[last_pos].right;

        if (size_%2) { // odd number of elements
        	--last_pos;
        }
        else {
        	heap[last_pos].right = heap[last_pos].left;
        }
        --size_;
        if (size_<2) return true;

        size_t crt=1; // root node
        size_t child = crt*2;

        while (child <= last_pos) {
        	if (child < last_pos && heap[child].right < heap[child+1].right) ++child; // pick the child with max

        	if (!(elem < heap[child].right)) break;

        	heap[crt].right = heap[child].right;
        	if (elem<heap[child].left) {
        		std::swap(elem, heap[child].left);
        	}

        	crt = child;
    		child *= 2;
        }
        heap[crt].right = elem;
        return true;
    }


    bool getMin(T& value)
    {
    	if (size_==0) {
    		return false;
    	}
    	value = heap[1].left;
    	return true;
    }


    bool getMax(T& value)
    {
    	if (size_==0) {
    		return false;
    	}
    	value = heap[1].right;
    	return true;
    }
};


template <typename T>
class BoundedHeap
{
	IntervalHeap<T> interval_heap_;
	size_t capacity_;
public:
	BoundedHeap(size_t capacity) : interval_heap_(capacity), capacity_(capacity)
	{

	}

    /**
     * Returns: heap size
     */
    int size()
    {
        return interval_heap_.size();
    }

    /**
     * Tests if the heap is empty
     * Returns: true is heap empty, false otherwise
     */
    bool empty()
    {
        return interval_heap_.empty();
    }

    /**
     * Clears the heap.
     */
    void clear()
    {
    	interval_heap_.clear();
    }

    void insert(const T& value)
    {
    	if (interval_heap_.size()==capacity_) {
    		T max;
    		interval_heap_.getMax(max);
    		if (max<value) return;
   			interval_heap_.popMax(max);
    	}
    	interval_heap_.insert(value);
    }

    bool popMin(T& value)
    {
    	return interval_heap_.popMin(value);
    }
};



================================================
FILE: algorithms/AGH/src/hierarchical_clustering_index.h
================================================
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
#include <iostream>
#include "center_chooser.h"
//#include "char_bit_cnt.h"
#include "dynamic_bitset.h"
#include "heap.h"
#include "result_set.h"

using namespace std;
using std::string;
using std::vector;
using std::cout;
using std::ifstream;
using std::ios;
using std::endl;

//typedef unsigned ElementType;
//typedef int DistanceType;

class HierarchicalClusteringIndex
{
	private:

	int branching_;
    int trees_;
    int leaf_max_size_;

	size_t size_;
 	size_t veclen_;
	size_t size_at_build_;
	size_t last_id_;

	vector<size_t> ids_;
	vector<vector<unsigned>* > points_;
	CenterChooser Centers_;
	
	//DynamicBitset removed_points_;

	void setDataset(vector<vector<unsigned> >& dataset)
    {
    	size_ = dataset.size();
    	//cout<<"size_: "<<size_ <<endl;
    	//veclen_ = dataset->at(0).size();
    	//last_id_ = 0;

    	//ids_.clear();
    	//removed_points_.clear();
    	//removed_ = false;
    	//removed_count_ = 0;

		points_.resize(size_);
		for (size_t i=0;i<size_;i++)
		{
			points_.at(i) = &dataset.at(i);
		}
		//cout<<"points00: "<<points_.at(0)->at(0)<<endl;
    }
	public:

	void set_params(vector<vector<unsigned> >& inputData, int b=32,int t=4,int leaf=100)
    {
        branching_ = b;
        trees_ = t;
        leaf_max_size_ = leaf;

		setDataset(inputData);

        Centers_.setDataset(inputData);
		DynamicBitset checked(size_);
    }


    /**
     * Builds the index
     */
    void buildIndex()
    {
        if (branching_<2) {
            cerr<<"Branching factor must be at least 2"<<endl;
			return;
        }
        tree_roots_.resize(trees_);
        vector<int> indices(size_);
        for (int i=0; i<trees_; ++i) {
            for (size_t j=0; j<size_; ++j) {
                indices[j] = j;
            }
            tree_roots_[i] = new Node();
            //cout<< points_.at(0)->at(0)<<" "<<points_.at(1)->at(0)<<" "<< get_distance(0,1)<<endl;
            computeClustering(tree_roots_[i], &indices[0], size_);
        }
    }

	struct PointInfo
    {
    	
    	size_t index;   /** Point index */
    	
    	vector<unsigned>* point;  /** Point data */
    };



	struct Node
    {
        
    	vector<unsigned>* pivot;  /** The cluster center  */

    	size_t pivot_index;
        
        vector<Node*> childs;        /**   Child nodes (only for non-terminal nodes)  */
        
        vector<PointInfo> points;    /**    Node points (only for terminal nodes)   */

        ~Node()
        {
        	for(size_t i=0; i<childs.size(); i++){
        		childs[i]->~Node();
        	}
        };
    };

	typedef Node* NodePtr;
	struct BranchStruct
	{
    	Node* node;           /* Tree node at which search resumes */
    	int mindist;     /* Minimum distance to query for all nodes below. */

    	BranchStruct() {}
    	BranchStruct(Node* aNode, int dist) : node(aNode), mindist(dist)
    	{//cout<<"branch node:"<<aNode->pivot_index <<" "<<node->pivot_index<<endl;
    	}

    	bool operator<(const BranchStruct& rhs) const
    	{
        	return mindist<rhs.mindist;
    	}
	};
///*
	int get_distance(int p1, int p2)
	{
		int dist=0;
		int cbits = points_.at(0)->size();
		for(int t=0; t<cbits; t++)
		{
			unsigned y = points_.at(p1)->at(t) ^ points_.at(p2)->at(t);
			dist += char_bit_cnt[y];
		}
		return dist;
	}

	
	int get_distance(const vector<unsigned>* p1, const vector<unsigned>* p2)
	{
		int dist=0;
		int cbits = p1->size();
		for(int t=0; t<cbits; t++)
		{
			unsigned y = p1->at(t) ^ p2->at(t);
			dist += char_bit_cnt[y];
		}
		return dist;
	}
//*/

	void computeLabels(int* indices, int indices_length,  int* centers, int centers_length, int* labels)
    {
        for (int i=0; i<indices_length; ++i) {
            int dist = get_distance(indices[i],centers[0]);
            labels[i] = 0;
            for (int j=1; j<centers_length; ++j) {
                int new_dist = get_distance(indices[i],centers[j]); //(points_.at(indices[i]),points_.at(centers[j]));
                if (dist>new_dist) {
                    labels[i] = j;
                    dist = new_dist;
                }
            }
        }
    }

	void computeClustering(Node* node, int* indices, int indices_length)
    {
		//cout<<"begin:"<<indices_length<<endl;
        if (indices_length < leaf_max_size_) { // leaf node
            node->points.resize(indices_length);
            for (int i=0;i<indices_length;++i) {
            	node->points[i].index = indices[i];
            	node->points[i].point = points_.at(indices[i]);
            }
            node->childs.clear();
			//cout<<"indices:"<<indices_length<<"  "<< node->points.size()<<endl;
            return;
        }

        std::vector<int> centers(branching_);
        std::vector<int> labels(indices_length);

        int centers_length;
		Centers_.chooseCenters(branching_, indices, indices_length, &centers[0], centers_length);
		//cout<<"choose centers_length :  "<<centers_length<<endl;

        if (centers_length<branching_) {
            node->points.resize(indices_length);
            for (int i=0;i<indices_length;++i) {
            	node->points[i].index = indices[i];
            	node->points[i].point = points_.at(indices[i]);
            }
            node->childs.clear();
			//cout<<" centers: "<<centers_length<<"  "<< node->points.size()<<endl;
            return;
        }

        //  assign points to clusters
        computeLabels(indices, indices_length, &centers[0], centers_length, &labels[0]);

        node->childs.resize(branching_);
        int start = 0;
        int end = start;
        for (int i=0; i<branching_; ++i) {
            for (int j=0; j<indices_length; ++j) {
                if (labels[j]==i) {
                    std::swap(indices[j],indices[end]);
                    std::swap(labels[j],labels[end]);
                    end++;
                }
            }

            node->childs[i] = new Node();
            node->childs[i]->pivot_index = centers[i];
            node->childs[i]->pivot = points_.at(centers[i]);
            node->childs[i]->points.clear();
            computeClustering(node->childs[i],indices+start, end-start);
            start=end;
        }
    }

	typedef BranchStruct BranchSt;

	void findNN(NodePtr node, ResultSet& result, const vector<unsigned>* vec, int& checks,const int maxChecks,
	                Heap<BranchSt>* heap,  DynamicBitset& checked)
	{
	    if (node->childs.empty())
	    {
	        if (checks>=maxChecks) {
	              if (result.full()) return;
	        }

	        for (size_t i=0; i<node->points.size(); ++i)
	        {
	            PointInfo& pointInfo = node->points[i];
	            if (checked.test(pointInfo.index)) continue;
	            int dist = get_distance(pointInfo.point, vec);
	            result.addPoint(dist, pointInfo.index);
	                checked.set(pointInfo.index);
	                ++checks;
	            }
	        }
	        else {
	            int* domain_distances = new int[branching_];
	            int best_index = 0;
	            domain_distances[best_index] = get_distance(vec, node->childs[best_index]->pivot);
	            for (int i=1; i<branching_; ++i) {
	                domain_distances[i] = get_distance(vec, node->childs[i]->pivot);
	                if (domain_distances[i]<domain_distances[best_index]) {
	                    best_index = i;
	                }
	            }
	            for (int i=0; i<branching_; ++i) {
	                if (i!=best_index) {
	                    heap->insert(BranchSt(node->childs[i],domain_distances[i]));
	                }
	            }
	            delete[] domain_distances;
	            findNN(node->childs[best_index],result,vec, checks, maxChecks, heap, checked);
	        }
	    }



	void findNeighborsWithRemoved(ResultSet& result, const vector<unsigned>* vec, const int maxChecks)
    {
        //int maxChecks = searchParams.checks;

        // Priority queue storing intermediate branches in the best-bin-first search
        Heap<BranchSt>* heap = new Heap<BranchSt>(size_);

        DynamicBitset checked(size_);
        int checks = 0;
        for (int i=0; i<trees_; ++i) {
            findNN(tree_roots_[i], result, vec, checks, maxChecks, heap, checked);
        }

        BranchSt branch;
        while (heap->popMin(branch) && (checks<maxChecks || !result.full())) {
            NodePtr node = branch.node;
            findNN(node, result, vec, checks, maxChecks, heap, checked);
        }

        delete heap;
    }




	int knnSearch(const vector<vector<unsigned> >& queries, vector< vector<int> >& indices,	vector< vector<int> >& dists,size_t knn,const int maxChecks)
    {
        if (indices.size() < queries.size() ) indices.resize(queries.size());
		if (dists.size() < queries.size() )   dists.resize(queries.size());

		int count = 0;

		for (int i = 0; i < (int)queries.size(); i++)
		{
				//resultSet.clear();
				ResultSet resultSet(knn);
				findNeighborsWithRemoved(resultSet, &queries.at(i), maxChecks);
				size_t n = std::min(resultSet.size(), knn);
				indices[i].resize(n);
				dists[i].resize(n);
				if (n>0)
				{
					resultSet.copy(&indices.at(i), &dists.at(i), n);
				}
				count += n;
		}
		return count;
    }

	vector<Node*> tree_roots_;
};



================================================
FILE: algorithms/AGH/src/random.h
================================================
#include <algorithm>
#include <cstdlib>
#include <cstddef>
#include <vector>
/**
 * Seeds the random number generator
 *  @param seed Random seed
 */
inline void seed_random(unsigned int seed)
{
    srand(seed);
}

/*
 * Generates a random double value.
 */
/**
 * Generates a random double value.
 * @param high Upper limit
 * @param low Lower limit
 * @return Random double value
 */
inline double rand_double(double high = 1.0, double low = 0)
{
    return low + ((high-low) * (std::rand() / (RAND_MAX + 1.0)));
}

/**
 * Generates a random integer value.
 * @param high Upper limit
 * @param low Lower limit
 * @return Random integer value
 */
inline int rand_int(int high = RAND_MAX, int low = 0)
{
    return low + (int) ( double(high-low) * (std::rand() / (RAND_MAX + 1.0)));
}


class RandomGenerator
{
public:
    ptrdiff_t operator() (ptrdiff_t i) { return rand_int(i); }
};


/**
 * Random number generator that returns a distinct number from
 * the [0,n) interval each time.
 */
class UniqueRandom
{
    std::vector<int> vals_;
    int size_;
    int counter_;

public:
    /**
     * Constructor.
     * @param n Size of the interval from which to generate
     * @return
     */
    UniqueRandom(int n)
    {
        init(n);
    }

    /**
     * Initializes the number generator.
     * @param n the size of the interval from which to generate random numbers.
     */
    void init(int n)
    {
        static RandomGenerator generator;
        // create and initialize an array of size n
        vals_.resize(n);
        size_ = n;
        for (int i = 0; i < size_; ++i) vals_[i] = i;

        // shuffle the elements in the array
        std::random_shuffle(vals_.begin(), vals_.end(), generator);

        counter_ = 0;
    }

    /**
     * Return a distinct random integer in greater or equal to 0 and less
     * than 'n' on each call. It should be called maximum 'n' times.
     * Returns: a random integer
     */
    int next()
    {
        if (counter_ == size_) {
            return -1;
        }
        else {
            return vals_[counter_++];
        }
    }
};





================================================
FILE: algorithms/AGH/src/result_set.h
================================================
#include <algorithm>
#include <cstring>
#include <iostream>
#include <limits>
#include <set>
#include <vector>


struct DistanceIndex
{
    DistanceIndex(int dist, int index) :
        dist_(dist), index_(index)
    {
    }
    bool operator<(const DistanceIndex& dist_index) const
    {
        return (dist_ < dist_index.dist_) || ((dist_ == dist_index.dist_) && index_ < dist_index.index_);
    }
    int dist_;
    int index_;
};


class ResultSet
{
public:
	//typedef DistanceIndex<int> DistIndex;

	ResultSet(size_t capacity_) :
        capacity_(capacity_)
    {
		// reserving capacity to prevent memory re-allocations
		dist_index_.reserve(capacity_);
    	clear();
    }

    ~ResultSet()
    {
    }

    /**
     * Clears the result set
     */
    void clear()
    {
        dist_index_.clear();
        worst_dist_ = std::numeric_limits<int>::max();
        is_full_ = false;
    }

    /**
     *
     * @return Number of elements in the result set
     */
    size_t size() const
    {
        return dist_index_.size();
    }

    /**
     * Radius search result set always reports full
     * @return
     */
    bool full()
    {
        return is_full_;
    }

    /**
     * Add another point to result set
     * @param dist distance to point
     * @param index index of point
     * Pre-conditions: capacity_>0
     */
    void addPoint(int dist, int index)
    {
    	if (dist>=worst_dist_) return;

    	if (dist_index_.size()==capacity_) {
    		// if result set if filled to capacity, remove farthest element
    		std::pop_heap(dist_index_.begin(), dist_index_.end());
        	dist_index_.pop_back();
    	}

    	// add new element
    	dist_index_.push_back(DistanceIndex(dist,index));
    	if (is_full_) { // when is_full_==true, we have a heap
    		std::push_heap(dist_index_.begin(), dist_index_.end());
    	}

    	if (dist_index_.size()==capacity_) {
    		if (!is_full_) {
    			std::make_heap(dist_index_.begin(), dist_index_.end());
            	is_full_ = true;
    		}
    		// we replaced the farthest element, update worst distance
        	worst_dist_ = dist_index_[0].dist_;
        }
    }

    /**
     * Copy indices and distances to output buffers
     * @param indices
     * @param dists
     * @param num_elements Number of elements to copy
     * @param sorted Indicates if results should be sorted
     */
    void copy(vector<int>* indices, vector<int>* dists, size_t num_elements)
    {
    		// std::sort_heap(dist_index_.begin(), dist_index_.end());
    		// sort seems faster here, even though dist_index_ is a heap
    	//std::sort(dist_index_.begin(), dist_index_.end());

    	size_t n = std::min(dist_index_.size(), num_elements);
    	for (size_t i=0; i<n; ++i) {
    		indices->at(i) = dist_index_[i].index_;
    		dists->at(i) = dist_index_[i].dist_;
    	}
    }

    int worstDist() const
    {
    	return worst_dist_;
    }

private:
    size_t capacity_;
    int worst_dist_;
    std::vector<DistanceIndex> dist_index_;
    bool is_full_;
};


================================================
FILE: algorithms/Annoy/README.html
================================================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="generator" content="pandoc" />
  <title></title>
  <style type="text/css">code{white-space: pre;}</style>
</head>
<body>
<h1 id="annoy">Annoy</h1>
<p>Annoy (Approximate Nearest Neighbors Oh Yeah) is a C++ library with Python bindings to search for approximate nearest neighbor search with L2 or angular distance. The version here is based on Annoy's source code obtained on 5 April 2016. Please refer to <a href="https://github.com/spotify/annoy"><strong>Annoy</strong> at GitHub</a> for more details.</p>
<h2 id="prerequisites">Prerequisites</h2>
<ul>
<li>linux system</li>
<li>A <a href="https://github.com/DBWangGroupUNSW/nns_benchmark/tree/master/data">sample data</a> (e.g., audio) has been downloaded, which includes its data points, query points, and ground truth results. Note that we need to change data format later. All data files downloaded should be put in the <code>./knn_benchmark/data</code> directory.</li>
</ul>
<h2 id="compile-annoysrc">Compile (Annoy/src)</h2>
<p>build the Annoy trees construction and Annoy search programs.</p>
<pre><code>make</code></pre>
<h2 id="construct-annoy-trees-and-conduct-search-dpgscript">Construct Annoy trees and conduct search (DPG/script)</h2>
<pre><code>run.sh</code></pre>
<p>Note that, in our experiment paper, we vary the number of data points explored to achieve the trade-off between search speed and search quality (recall). This is exactly the same with KGraph.</p>
</body>
</html>


================================================
FILE: algorithms/Annoy/README.md
================================================
# Annoy 

Annoy (Approximate Nearest Neighbors Oh Yeah) is a C++ library with Python
bindings to search for approximate nearest neighbor search with L2 or angular
distance. The version here is based on Annoy's source code obtained on 5
April 2016. Please refer to
[**Annoy** at GitHub](https://github.com/spotify/annoy) for more details.



## Prerequisites

- linux system 
- A
  [sample data ](https://github.com/DBWangGroupUNSW/nns_benchmark/tree/master/data)
  (e.g., audio) has been downloaded, which includes its data points, query
  points, and ground truth results. Note that we need to change data format
  later. All data files downloaded should be put in the `./knn_benchmark/data`
  directory.

 
## Compile (Annoy/src)

build the Annoy trees construction and Annoy search programs.

```
make
```


## Construct Annoy trees and conduct search (DPG/script)

```
run.sh
```

Note that, in our experiment paper, we vary the number of data points explored to achieve the trade-off between search speed and search quality (recall). This is exactly the same with KGraph.




================================================
FILE: algorithms/Annoy/script/indexer.sh
================================================
data_path=$1 # ./fvecs
trees=$2     # the number of tree
index_path=$3    
indextime_path=$4

cd ../src

./indexer -i ${index_path} -d ${data_path} -o ${indextime_path} -t ${trees}


================================================
FILE: algorithms/Annoy/script/run.sh
================================================

k=20
ntree=50

mkdir ../index 
sh ./indexer.sh ../../../data/audio_base.fvecs ${ntree} ../index/audio.${ntree}tree ../index/index_${ntree}.txt

mkdir ../result

sh ./searcher.sh ../index/audio.${ntree}tree ../../../data/audio_query.fvecs ../../../data/audio_groundtruth.fvecs ${k} ../result/audio_${ntree}tree.txt



================================================
FILE: algorithms/Annoy/script/searcher.sh
================================================
index_path=$1
query_path=$2 # ./fvecs
gnd_path=$3 # ./ivecs
k=$4
output_path=$5

cd ../src

for stop in 100 300 400 500 800 1000
do

./searcher -i ${index_path} -q ${query_path} -g ${gnd_path} -o ${output_path} -k ${k} -c ${stop}  
done




================================================
FILE: algorithms/Annoy/src/Makefile
================================================
CC=g++
CCFLAGS=-O3 -lm -fPIC -fomit-frame-pointer -fno-stack-protector 
CPP_FILES=annoy.cpp
OBJ_FILES=$(CPP_FILES:%.cpp=%.o)

# Compile a single file.
%.o: %.cpp %.h
	$(CC) $(CCFLAGS) -c $<

# Main target.
all: indexer searcher
	rm -f *.o

indexer: $(OBJ_FILES) indexer.o
	rm -f $@
	g++ -fPIC $(OBJ_FILES) indexer.o -o $@

searcher: $(OBJ_FILES) searcher.o
	rm -f $@
	g++ -fPIC $(OBJ_FILES) searcher.o -o $@

clean: 
	rm -f *~ *.o
	rm indexer searcher

# Declare phony targets.
.PHONY: all clean



================================================
FILE: algorithms/Annoy/src/annoy.cpp
================================================
// Copyright (c) 2013 Spotify AB
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.

#ifndef ANNOYLIB_H
#define ANNOYLIB_H

#include <stdio.h>
#include <string>
#include <sys/stat.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <fcntl.h>
#include <stddef.h>
#include <stdint.h>

#ifdef __MINGW32__
#include "mman.h"
#include <windows.h>
#else
#include <sys/mman.h>
#endif

#include <string.h>
#include <math.h>
#include <vector>
#include <algorithm>
#include <queue>
#include <limits>
#include <iostream>
using namespace std;
using std::cout;
using std::endl;

// This allows others to supply their own logger / error printer without
// requiring Annoy to import their headers. See RcppAnnoy for a use case.
#ifndef __ERROR_PRINTER_OVERRIDE__
  #define showUpdate(...) { fprintf(stderr, __VA_ARGS__ ); }
#else
  #define showUpdate(...) { __ERROR_PRINTER_OVERRIDE__( __VA_ARGS__ ); }
#endif

#ifndef ANNOY_NODE_ATTRIBUTE
  #define ANNOY_NODE_ATTRIBUTE __attribute__((__packed__))
  // TODO: this is turned on by default, but may not work for all architectures! Need to investigate.
#endif


using std::vector;
using std::string;
using std::pair;
using std::numeric_limits;
using std::make_pair;

struct RandRandom {
  // Default implementation of annoy-specific random number generator that uses rand() from standard library.
  // Owned by the AnnoyIndex, passed around to the distance metrics
  inline int flip() {
    // Draw random 0 or 1
    return rand() & 1;
  }
  inline size_t index(size_t n) {
    // Draw random integer between 0 and n-1 where n is at most the number of data points you have
    return rand() % n;
  }
};

template<typename T>
inline T get_norm(T* v, int f) {
  T sq_norm = 0;
  for (int z = 0; z < f; z++)
    sq_norm += v[z] * v[z];
  return sqrt(sq_norm);
}

template<typename T>
inline void normalize(T* v, int f) {
  T norm = get_norm(v, f);
  for (int z = 0; z < f; z++)
    v[z] /= norm;
}

template<typename T, typename Random, typename Distance, typename Node>
inline void two_means(const vector<Node*>& nodes, int f, Random& random, bool cosine, T* iv, T* jv) {
  /*
    This algorithm is a huge heuristic. Empirically it works really well, but I
    can't motivate it well. The basic idea is to keep two centroids and assign
    points to either one of them. We weight each centroid by the number of points
    assigned to it, so to balance it. 
  */
  static int iteration_steps = 200;
  size_t count = nodes.size();

  size_t i = random.index(count);
  size_t j = random.index(count-1);
  j += (j >= i); // ensure that i != j
  std::copy(&nodes[i]->v[0], &nodes[i]->v[f], &iv[0]);
  std::copy(&nodes[j]->v[0], &nodes[j]->v[f], &jv[0]);
  if (cosine) { normalize(&iv[0], f); normalize(&jv[0], f); }

  int ic = 1, jc = 1;
  for (int l = 0; l < iteration_steps; l++) {
    size_t k = random.index(count);
    T di = ic * Distance::distance(&iv[0], nodes[k]->v, f),
      dj = jc * Distance::distance(&jv[0], nodes[k]->v, f);
    T norm = cosine ? get_norm(nodes[k]->v, f) : 1.0;
    if (di < dj) {
      for (int z = 0; z < f; z++)
	iv[z] = (iv[z] * ic + nodes[k]->v[z] / norm) / (ic + 1);
      ic++;
    } else if (dj < di) {
      for (int z = 0; z < f; z++)
	jv[z] = (jv[z] * jc + nodes[k]->v[z] / norm) / (jc + 1);
      jc++;
    }
  }
}


struct Angular {
  template<typename S, typename T>
  struct ANNOY_NODE_ATTRIBUTE Node {
    /*
     * We store a binary tree where each node has two things
     * - A vector associated with it
     * - Two children
     * All nodes occupy the same amount of memory
     * All nodes with n_descendants == 1 are leaf nodes.
     * A memory optimization is that for nodes with 2 <= n_descendants <= K,
     * we skip the vector. Instead we store a list of all descendants. K is
     * determined by the number of items that fits in the space of the vector.
     * For nodes with n_descendants == 1 the vector is a data point.
     * For nodes with n_descendants > K the vector is the normal of the split plane.
     * Note that we can't really do sizeof(node<T>) because we cheat and allocate
     * more memory to be able to fit the vector outside
     */
    S n_descendants;
    S children[2]; // Will possibly store more than 2
    T v[1]; // We let this one overflow intentionally. Need to allocate at least 1 to make GCC happy
  };
  template<typename T>
  static inline T distance(const T* x, const T* y, int f) {
    // want to calculate (a/|a| - b/|b|)^2
    // = a^2 / a^2 + b^2 / b^2 - 2ab/|a||b|
    // = 2 - 2cos
    T pp = 0, qq = 0, pq = 0;
    for (int z = 0; z < f; z++, x++, y++) {
      pp += (*x) * (*x);
      qq += (*y) * (*y);
      pq += (*x) * (*y);
    }
    T ppqq = pp * qq;
    if (ppqq > 0) return 2.0 - 2.0 * pq / sqrt(ppqq);
    else return 2.0; // cos is 0
  }
  template<typename S, typename T>
  static inline T margin(const Node<S, T>* n, const T* y, int f) {
    T dot = 0;
    for (int z = 0; z < f; z++)
      dot += n->v[z] * y[z];
    return dot;
  }
  template<typename S, typename T, typename Random>
  static inline bool side(const Node<S, T>* n, const T* y, int f, Random& random) {
    T dot = margin(n, y, f);
    if (dot != 0)
      return (dot > 0);
    else
      return random.flip();
  }
  template<typename S, typename T, typename Random>
  static inline void create_split(const vector<Node<S, T>*>& nodes, int f, Random& random, Node<S, T>* n) {
    vector<T> best_iv(f, 0), best_jv(f, 0); // TODO: avoid allocation
    two_means<T, Random, Angular, Node<S, T> >(nodes, f, random, true, &best_iv[0], &best_jv[0]);
    for (int z = 0; z < f; z++)
      n->v[z] = best_iv[z] - best_jv[z];
    normalize(n->v, f);
  }
  template<typename T>
  static inline T normalized_distance(T distance) {
    // Used when requesting distances from Python layer
    // Turns out sometimes the squared distance is -0.0
    // so we have to make sure it's a positive number.
    return sqrt(std::max(distance, T(0)));
  }
};

struct Euclidean {
  template<typename S, typename T>
  struct ANNOY_NODE_ATTRIBUTE Node {
    S n_descendants;
    T a; // need an extra constant term to determine the offset of the plane
    S children[2];
    T v[1];
  };

  template<typename T>
  static inline T distance(const T* x, const T* y, int f) {
    T d = 0.0;
    for (int i = 0; i < f; i++, x++, y++)
      d += ((*x) - (*y)) * ((*x) - (*y));
    return d;
  }
  template<typename S, typename T>
  static inline T margin(const Node<S, T>* n, const T* y, int f) {
    T dot = n->a;
    for (int z = 0; z < f; z++)
      dot += n->v[z] * y[z];
    return dot;
  }
  template<typename S, typename T, typename Random>
  static inline bool side(const Node<S, T>* n, const T* y, int f, Random& random) {
    T dot = margin(n, y, f);
    if (dot != 0)
      return (dot > 0);
    else
      return random.flip();
  }
  template<typename S, typename T, typename Random>
  static inline void create_split(const vector<Node<S, T>*>& nodes, int f, Random& random, Node<S, T>* n) {
    vector<T> best_iv(f, 0), best_jv(f, 0);
    two_means<T, Random, Euclidean, Node<S, T> >(nodes, f, random, false, &best_iv[0], &best_jv[0]);

    for (int z = 0; z < f; z++)
      n->v[z] = best_iv[z] - best_jv[z];
    normalize(n->v, f);
    n->a = 0.0;
    for (int z = 0; z < f; z++)
      n->a += -n->v[z] * (best_iv[z] + best_jv[z]) / 2;
  }
  template<typename T>
  static inline T normalized_distance(T distance) {
    return sqrt(std::max(distance, T(0)));
  }
};

template<typename S, typename T>
class AnnoyIndexInterface {
 public:
  virtual ~AnnoyIndexInterface() {};
  virtual void add_item(S item, const T* w) = 0;
  virtual void build(int q) = 0;
  virtual bool save(const char* filename) = 0;
  virtual void unload() = 0;
  virtual bool load(const char* filename) = 0;
  virtual T get_distance(S i, S j) = 0;
  virtual void get_nns_by_item(S item, size_t n, size_t search_k, vector<S>* result, vector<T>* distances) = 0;
  virtual void get_nns_by_vector(const T* w, size_t n, size_t search_k, vector<S>* result, vector<T>* distances) = 0;
  virtual S get_n_items() = 0;
  virtual void verbose(bool v) = 0;
  virtual void get_item(S item, T* v) = 0;
};

template<typename S, typename T, typename Distance, typename Random>
  class AnnoyIndex : public AnnoyIndexInterface<S, T> {
  /*
   * We use random projection to build a forest of binary trees of all items.
   * Basically just split the hyperspace into two sides by a hyperplane,
   * then recursively split each of those subtrees etc.
   * We create a tree like this q times. The default q is determined automatically
   * in such a way that we at most use 2x as much memory as the vectors take.
   */
public:
  typedef Distance D;
  typedef typename D::template Node<S, T> Node;

protected:
  int _f;
  size_t _s;
  S _n_items;
  Random _random;
  void* _nodes; // Could either be mmapped, or point to a memory buffer that we reallocate
  S _n_nodes;
  S _nodes_size;
  vector<S> _roots;
  S _K;
  bool _loaded;
  bool _verbose;
  int _fd;
public:

  AnnoyIndex(int f) : _random() {
    _f = f;
    _s = offsetof(Node, v) + f * sizeof(T); // Size of each node
    _verbose = false;
    _K = (_s - offsetof(Node, children)) / sizeof(S); // Max number of descendants to fit into node
    reinitialize(); // Reset everything
  }
  ~AnnoyIndex() {
    unload();
  }

  void add_item(S item, const T* w) {
    _allocate_size(item + 1);
    Node* n = _get(item);

    n->children[0] = 0;
    n->children[1] = 0;
    n->n_descendants = 1;

    for (int z = 0; z < _f; z++)
      n->v[z] = w[z];

    if (item >= _n_items)
      _n_items = item + 1;
  }

  void build(int q) {
    if (_loaded) {
      // TODO: throw exception
      showUpdate("You can't build a loaded index\n");
      return;
    }
    cerr << endl;
    _n_nodes = _n_items;
    while (1) {
      if (q == -1 && _n_nodes >= _n_items * 2)
        break;
      if (q != -1 && _roots.size() >= (size_t)q)
        break;
      if (_verbose) showUpdate("pass %zd...\n", _roots.size());

      vector<S> indices;
      for (S i = 0; i < _n_items; i++)
        indices.push_back(i);

      _roots.push_back(_make_tree(indices));
      cerr << "*";
    }
    cerr << endl;
    
    // Also, copy the roots into the last segment of the array
    // This way we can load them faster without reading the whole file
    _allocate_size(_n_nodes + (S)_roots.size());
    for (size_t i = 0; i < _roots.size(); i++)
      memcpy(_get(_n_nodes + (S)i), _get(_roots[i]), _s);
    _n_nodes += _roots.size();

    if (_verbose) showUpdate("has %d nodes\n", _n_nodes);
  }

  bool save(const char* filename) {
    FILE *f = fopen(filename, "w");
    if (f == NULL)
      return false;

    fwrite(_nodes, _s, _n_nodes, f);
    fclose(f);
/*
    unload();
    return load(filename);*/
	  return true;
  }

  void reinitialize() {
    _fd = 0;
    _nodes = NULL;
    _loaded = false;
    _n_items = 0;
    _n_nodes = 0;
    _nodes_size = 0;
    _roots.clear();
  }

  void unload() {
    if (_fd) {
      // we have mmapped data
      close(_fd);
      off_t size = _n_nodes * _s;
      munmap(_nodes, size);
    } else if (_nodes) {
      // We have heap allocated data
      free(_nodes);
    }
    reinitialize();
    if (_verbose) showUpdate("unloaded\n");
  }

  bool load(const char* filename) {
    FILE *f = fopen(filename, "r");
		fseek(f, 0, SEEK_END);
		off_t size = ftell(f);
    fseek(f, 0, SEEK_SET);
    _n_nodes = (S)(size / _s);
    _nodes = realloc(_nodes, _s * _n_nodes);
		fread(_nodes, _s, _n_nodes, f);

    // Find the roots by scanning the end of the file and taking the nodes with most descendants
    S m = -1;
    for (S i = _n_nodes - 1; i >= 0; i--) {
      S k = _get(i)->n_descendants;
      if (m == -1 || k == m) {
        _roots.push_back(i);
        m = k;
      } else {
        break;
      }
    }
    // hacky fix: since the last root precedes the copy of all roots, delete it
    if (_roots.size() > 1 && _get(_roots.front())->children[0] == _get(_roots.back())->children[0])
      _roots.pop_back();
    _loaded = true;
    _n_items = m;
    if (_verbose) showUpdate("found %lu roots with degree %d\n", _roots.size(), m);
    return true;
  }

  T get_distance(S i, S j) {
    const T* x = _get(i)->v;
    const T* y = _get(j)->v;
    return D::distance(x, y, _f);
  }

  void get_nns_by_item(S item, size_t n, size_t search_k, vector<S>* result, vector<T>* distances) {
    const Node* m = _get(item);
    _get_all_nns(m->v, n, search_k, result, distances);
  }

  void get_nns_by_vector(const T* w, size_t n, size_t search_k, vector<S>* result, vector<T>* distances) {
    _get_all_nns(w, n, search_k, result, distances);
  }
  S get_n_items() {
    return _n_items;
  }
  void verbose(bool v) {
    _verbose = v;
  }

  void get_item(S item, T* v) {
    Node* m = _get(item);
    std::copy(&m->v[0], &m->v[_f], v);
  }

protected:
  void _allocate_size(S n) {
    if (n > _nodes_size) {
      const double reallocation_factor = 1.3;
      S new_nodes_size = std::max(n,
				  (S)((_nodes_size + 1) * reallocation_factor));
      if (_verbose) showUpdate("Reallocating to %d nodes\n", new_nodes_size);
      _nodes = realloc(_nodes, _s * new_nodes_size);
      memset((char *)_nodes + (_nodes_size * _s)/sizeof(char), 0, (new_nodes_size - _nodes_size) * _s);
      _nodes_size = new_nodes_size;
    }
  }

  inline Node* _get(S i) {
    return (Node*)((uint8_t *)_nodes + (_s * i));
  }

  S _make_tree(const vector<S >& indices) {
    if (indices.size() == 1)
      return indices[0];

    if (indices.size() <= (size_t)_K) {
      _allocate_size(_n_nodes + 1);
      S item = _n_nodes++;
      Node* m = _get(item);
      m->n_descendants = (S)indices.size();

      // Using std::copy instead of a loop seems to resolve issues #3 and #13,
      // probably because gcc 4.8 goes overboard with optimizations.
      std::copy(indices.begin(), indices.end(), m->children);
      return item;
    }

    vector<Node*> children;
    for (size_t i = 0; i < indices.size(); i++) {
      S j = indices[i];
      Node* n = _get(j);
      if (n)
        children.push_back(n);
    }

  	vector<S> children_indices[2];
  	Node* m = (Node*)malloc(_s); // TODO: avoid
  	D::create_split(children, _f, _random, m);

  	for (size_t i = 0; i < indices.size(); i++) {
    	S j = indices[i];
    	Node* n = _get(j);
    	if (n) {
      	bool side = D::side(m, n->v, _f, _random);
      	children_indices[side].push_back(j);
    	}
    }

    // If we didn't find a hyperplane, just randomize sides as a last option
    while (children_indices[0].size() == 0 || children_indices[1].size() == 0) {
      if (_verbose && indices.size() > 100000)
        showUpdate("Failed splitting %lu items\n", indices.size());

      children_indices[0].clear();
      children_indices[1].clear();

      // Set the vector to 0.0
      for (int z = 0; z < _f; z++)
        m->v[z] = 0.0;

      for (size_t i = 0; i < indices.size(); i++) {
        S j = indices[i];
        // Just randomize...
        children_indices[_random.flip()].push_back(j);
      }
    }

    int flip = (children_indices[0].size() > children_indices[1].size());
    //std::cout<<children_indices[0].size() << " "<<children_indices[1].size()<<std::endl;
    m->n_descendants = (S)indices.size();
    for (int side = 0; side < 2; side++)
      // run _make_tree for the smallest child first (for cache locality)
      m->children[side^flip] = _make_tree(children_indices[side^flip]);

    _allocate_size(_n_nodes + 1);
    S item = _n_nodes++;
    memcpy(_get(item), m, _s);
    free(m);

    return item;
  }

  void _get_all_nns(const T* v, size_t n, size_t search_k, vector<S>* result, vector<T>* distances) {
    std::priority_queue<pair<T, S> > q;

    if (search_k == (size_t)-1)
      search_k = n * _roots.size(); // slightly arbitrary default value

    for (size_t i = 0; i < _roots.size(); i++) {
      q.push(make_pair(numeric_limits<T>::infinity(), _roots[i]));
    }

    vector<S> nns;
    while (nns.size() < search_k && !q.empty()) {
      const pair<T, S>& top = q.top();
      T d = top.first;
      S i = top.second;
      Node* nd = _get(i);
      q.pop();
      if (nd->n_descendants == 1) {
        nns.push_back(i);
      } else if (nd->n_descendants <= _K) {
        const S* dst = nd->children;
        nns.insert(nns.end(), dst, &dst[nd->n_descendants]);
      } else {
        T margin = D::margin(nd, v, _f);
        q.push(make_pair(std::min(d, +margin), nd->children[1]));
        q.push(make_pair(std::min(d, -margin), nd->children[0]));
      }
    }

    // Get distances for all items
    // To avoid calculating distance multiple times for any items, sort by id
    sort(nns.begin(), nns.end());
    vector<pair<T, S> > nns_dist;
    S last = -1;
    for (size_t i = 0; i < nns.size(); i++) {
      S j = nns[i];
      if (j == last)
        continue;
      last = j;
      nns_dist.push_back(make_pair(D::distance(v, _get(j)->v, _f), j));
    }

    size_t m = nns_dist.size();
    size_t p = n < m ? n : m; // Return this many items
    std::partial_sort(&nns_dist[0], &nns_dist[p], &nns_dist[m]);
    for (size_t i = 0; i < p; i++) {
      if (distances)
        distances->push_back(D::normalized_distance(nns_dist[i].first));
      result->push_back(nns_dist[i].second);
    }
		result->push_back(m);
  }
};

#endif
// vim: tabstop=2 shiftwidth=2


================================================
FILE: algorithms/Annoy/src/data.h
================================================
#ifndef WDONG_KGRAPH_DATA
#define WDONG_KGRAPH_DATA

#include <cstring>
#include <malloc.h>
#include <vector>
#include <cmath>
#include <fstream>
#include <stdexcept>
#include <boost/assert.hpp>

#ifdef __GNUC__
#ifdef __AVX__
#define KGRAPH_MATRIX_ALIGN 32
#else
#ifdef __SSE2__
#define KGRAPH_MATRIX_ALIGN 16
#else
#define KGRAPH_MATRIX_ALIGN 4
#endif
#endif
#endif

namespace kgraph {

    /// L2 square distance with AVX instructions.
    /** AVX instructions have strong alignment requirement for t1 and t2.
     */
    extern float float_l2sqr_avx (float const *t1, float const *t2, unsigned dim);
    /// L2 square distance with SSE2 instructions.
    extern float float_l2sqr_sse2 (float const *t1, float const *t2, unsigned dim);
    /// L2 square distance for uint8_t with SSE2 instructions (for SIFT).
    extern float uint8_l2sqr_sse2 (uint8_t const *t1, uint8_t const *t2, unsigned dim);

    using std::vector;
    using std::runtime_error;

    /// namespace for various distance metrics.
    namespace metric {
        /// L2 square distance.
        struct l2sqr {
            template <typename T>
            static float apply (T const *t1, T const *t2, unsigned dim) {
	      //				cout<<"apply \n";
                float r = 0;
                for (unsigned i = 0; i < dim; ++i) {
                    float v = float(t1[i]) - float(t2[i]);
                    v *= v;
                    r += v;
                }
                return r;
            }
        };
        /// L2 distance.
        struct l2 {
            template <typename T>
            static float apply (T const *t1, T const *t2, unsigned dim) {
                return sqrt(l2sqr::apply<T>(t1, t2, dim));
            }
        };
    }

    /// Matrix data.
    template <typename T, unsigned A = KGRAPH_MATRIX_ALIGN>
    class Matrix {
        unsigned col;
        unsigned row;
        size_t stride;
        char *data;

        void reset (unsigned r, unsigned c) {
            row = r;
            col = c;
            stride = (sizeof(T) * c + A - 1) / A * A;
            /*
            data.resize(row * stride);
            */
            if (data) free(data);
            data = (char *)memalign(A, row * stride); // SSE instruction needs data to be aligned
            if (!data) throw runtime_error("memalign");
        }
    public:
        Matrix (): col(0), row(0), stride(0), data(0) {}
        Matrix (unsigned r, unsigned c): data(0) {
            reset(r, c);
        }
        ~Matrix () {
            if (data) free(data);
        }
        unsigned size () const {
            return row;
        }
        unsigned dim () const {
            return col;
        }
        size_t step () const {
            return stride;
        }
        void resize (unsigned r, unsigned c) {
            reset(r, c);
        }
        T const *operator [] (unsigned i) const {
            return reinterpret_cast<T const *>(&data[stride * i]);
        }
        T *operator [] (unsigned i) {
            return reinterpret_cast<T *>(&data[stride * i]);
        }
        void zero () {
            memset(data, 0, row * stride);
        }
        void load (const std::string &path, unsigned dim, unsigned skip = 0, unsigned gap = 0) {
            std::ifstream is(path.c_str(), std::ios::binary);
            BOOST_VERIFY(is);
            is.seekg(0, std::ios::end);
            size_t size = is.tellg();
            size -= skip;
            unsigned line = sizeof(T) * dim + gap;
            unsigned N =  size / line;
            reset(N, dim);
            zero();
            is.seekg(skip, std::ios::beg);
            for (unsigned i = 0; i < N; ++i) {
                is.read(&data[stride * i], sizeof(T) * dim);
                is.seekg(gap, std::ios::cur);
            }
            BOOST_VERIFY(is);
        }

        void load_lshkit (std::string const &path) {
            static const unsigned LSHKIT_HEADER = 3;
            std::ifstream is(path.c_str(), std::ios::binary);
            unsigned header[LSHKIT_HEADER]; /* entry size, row, col */
            is.read((char *)header, sizeof header);
            BOOST_VERIFY(is);
            BOOST_VERIFY(header[0] == sizeof(T));
            is.close();
            unsigned D = header[2];
            unsigned skip = LSHKIT_HEADER * sizeof(unsigned);
            unsigned gap = 0;
            load(path, D, skip, gap);
        }

        void save_lshkit (std::string const &path) {
            std::ofstream os(path.c_str(), std::ios::binary);
            unsigned header[3];
            assert(sizeof header == 3*4);
            header[0] = sizeof(T);
            header[1] = row;
            header[2] = col;
            os.write((const char *)header, sizeof(header));
            for (unsigned i = 0; i < row; ++i) {
                os.write(&data[stride * i], sizeof(T) * col);
            }
        }
    };

    /// Matrix proxy to interface with 3rd party libraries (FLANN, OpenCV, NumPy).
    template <typename DATA_TYPE, unsigned A = KGRAPH_MATRIX_ALIGN>
    class MatrixProxy {
        unsigned rows;
        unsigned cols;      // # elements, not bytes, in a row,
        size_t stride;    // # bytes in a row, >= cols * sizeof(element)
        uint8_t const *data;
    public:
        MatrixProxy (Matrix<DATA_TYPE> const &m)
            : rows(m.size()), cols(m.dim()), stride(m.step()), data(reinterpret_cast<uint8_t const *>(m[0])) {
        }

#ifndef __AVX__
#ifdef FLANN_DATASET_H_
        /// Construct from FLANN matrix.
        MatrixProxy (flann::Matrix<DATA_TYPE> const &m)
            : rows(m.rows), cols(m.cols), stride(m.stride), data(m.data) {
            BOOST_VERIFY(stride % A == 0);
        }
#endif
#ifdef __OPENCV_CORE_HPP__
        /// Construct from OpenCV matrix.
        MatrixProxy (cv::Mat const &m)
            : rows(m.rows), cols(m.cols), stride(m.step), data(m.data) {
            BOOST_VERIFY(stride % A == 0);
        }
#endif
#ifdef NPY_NDARRAYOBJECT_H
        /// Construct from NumPy matrix.
        MatrixProxy (PyArrayObject *obj) {
            BOOST_VERIFY(obj->nd == 2);
            rows = obj->dimensions[0];
            cols = obj->dimensions[1];
            stride = obj->strides[0];
            data = reinterpret_cast<uint8_t const *>(obj->data);
            BOOST_VERIFY(obj->descr->elsize == sizeof(DATA_TYPE));
            BOOST_VERIFY(stride % A == 0);
            BOOST_VERIFY(stride >= cols * sizeof(DATA_TYPE));
        }
#endif
#endif
        unsigned size () const {
            return rows;
        }
        unsigned dim () const {
            return cols;
        }
        DATA_TYPE const *operator [] (unsigned i) const {
            return reinterpret_cast<DATA_TYPE const *>(data + stride * i);
        }
    };

    /// Oracle for matrix data.
    /** DATA_TYPE can be Matrix or MatrixProxy,
    * DIST_TYPE should be one class within the namespace kgraph.metric.
    */
    template <typename DATA_TYPE, typename DIST_TYPE>
    class MatrixOracle: public kgraph::IndexOracle {
        MatrixProxy<DATA_TYPE> proxy;
    public:
        class SearchOracle: public kgraph::SearchOracle {
            MatrixProxy<DATA_TYPE> proxy;
            DATA_TYPE const *query;
        public:
            SearchOracle (MatrixProxy<DATA_TYPE> const &p, DATA_TYPE const *q): proxy(p), query(q) {
            }
            virtual unsigned size () const {
                return proxy.size();
            }
            virtual float operator () (unsigned i) const {
                return DIST_TYPE::apply(proxy[i], query, proxy.dim());
            }
        };
        template <typename MATRIX_TYPE>
        MatrixOracle (MATRIX_TYPE const &m): proxy(m) {
        }
        virtual unsigned size () const {
            return proxy.size();
        }
        virtual float operator () (unsigned i, unsigned j) const {
            return DIST_TYPE::apply(proxy[i], proxy[j], proxy.dim());
        }

	virtual float angle (unsigned orign, unsigned pivot, unsigned x) const { // return cos(\theta), where \theta is the angle between vector orign - pivot and orign - x
	  float dot_prod = 0.0, norm = 0.0, norm2 = 0.0;
	  float pi = 3.1415926;
	  for (unsigned k = 0; k < proxy.dim(); ++k){
	    dot_prod += (float)(proxy[pivot][k] - proxy[orign][k])* (float)(proxy[x][k] - proxy[orign][k]);
	    norm += (float)(proxy[x][k] - proxy[orign][k]) * (proxy[x][k] - proxy[orign][k]);
	    norm2 += (float)(proxy[pivot][k] - proxy[orign][k]) * (proxy[pivot][k] - proxy[orign][k]);
	  }
	  //	  if (dot_prod / sqrt(norm * norm2) < 0.001){
	  //  fprintf(stderr, "IN: %d %d %d", orign, pivot, x);
	  //}
	  //fprintf(stderr, "%f ", dot_prod);
	  //fprintf(stderr, "%f\n", sqrt ( norm1 * norm2 ));
	  return acos(dot_prod / sqrt(norm * norm2) ) * 180 / pi;
	}
	SearchOracle query (DATA_TYPE const *query) const {
            return SearchOracle(proxy, query);
        }
    };

    inline float AverageRecall (Matrix<float> const &gs, Matrix<float> const &result, unsigned K = 0) {
        if (K == 0) {
            K = result.dim();
        }
        BOOST_VERIFY(gs.dim() >= K);
        BOOST_VERIFY(result.dim() >= K);
        BOOST_VERIFY(gs.size() >= result.size());
        float sum = 0;
        for (unsigned i = 0; i < result.size(); ++i) {
            float const *gs_row = gs[i];
            float const *re_row = result[i];
            // compare
            unsigned found = 0;
            unsigned gs_n = 0;
            unsigned re_n = 0;
            while ((gs_n < K) && (re_n < K)) {
                if (gs_row[gs_n] < re_row[re_n]) {
                    ++gs_n;
                }
                else if (gs_row[gs_n] == re_row[re_n]) {
                    ++found;
                    ++gs_n;
                    ++re_n;
                }
                else {
                    throw runtime_error("distance is unstable");
                }
            }
            sum += float(found) / K;
        }
        return sum / result.size();
    }
	inline void AveragePrecision(Matrix<float> const &gs, Matrix<float> const &result, float *precision) {
		unsigned K = result.dim();
        BOOST_VERIFY(gs.dim() >= K);
        BOOST_VERIFY(result.dim() >= K);
        BOOST_VERIFY(gs.size() >= result.size());
        unsigned found = 0;
		unsigned gs_n = 0;
        unsigned re_n = 0;
        for (unsigned i = 0; i < result.size(); ++i) {
            float const *gs_row = gs[i];
            float const *re_row = result[i];
			while ((gs_n < K) && (re_n < K)) {
                if (gs_row[gs_n] < re_row[re_n]) {
                    ++gs_n;
                }
                else if (gs_row[gs_n] == re_row[re_n]) {
                    ++found;
                    ++gs_n;
                    ++re_n;
                }
                else {
                    throw runtime_error("distance is unstable");
                }
            }
			if (gs_row[0] == re_row[0]) {
                ++found;

            }
        }
        *precision = found / result.size();
    }

	inline void AverageAccuracy(Matrix<float> const &gs, Matrix<float> const &result, float *accuracy) 
	{
        unsigned  K = result.dim();
        BOOST_VERIFY(gs.dim() >= K);
        BOOST_VERIFY(result.dim() >= K);
        BOOST_VERIFY(gs.size() >= result.size());

		float avg = 0;
        for (unsigned i = 0; i < result.size(); ++i) {
            float const *gs_row = gs[i];
            float const *re_row = result[i];
        	float dist = 0;
			unsigned gs_n = 0;
            unsigned re_n = 0;
            while ((gs_n < K) && (re_n < K)) {
                float d=(re_row[re_n]-gs_row[gs_n])/gs_row[gs_n];
				if(d<=4)
					dist += d;
				else
					dist+=4; 
  				++gs_n;
                ++re_n;
			}
			avg += dist/K;
        }
        *accuracy=avg / result.size();
    }

	inline float compute_number_closer (Matrix<float> const &gs, Matrix<float> const &result, unsigned K = 0) {
        if (K == 0) {
            K = result.dim();
        }
        BOOST_VERIFY(gs.dim() >= K);
        BOOST_VERIFY(result.dim() >= K);
        BOOST_VERIFY(gs.size() >= result.size());
        float sum = 0;
        for (unsigned i = 0; i < result.size(); ++i) {
            float const *gs_row = gs[i];
            float const *re_row = result[i];
			float rate = 0.0;
			for (unsigned gs_n=0;gs_n < K ;gs_n++)
			{
				for(unsigned re_n=0; re_n < K; re_n++)
				{
					if(gs_row[gs_n]==re_row[re_n])
					{
						rate += (float)(gs_n+1)/(re_n+1);
						break;
					}
				}
			}
            sum += rate/K;
        }
        return sum / result.size();
    }

	inline float compute_mean_reciprocal_rank (Matrix<float> const &gs, Matrix<float> const &result, unsigned K = 0) {
        if (K == 0) {
            K = result.dim();
        }
        BOOST_VERIFY(gs.dim() >= K);
        BOOST_VERIFY(result.dim() >= K);
        BOOST_VERIFY(gs.size() >= result.size());
        float sum = 0;
        for (unsigned i = 0; i < result.size(); ++i) {
            float const *gs_row = gs[i];
            float const *re_row = result[i];
			float rate = 0.0;
			for(unsigned re_n=0; re_n < K; re_n++)
			{
				if(gs_row[0]==re_row[re_n])
				{
					rate += 1.0/(re_n+1);
					break;
				}
			}
            sum += rate;
        }
        return sum / result.size();
    }


	inline float compute_mean_average_precision (Matrix<float> const &gs, Matrix<float> const &result, unsigned K = 0) {
        if (K == 0) {
            K = result.dim();
        }
        BOOST_VERIFY(gs.dim() >= K);
        BOOST_VERIFY(result.dim() >= K);
        BOOST_VERIFY(gs.size() >= result.size());
        float sum = 0;
        for (unsigned i = 0; i < result.size(); ++i) {
            float const *gs_row = gs[i];
            float const *re_row = result[i];
			float rate = 0.0;
			unsigned re_n = 0;
			int count = 0;
			for(unsigned gs_n=0; gs_n < K; gs_n++)
			{
				if(gs_row[gs_n]==re_row[re_n])
				{
					count++;
					rate += 1.0*(count)/(gs_n+1);
					re_n ++;
				}
			}
            sum += rate/K;
        }
        return sum / result.size();
    }

	inline float compute_discounted_culmulative_gain (Matrix<float> const &gs, Matrix<float> const &result, unsigned K = 0) {
        if (K == 0) {
            K = result.dim();
        }
        BOOST_VERIFY(gs.dim() >= K);
        BOOST_VERIFY(result.dim() >= K);
        BOOST_VERIFY(gs.size() >= result.size());
        float sum = 0;
        for (unsigned i = 0; i < result.size(); ++i) {
            float const *gs_row = gs[i];
            float const *re_row = result[i];
			float rate = 0.0;
			unsigned re_n = 0;
			for(unsigned gs_n=0; gs_n < K; gs_n++)
			{
				if(gs_row[gs_n]==re_row[re_n])
				{
					rate += 1.0/log2(gs_n+2);
					re_n ++;
				}
			}
            sum += rate;
        }
        return sum / result.size();
    }

    inline void AverageMinDist (Matrix<float> const &gs, Matrix<float> const &result, float *MinDist,float *AvgDist,float *MaxDist) {

        BOOST_VERIFY(gs.size() >= result.size());
        for (unsigned i = 0; i < result.size(); ++i) {
            float const *gs_row = gs[i];
            float const *re_row = result[i];
            *MinDist += re_row[0]-gs_row[0];
            *MaxDist += abs(re_row[result.dim()]-gs_row[0]);
            for(unsigned j=0;j<result.dim();j++)
            {
                *AvgDist += re_row[j]-gs_row[j];
            }
        }
	    *MinDist /= result.size();
        *AvgDist /= result.size()*result.dim();
        *MaxDist /= result.size();
    }
}

#ifndef KGRAPH_NO_VECTORIZE
#ifdef __GNUC__
#ifdef __AVX__
namespace kgraph { namespace metric {
        template <>
        inline float l2sqr::apply<float> (float const *t1, float const *t2, unsigned dim) {
            return float_l2sqr_avx(t1, t2, dim);
        }
}}
#else
#ifdef __SSE2__
namespace kgraph { namespace metric {
        template <>
        inline float l2sqr::apply<float> (float const *t1, float const *t2, unsigned dim) {
            return float_l2sqr_sse2(t1, t2, dim);
        }
        template <>
        inline float l2sqr::apply<uint8_t> (uint8_t const *t1, uint8_t const *t2, unsigned dim) {
            return uint8_l2sqr_sse2(t1, t2, dim);
        }
}}
#endif
#endif
#endif
#endif



#endif



================================================
FILE: algorithms/Annoy/src/indexer.cpp
================================================
#include <iostream>
#include <fstream>
#include <cctype>
#include <ctime>
#include <time.h>
#include <sys/time.h>
#include <assert.h>
#include <set>
#include <getopt.h>

#include "annoy.cpp"
#include "kissrandom.h"

using namespace std;
using std::set;

struct item{

unsigned id;
};

float diff_timeval(timeval t1, timeval t2) {
  return (float) (t1.tv_sec - t2.tv_sec) + (t1.tv_usec - t2.tv_usec) * 1e-6;
}

//static const unsigned LSHKIT_HEADER = 3;

typedef float T;
typedef unsigned S;

float* load_data(const char* data_path, int* len, int* d)
{
	// start to read data 
	FILE * dfp = fopen(data_path, "rb");
	int dim;
	fread(&dim,sizeof(int),1,dfp);
	fseek(dfp, 0, SEEK_END);
	off_t size = ftell(dfp);
    fseek(dfp, 0, SEEK_SET);
    int n = (int)(size / (sizeof(int)+ sizeof(float)*dim));
	*d = dim;
	*len = n;
	float * data = new float [n*dim];
	for (int i=0;i<n;i++)
	{
		fread(&dim, sizeof(int),1,dfp);
		fread(&data[i*dim], sizeof(float), dim, dfp);
	}
	fclose(dfp);
	return data;
}

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

	const struct option longopts[] ={
	    {"help",                        no_argument,       0, 'h'},
	    {"data_path",                   required_argument, 0, 'd'},
		{"index_path",                  required_argument, 0, 'i'},
		{"output_path",                 required_argument, 0, 'o'},
		{"trees",                       required_argument, 0, 't'},
	  };
	  int ind;
	  int iarg = 0;
	  opterr = 1;

	  char data_path[256] = "";
	  char index_path[256] = "";
	  char output_path[256]= "";
	  int trees;

	  while (iarg != -1) {
	    iarg = getopt_long(argc, argv, "d:i:o:t:h",
	                       longopts, &ind);

	    switch (iarg) {
	      case 'i':
	        if (optarg) {
	        	strcpy(index_path, optarg);
	        }
	        break;
	      case 'd':
	        if (optarg) {
	        	strcpy(data_path, optarg);
	        }
	        break;
	      case 'o':
	        if (optarg) {
	        	strcpy(output_path, optarg);
	        }
	        break;
		  case 't':
	    	  if (optarg) {
	    	  trees = atoi(optarg);
	    	  }
	    	  break;
	      }
	}

	int dim, N;
    float *data = load_data(data_path, &N , &dim);

	AnnoyIndex<int32_t, float, Euclidean, Kiss64Random>* index = new AnnoyIndex<int32_t, float, Euclidean, Kiss64Random>(dim);
    for (unsigned i = 0; i < N; ++i) {  
        index->add_item(i, &data[i*dim]);//(T*) (data +i*dim*sizeof(T))
    }

  	timeval start;
	gettimeofday(&start, NULL);
    index->build(trees);
	timeval end;
	gettimeofday(&end, NULL);
	T index_time = diff_timeval(end, start);
	FILE *ofp = fopen(output_path, "a+");
    fprintf(ofp,"%.2f #trees_%d \n",index_time,trees);	
	fclose(ofp);

    index->save(index_path);

    delete []data;    
	delete index;

}


================================================
FILE: algorithms/Annoy/src/kissrandom.h
================================================
#ifndef KISSRANDOM_H
#define KISSRANDOM_H

#include <stdint.h>

// KISS = "keep it simple, stupid", but high quality random number generator
// http://www0.cs.ucl.ac.uk/staff/d.jones/GoodPracticeRNG.pdf -> "Use a good RNG and build it into your code"
// http://mathforum.org/kb/message.jspa?messageID=6627731
// https://de.wikipedia.org/wiki/KISS_(Zufallszahlengenerator)

// 32 bit KISS
struct Kiss32Random {
  uint32_t x;
  uint32_t y;
  uint32_t z;
  uint32_t c;

  // seed must be != 0
  Kiss32Random(uint32_t seed = 123456789) {
    x = seed;
    y = 362436000;
    z = 521288629;
    c = 7654321;
  }

  uint32_t kiss() {
    // Linear congruence generator
    x = 69069 * x + 12345;

    // Xor shift
    y ^= y << 13;
    y ^= y >> 17;
    y ^= y << 5;

    // Multiply-with-carry
    uint64_t t = 698769069ULL * z + c;
    c = t >> 32;
    z = (uint32_t) t;

    return x + y + z;
  }
  inline int flip() {
    // Draw random 0 or 1
    return kiss() & 1;
  }
  inline size_t index(size_t n) {
    // Draw random integer between 0 and n-1 where n is at most the number of data points you have
    return kiss() % n;
  }
};

// 64 bit KISS. Use this if you have more than about 2^24 data points ("big data" ;) )
struct Kiss64Random {
  uint64_t x;
  uint64_t y;
  uint64_t z;
  uint64_t c;

  // seed must be != 0
  Kiss64Random(uint64_t seed = 1234567890987654321ULL) {
    x = seed;
    y = 362436362436362436ULL;
    z = 1066149217761810ULL;
    c = 123456123456123456ULL;
  }

  uint64_t kiss() {
    // Linear congruence generator
    z = 6906969069LL*z+1234567;

    // Xor shift
    y ^= (y<<13);
    y ^= (y>>17);
    y ^= (y<<43);

    // Multiply-with-carry (uint128_t t = (2^58 + 1) * x + c; c = t >> 64; x = (uint64_t) t)
    uint64_t t = (x<<58)+c;
    c = (x>>6);
    x += t;
    c += (x<t);

    return x + y + z;
  }
  inline int flip() {
    // Draw random 0 or 1
    return kiss() & 1;
  }
  inline size_t index(size_t n) {
    // Draw random integer between 0 and n-1 where n is at most the number of data points you have
    return kiss() % n;
  }
};

#endif
// vim: tabstop=2 shiftwidth=2


================================================
FILE: algorithms/Annoy/src/searcher.cpp
================================================
#include <iostream>
#include <fstream>
#include <cctype>
#include <ctime>
#include <time.h>
#include <sys/time.h>
#include <assert.h>
#include <set>
#include <getopt.h>

#include "annoy.cpp"
#include "kissrandom.h"

using namespace std;
using std::set;

struct item{

unsigned id;
};

float diff_timeval(timeval t1, timeval t2) {
  return (float) (t1.tv_sec - t2.tv_sec) + (t1.tv_usec - t2.tv_usec) * 1e-6;
}

static const unsigned LSHKIT_HEADER = 3;

typedef float T;
typedef unsigned S;

template<typename P>
P* load_data(const char* data_path, int* len, int* d)
{
	// start to read data 
	FILE * dfp = fopen(data_path, "rb");
	int dim;
	fread(&dim,sizeof(int),1,dfp);
	fseek(dfp, 0, SEEK_END);
	off_t size = ftell(dfp);
    fseek(dfp, 0, SEEK_SET);
    int n = (int)(size / (sizeof(int)+ sizeof(P)*dim));
	*d = dim;
	*len = n;
	P * data = new P[n*dim];
	for (int i=0;i<n;i++)
	{
		fread(&dim, sizeof(int),1,dfp);
		fread(&data[i*dim], sizeof(P), dim, dfp);
	}
	fclose(dfp);
    return data;
}

T get_recall(S * gt, vector<int32_t>* res, S k)
{
	float ratio=0;
	std::set<S> gnd_row;
	for(unsigned j=0; j<k; j++)
		gnd_row.insert(gt[j]);
	for(unsigned j=0; j<k; j++)
	{
		if(gnd_row.find(res->at(j))!=gnd_row.end())
			ratio++;
	}
	return ratio/k;
}


T get_mAP(S * gt, vector<int32_t>* res, S k)
{
	std::set<S> gs_set;
	int found_last=0;
	float mAP=0.0;
	for(unsigned j=0;j<k;j++)
	{
		gs_set.insert(gt[j]);
		int count = 0;
		for(unsigned t=0;t<=j;t++)
			if(gs_set.find(res->at(t))!=gs_set.end())
			{
				count++;
			}
		mAP += count*(count-found_last)*1.0/(j+1);
		found_last=count;
	}
    return mAP/k;
}

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

	const struct option longopts[] ={
	    {"help",                        no_argument,       0, 'h'},
	    {"data_path",                   required_argument, 0, 'i'},
	    {"query_path" ,                 required_argument, 0, 'q'},
	    {"gnd_path",                    required_argument, 0, 'g'},
		{"output_path",                 required_argument, 0, 'o'},
		{"k",                           required_argument, 0, 'k'},
		{"c",                           required_argument, 0, 'c'},
	  };
	  int ind;
	  int iarg = 0;
	  opterr = 1;

	  char gnd_path[256] = "";
	  char query_path[256] = "";
	  char index_path[256] = "";
	  char output_path[256]= "";
	  int K;
	  int nStop;

	  while (iarg != -1) {
	    iarg = getopt_long(argc, argv, "i:q:g:o:k:c:h",
	                       longopts, &ind);

	    switch (iarg) {
	      case 'i':
	        if (optarg) {
	        	strcpy(index_path, optarg);
	        }
	        break;
	      case 'q':
	        if (optarg) {
	        	strcpy(query_path, optarg);
	        }
	        break;
	      case 'g':
	        if (optarg) {
	        	strcpy(gnd_path, optarg);
	        }
	        break;
	      case 'o':
	        if (optarg) {
	        	strcpy(output_path, optarg);
	        }
	        break;
		  case 'k':
	    	  if (optarg) {
	    	  K = atoi(optarg);
	    	  }
	    	  break;
		  case 'c':
	    	  if (optarg) {
			  nStop = atoi(optarg);
	    	  }
	    	  break;
	      }
	}
	
    int dim, nq;
    T *query_data = load_data<T>(query_path, &nq,&dim);
	S *gnd_data = load_data<S>(gnd_path, &nq, &K);

	AnnoyIndex<int32_t, float, Euclidean, Kiss64Random>* index = new AnnoyIndex<int32_t, float, Euclidean, Kiss64Random>(dim);
	index->load(index_path);	

	assert( query_data != NULL );
	T recall=0;
	int search_N=0;
	T mAP =0;
	timeval start;
	timeval end;
	T search_time=0;
	FILE *ofp = fopen(output_path, "a+");

	for ( int i=0; i<nq; i++ ){
		vector<int> result;
		vector<T> distance;
        gettimeofday(&start, NULL);
		//index->get_nns_by_vector ((T*) (query_data +i*dim*sizeof(T)), K, nStop, &result, &distance);
		index->get_nns_by_vector (&query_data[i*dim], K, nStop, &result, &distance);
		gettimeofday(&end, NULL);
	    search_time += diff_timeval(end, start);
		search_N += result[K];
		recall += get_recall(&gnd_data[i*K],&result,K);
		
		mAP += get_mAP(&gnd_data[i*K],&result,K);
	}
	
	recall /= nq;
	search_N /= nq;
	mAP /= nq;
	search_time /= nq;
	fprintf(ofp,"%.6f %.6f %.6f #N_%d %.6f \n",recall,0.0,search_time,search_N,mAP);	
	fclose(ofp);

	if ( query_data != NULL ) delete []query_data;

	delete index;
}


================================================
FILE: algorithms/DPG/README.html
================================================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="generator" content="pandoc" />
  <title></title>
  <style type="text/css">code{white-space: pre;}</style>
</head>
<body>
<h1 id="dpg">DPG</h1>
<p>Diversified Proximity Graph (<strong>DPG</strong>) is an extension of <a href="http://www.kgraph.org/"><strong>KGraph</strong></a> which maximizes the diversity of the K-NN graph</p>
<h2 id="prerequisites">Prerequisites</h2>
<ul>
<li>A modern compiler that supports <code>C++11</code> (e.g., <code>gcc 4.7</code> and above)</li>
<li>A linux system</li>
<li>The <code>boost</code> library (dev version) installed. Note that we need to set the <strong>paths</strong> of the Boost installed in <strong>Makefile</strong>.</li>
<li><a href="https://github.com/DBWangGroupUNSW/nns_benchmark/tree/master/data">A sample dataset</a> (e.g., audio) is downloaded, including its data points, query points and ground truth results. Note that we need to change data format later. All data files downloaded should be put in the <code>./knn_benchmark/data</code> directory.</li>
</ul>
<h2 id="compile-dpgsrc">Compile (DPG/src)</h2>
<p>The following script builds three program for K-NN graph construction (the same as KGraph), performs graph diversification (resulting in the new DPG index); they are <code>DPG_index</code>, <code>DPG_diverse</code> and <code>DPG_search</code>, respectively.</p>
<pre><code>build.sh</code></pre>
<p>Two data conversion programs, <code>fvec2lshkit</code> and <code>lshkit2fvec</code>, are also generated, which are copied to the data directory of the NNS benchmark (i.e, <code>./nns_benchmark/data</code>)</p>
<h2 id="construct-diversified-proxmity-graph-dpg-dpgscript">Construct Diversified Proxmity Graph (DPG) (DPG/script)</h2>
<pre><code>build_index.sh</code></pre>
<p>Build K-NN graphs based on the data points, then diversify the K-NN graph to generate the DPG graph. To save the space, one may directly build a DPG graph by diversifying the K-NN graph constructed by KGraph (i.e., index files uder KGraph/index directory). Note that for a DPG graph with <code>L=20</code> (i.e., 20 neighbors per data point), we need diversify a KGraph index created with <code>L=40</code> (i.e., 40 neighbours per data point) because we only keep half of the neighbors to allow space to include reverse edges. By doing this, the size of DPG is guaranteed to be the same as KGraph in the worse case, and is typically smaller.</p>
<h2 id="search-on-the-k-nn-graph-dpgscript">Search on the K-NN graph (DPG/script)</h2>
<pre><code>search.sh</code></pre>
<p>Note that, in our experiment paper, we tune the <code>P</code> value of DPG search (i.e., search queue size) to achieve the trade-off between search speed and search quality (recall). This is exactly the same with KGraph.</p>
</body>
</html>


================================================
FILE: algorithms/DPG/README.md
================================================
# DPG

Diversified Proximity Graph (**DPG**) is an extension of [**KGraph**](http://www.kgraph.org/) which maximizes the diversity of the K-NN graph 

## Prerequisites

- A modern compiler that supports `C++11` (e.g., `gcc 4.7` and above)
- A linux system 
- The `boost` library (dev version) installed. Note that we need to set the **paths** of the Boost installed in **Makefile**.
- [A sample dataset](https://github.com/DBWangGroupUNSW/nns_benchmark/tree/master/data)
  (e.g., audio) is downloaded, including its data points, query points and
  ground truth results. Note that we need to change data format later. All data
  files downloaded should be put in the `./knn_benchmark/data` directory.

 
## Compile (DPG/src)

The following script builds three program for K-NN graph construction (the same as KGraph),
performs graph diversification (resulting in the new DPG index); they are
`DPG_index`, `DPG_diverse` and `DPG_search`, respectively. 

```
build.sh
```

Two data conversion programs, `fvec2lshkit` and `lshkit2fvec`, are also
generated, which are copied to the data directory of the NNS benchmark (i.e,
`./nns_benchmark/data`)


## Construct Diversified Proxmity Graph (DPG) (DPG/script)

```
build_index.sh
```

Build K-NN graphs based on the data points, then diversify the K-NN graph to generate the DPG graph. 
To save the space, one may directly build a DPG graph by diversifying the K-NN
graph constructed by KGraph (i.e., index files uder KGraph/index directory).
Note that for a DPG graph with `L=20` (i.e., 20 neighbors per data point), we
need diversify a KGraph index created with `L=40` (i.e., 40 neighbours per data
point) because we only keep half of the neighbors to allow space to include
reverse edges. By doing this, the size of DPG is guaranteed to be the same as
KGraph in the worse case, and is typically smaller.    

## Search on the K-NN graph (DPG/script)

```
search.sh
```

Note that, in our experiment paper, we tune the `P` value of DPG search (i.e.,
search queue size) to achieve the trade-off between search speed and search
quality (recall). This is exactly the same with KGraph.




================================================
FILE: algorithms/DPG/script/build_index.sh
================================================
data_dir="../../../data"
index_dir="../index"
bin_dir="../src"

mkdir ${index_dir} 

# Please sure the data ( data points, query points and ground truth files are located at ../../../data directory )

# L1 and L2  is the length of the NN-list used by K-NN graph and DPG 

L1=40
L2=20

for data in audio 
do


# first construct K-NN graph

${bin_dir}/DPG_index --data ${data_dir}/${data}_base.lshkit --output ${index_dir}/${data}.kgraph_${L1} -S 20 -L ${L1} -K 20

# do the diversification 

${bin_dir}/DPG_diverse --data ${data_dir}/${data}_base.lshkit --index ${index_dir}/${data}.kgraph_${L1}  --output ${index_dir}/${data}.DPG_${L2}  -L ${L2}


done




================================================
FILE: algorithms/DPG/script/search.sh
================================================

data_dir="../../../data"
index_dir="../index"
bin_dir="../src"
result_dir="../results"


mkdir ${result_dir}


k=20
L=20


for data in audio  
do

for P in 1 2 5 10 20 40 50 100
do

# show the result 
${bin_dir}/DPG_search --data ${data_dir}/${data}_base.lshkit --query  ${data_dir}/${data}_query.lshkit --eval ${data_dir}/${data}_groundtruth.lshkit -K ${k} --index ${index_dir}/${data}.DPG_${L} -P ${P} 

# try again and keep the results into files 

result="${data}_k${k}_P${P}.txt" 

${bin_dir}/DPG_search --data ${data_dir}/${data}_base.lshkit --query  ${data_dir}/${data}_query.lshkit --eval ${data_dir}/${data}_groundtruth.lshkit -K ${k} --index ${index_dir}/${data}.DPG_${L} -P ${P} > ${result_dir}/${result}

done
done





================================================
FILE: algorithms/DPG/src/DPG_diverse.cpp
================================================
#include <cctype>
#include <type_traits>
#include <iostream>
#include <boost/timer/timer.hpp>
#include <boost/program_options.hpp>
#include <sys/time.h>
#include <cctype>
#include <random>
#include <iomanip>
#include <type_traits>
#include <boost/timer/timer.hpp>
#include <boost/tr1/random.hpp>
#include <boost/format.hpp>
#include <boost/program_options.hpp>

#include "kgraph.h"
#include "kgraph-data.h"

using namespace boost::timer;
using namespace std;
using namespace boost;
using namespace kgraph;
namespace po = boost::program_options; 

#ifndef KGRAPH_VALUE_TYPE
#define KGRAPH_VALUE_TYPE float
#endif


typedef KGRAPH_VALUE_TYPE value_type;

int main(int argc, char *argv[]){
    vector<string> params;
    string input_data_path;
    string index_NNList_path;
    string index_DPG_path; 
    unsigned L; 

    po::options_description desc_visible("General options");
    desc_visible.add_options()
    ("help,h", "produce help message.")
    ("version,v", "print version number.")
    ("data", po::value(&input_data_path), "input data path")
    ("index", po::value(&index_NNList_path), "NNList index path")
    ("output", po::value(&index_DPG_path), "DPG index path")
    (",L", po::value(&L)->default_value(default_K), "")
    ; 

    po::options_description desc("Allowed options");
    desc.add(desc_visible);

    po::positional_options_description p;
    p.add("data", 1);
    p.add("index", 1);    
    p.add("output", 1);

    po::variables_map vm; 
    po::store(po::command_line_parser(argc, argv).options(desc).positional(p).run(), vm);
    po::notify(vm); 

    if (vm.count("help") || vm.count("data") == 0 || vm.count("index") == 0 || vm.count("output") == 0) {
        cout << "DPG_diverse <data> <K-NN graph index> <diversified index> " << endl;
        cout << desc_visible << endl;
        return 0;
    }

    cerr << L << " : L value" << endl;

    Matrix<value_type> data;
    data.load_lshkit(input_data_path.c_str());
    MatrixOracle<value_type, metric::l2sqr> oracle(data);

    KGraph *kgraph = KGraph::create();
    if (index_NNList_path.size() >0 )
    {
        kgraph->load(index_NNList_path.c_str());    
    }

    boost::timer::auto_cpu_timer timer;

    // start the diversification ?? ( seperately ) 
    // add the diversification part here 
    // cerr << "Start the diversification process... (angular dissimilarity )" << endl << endl;
    // kgraph->remove_near_edges(oracle, L); // here not knn's k, L is the length of NN list ( note that the true NN list length might be smaller than L) 

    cerr << "Start the diversification process... ( counting cuts )" << endl << endl;
    kgraph->diversify_by_cut(oracle, L); // here not knn's k, L is the length of NN list ( note that the true NN list length might be smaller than L) 


    // reverse the edges here 
    cerr << "Add reverse edges ..." << endl << endl;
    kgraph->add_backward_edges();

    float time = timer.elapsed().wall / 1e9;

    if ( index_DPG_path.size() > 0 )
    kgraph->save( index_DPG_path.c_str());

    cout << time << " # diversification time" << endl;

    delete kgraph;

}


================================================
FILE: algorithms/DPG/src/DPG_index.cpp
================================================
#ifndef KGRAPH_VALUE_TYPE
#define KGRAPH_VALUE_TYPE float
#endif


#include <cctype>
#include <type_traits>
#include <iostream>
#include <boost/timer/timer.hpp>
#include <boost/program_options.hpp>
#include <sys/time.h>
#include <cctype>
#include <random>
#include <iomanip>
#include <type_traits>
#include <boost/timer/timer.hpp>
#include <boost/tr1/random.hpp>
#include <boost/format.hpp>
#include <boost/program_options.hpp>

#include "kgraph.h"
#include "kgraph-data.h"

using namespace boost::timer;
using namespace std;
using namespace boost;
using namespace kgraph;
namespace po = boost::program_options; 


typedef KGRAPH_VALUE_TYPE value_type;

int main(int argc, char *argv[]) {
    string data_path;
    string output_path;
    KGraph::IndexParams params;
    unsigned D;
    unsigned skip;
    unsigned gap;
    unsigned synthetic;
    float noise;

    bool lshkit = true;

    po::options_description desc_visible("General options");
    desc_visible.add_options()
    ("help,h", "produce help message.")
    ("version,v", "print version information.")
    ("data", po::value(&data_path), "input path")
    ("output", po::value(&output_path), "output path")
    (",K", po::value(&params.K)->default_value(default_K), "number of nearest neighbor")
    ("controls,C", po::value(&params.controls)->default_value(default_controls), "number of control pounsigneds")
    ;

    po::options_description desc_hidden("Expert options");
    desc_hidden.add_options()
    ("iterations,I", po::value(&params.iterations)->default_value(default_iterations), "")
    (",S", po::value(&params.S)->default_value(default_S), "")
    (",R", po::value(&params.R)->default_value(default_R), "")
    (",L", po::value(&params.L)->default_value(default_L), "")
    ("delta", po::value(&params.delta)->default_value(default_delta), "")
    ("recall", po::value(&params.recall)->default_value(default_recall), "")
    ("prune", po::value(&params.prune)->default_value(default_prune), "")
    ("noise", po::value(&noise)->default_value(0), "noise")
    ("seed", po::value(&params.seed)->default_value(default_seed), "")
    ("dim,D", po::value(&D), "dimension, see format")
    ("skip", po::value(&skip)->default_value(0), "see format")
    ("gap", po::value(&gap)->default_value(0), "see format")
    ("raw", "read raw binary file, need to specify D.")
    ("synthetic", po::value(&synthetic)->default_value(0), "generate synthetic data, for performance evaluation only, specify number of points")
    ;

    po::options_description desc("Allowed options");
    desc.add(desc_visible).add(desc_hidden);

    po::positional_options_description p;
    p.add("data", 1);
    p.add("output", 1);

    po::variables_map vm;
    po::store(po::command_line_parser(argc, argv).options(desc).positional(p).run(), vm);
    po::notify(vm);

    if (vm.count("raw") == 1) {
        lshkit = false;
    }

    if (vm.count("version")) {
        cout << "KGraph version " << KGraph::version() << endl;
        return 0;
    }

    if (vm.count("help")
            || (synthetic && (vm.count("dim") == 0 || vm.count("data")))
            || (!synthetic && (vm.count("data") == 0 || (vm.count("dim") == 0 && !lshkit)))) {
        cout << "Usage: DPG_index [OTHER OPTIONS]... INPUT [OUTPUT]" << endl;
        cout << desc_visible << endl;
        cout << desc_hidden << endl;
        return 0;
    }

    if (params.S == 0) {
        params.S = params.K;
    }

    if (lshkit && (synthetic == 0)) {   // read dimension information from the data file
        static const unsigned LSHKIT_HEADER = 3;
        ifstream is(data_path.c_str(), ios::binary);
        unsigned header[LSHKIT_HEADER]; /* entry size, row, col */
        is.read((char *)header, sizeof header);
        BOOST_VERIFY(is);
        BOOST_VERIFY(header[0] == sizeof(value_type));
        is.close();
        D = header[2];
        skip = LSHKIT_HEADER * sizeof(unsigned);
        gap = 0;
    }

    Matrix<value_type> data;
    if (synthetic) {
        if (!std::is_floating_point<value_type>::value) {
            throw runtime_error("synthetic data not implemented for non-floating-point values.");
        }
        data.resize(synthetic, D);
        cerr << "Generating synthetic data..." << endl;
        default_random_engine rng(params.seed);
        uniform_real_distribution<double> distribution(-1.0, 1.0);
        data.zero(); // important to do that
        for (unsigned i = 0; i < synthetic; ++i) {
            value_type *row = data[i];
            for (unsigned j = 0; j < D; ++j) {
                row[j] = distribution(rng);
            }
        }
    }
    else {
        data.load(data_path, D, skip, gap);
    }
    if (noise != 0) {
        if (!std::is_floating_point<value_type>::value) {
            throw runtime_error("noise injection not implemented for non-floating-point value.");
        }
        tr1::ranlux64_base_01 rng;
        double sum = 0, sum2 = 0;
        for (unsigned i = 0; i < data.size(); ++i) {
            for (unsigned j = 0; j < data.dim(); ++j) {
                value_type v = data[i][j];
                sum += v;
                sum2 += v * v;
            }
        }
        double total = double(data.size()) * data.dim();
        double avg2 = sum2 / total, avg = sum / total;
        double dev = sqrt(avg2 - avg * avg);
        cerr << "Adding Gaussian noise w/ " << noise << "x sigma(" << dev << ")..." << endl;
        boost::normal_distribution<double> gaussian(0, noise * dev);
        for (unsigned i = 0; i < data.size(); ++i) {
            for (unsigned j = 0; j < data.dim(); ++j) {
                data[i][j] += gaussian(rng);
            }
        }
    }

    MatrixOracle<value_type, metric::l2sqr> oracle(data);
    KGraph::IndexInfo info;
    KGraph *kgraph = KGraph::create(); //(oracle, params, &info);
    {
        auto_cpu_timer timer;
        kgraph->build(oracle, params, output_path.c_str(), &info);
        cerr << info.stop_condition << endl;
    }

    if (output_path.size()) {
     
      //Note that we modify the index save procedure to reduce index size    
      //kgraph->save(output_path.c_str());
    }

    
    delete kgraph;

    return 0;
}


================================================
FILE: algorithms/DPG/src/DPG_search.cpp
================================================
#include <cctype>
#include <type_traits>
#include <iostream>
#include <boost/timer/timer.hpp>
#include <boost/program_options.hpp>
#include <sys/time.h>
#include <cctype>
#include <random>
#include <iomanip>
#include <type_traits>
#include <boost/timer/timer.hpp>
#include <boost/tr1/random.hpp>
#include <boost/format.hpp>
#include <boost/program_options.hpp>

#include "kgraph.h"
#include "kgraph-data.h"

using namespace boost::timer;
using namespace std;
using namespace boost;
using namespace kgraph;
namespace po = boost::program_options; 

#ifndef KGRAPH_VALUE_TYPE
#define KGRAPH_VALUE_TYPE float
#endif


typedef KGRAPH_VALUE_TYPE value_type;


int main(int argc, char *argv[]) {
    vector<string> params;
    string input_path;
    string index_path;
    string query_path;
    string output_path;
    string init_path;
    string eval_path;
    unsigned K, M, P, T;

    po::options_description desc_visible("General options");
    desc_visible.add_options()
    ("help,h", "produce help message.")
    ("version,v", "print version number.")
    ("data", po::value(&input_path), "input path")
    ("index", po::value(&index_path), "index path")
    ("query", po::value(&query_path), "query path")
    ("output", po::value(&output_path), "output path")
    ("init", po::value(&init_path), "init path")
    ("eval", po::value(&eval_path), "eval path")
    (",K", po::value(&K)->default_value(default_K), "")
    (",M", po::value(&M)->default_value(default_M), "")
    (",P", po::value(&P)->default_value(default_P), "")
    (",T", po::value(&T)->default_value(default_T), "")
    ("linear", "")
    ;

    po::options_description desc("Allowed options");
    desc.add(desc_visible);

    po::positional_options_description p;
    p.add("data", 1);
    p.add("index", 1);
    p.add("query", 1);
    p.add("output", 1);

    po::variables_map vm; 
    po::store(po::command_line_parser(argc, argv).options(desc).positional(p).run(), vm);
    po::notify(vm); 

    if (vm.count("version")) {
        cout << "KGraph version " << KGraph::version() << endl;
        return 0;
    }

    if (vm.count("help") || vm.count("data") == 0 || vm.count("index") == 0 || vm.count("query") == 0) {
        cout << "DPG_search <data> <index> <query> [output]" << endl;
        cout << desc_visible << endl;
        return 0;
    }

    if (P < K) {
        P = K;
    }

    Matrix<value_type> data;
    Matrix<value_type> query;
    Matrix<unsigned> result; //(query.size(), U);
    unsigned init = 0;

    data.load_lshkit(input_path);
    query.load_lshkit(query_path);
    if (init_path.size()) {
        result.load_lshkit(init_path);
        BOOST_VERIFY(result.size() == query.size());
        init = result.dim();
        BOOST_VERIFY(init >= K);
    }
    MatrixOracle<value_type, metric::l2sqr> oracle(data);
    float recall = 0;
    float cost = 0;
    float time = 0;
    if (vm.count("linear")) {
        boost::timer::auto_cpu_timer timer;
        result.resize(query.size(), K);
// #pragma omp parallel for
        for (unsigned i = 0; i < query.size(); ++i) {
            oracle.query(query[i]).search(K, default_epsilon, result[i]);
        }
        cost = 1.0;
        time = timer.elapsed().wall / 1e9;
    }
    else {
        result.resize(query.size(), K);
        KGraph::SearchParams params;
        params.K = K;
        params.M = M;
        params.P = P;
        params.T = T;
        params.init = init;
        KGraph *kgraph = KGraph::create();
        kgraph->load(index_path.c_str());

        boost::timer::auto_cpu_timer timer;
        cerr << "Searching..." << endl;

// #pragma omp parallel for reduction(+:cost)
        for (unsigned i = 0; i < query.size(); ++i) {
            KGraph::SearchInfo info;
            kgraph->search(oracle.query(query[i]), params, result[i], &info);
            cost += info.cost;
        }
        cost /= query.size();
        time = timer.elapsed().wall / 1e9;
        //cerr << "Cost: " << cost << endl;
        delete kgraph;
    }
    if (output_path.size()) {
        result.save_lshkit(output_path);
    }
    if (eval_path.size()) {
        Matrix<unsigned> gs;
        gs.load_lshkit(eval_path);
        BOOST_VERIFY(gs.dim() >= K);
        BOOST_VERIFY(gs.size() >= query.size());
        kgraph::Matrix<float> gs_dist(query.size(), K);
        kgraph::Matrix<float> result_dist(query.size(), K);
// #pragma omp parallel for
        for (unsigned i = 0; i < query.size(); ++i) {
            auto Q = oracle.query(query[i]);
            float *gs_dist_row = gs_dist[i];
            float *result_dist_row = result_dist[i];
            unsigned const *gs_row = gs[i];
            unsigned const *result_row = result[i];
            for (unsigned k = 0; k < K; ++k) {
                gs_dist_row[k] = Q(gs_row[k]);
                result_dist_row[k] = Q(result_row[k]);
            }
            sort(gs_dist_row, gs_dist_row + K);
            sort(result_dist_row, result_dist_row + K);
        }
        recall = AverageRecall(gs_dist, result_dist, K);
    }
    cout << "Time: " << time << " Recall: " << recall << " Cost: " << cost << endl;

    return 0;
}

================================================
FILE: algorithms/DPG/src/Makefile
================================================
CC=g++ 

#ARCH=-msse2
OPT=-O3
#OPENMP=-fopenmp
boost_dir="/home/yingz/Software/boost_1_58_0/"
boost_lib="/usr/local/lib"

CXXFLAGS+=-fPIC -g -std=c++11 -I${boost_dir} -I. $(OPT) -L${boost_lib}  $(OPT) $(ARCH) 
LDFLAGS+=-static $(OPENMP)
LDLIBS+=-lboost_timer -lboost_chrono -lboost_system -lboost_program_options -lgomp -lm -lrt  -L${boost_lib}

COMMON=kgraph.o metric.o RandGen.o

HEADERS=kgraph.h kgraph-data.h RandGen.h

PROGS=DPG_index DPG_diverse DPG_search

RELEASE_SRC=Makefile LICENSE kgraph.h kgraph-data.h DPG_index.cpp DPG_search.cpp DPG_diverse.cpp

$(PROGS): %:	%.cpp $(HEADERS) $(COMMON)
	$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $*.cpp $(COMMON) $(LDLIBS)
%.o:	%.cpp $(HEADERS)
	$(CXX) $(CXXFLAGS) -c $*.cpp 

clean:
	rm -f *.o






================================================
FILE: algorithms/DPG/src/RandGen.cpp
================================================
/*
 *   This file is part of SRS project.
 *
 *   SRS is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   SRS is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with SRS. If not, see <http://www.gnu.org/licenses/>.
 *
 *   Created by: Yifang Sun, Jianbin Qin
 *   Last modified by: Yifang Sun, Jianbin Qin
 */

#include <math.h>
#include <stdlib.h>
#include "RandGen.h"

/************************************************************
 ***  Given a mean and a standard deviation, gaussian       **
 **   generates a normally distributed random number        **
 **   Algorithm:  Polar Method, p.  104, Knuth, vol. 2      **
 ************************************************************/

float gaussian(float mean, float sigma) {
  float v1, v2;
  float s;
  float x;

  do {
    v1 = 2 * uniform(0, 1) - 1;
    v2 = 2 * uniform(0, 1) - 1;
    s = v1 * v1 + v2 * v2;
  } while (s >= 1.);

  x = v1 * (float) sqrt(-2. * log(s) / s);

  /*  x is normally distributed with mean 0 and sigma 1.  */
  x = x * sigma + mean;

  return (x);
}

/************************************************************
 ** Generates a random number between _min and _max         **
 ** uniformly                                               **
 ** By Yufei Tao
 ************************************************************/

float uniform(float _min, float _max) {
  int int_r = rand();
  long base = RAND_MAX - 1;
  float f_r = ((float) int_r) / base;
  return (_max - _min) * f_r + _min;
}



================================================
FILE: algorithms/DPG/src/RandGen.h
================================================
/*
 *   This file is part of SRS project.
 *
 *   SRS is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   SRS is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with SRS. If not, see <http://www.gnu.org/licenses/>.
 *
 *   Created by: Yifang Sun, Jianbin Qin
 *   Last modified by: Yifang Sun, Jianbin Qin
 */

#ifndef RANDGEN_H_
#define RANDGEN_H_

float gaussian(float mean, float sigma);
float uniform(float _min, float _max);

#endif /* RANDGEN_H_ */


================================================
FILE: algorithms/DPG/src/build.sh
================================================
make DPG_index
make DPG_diverse
make DPG_search

make clean


================================================
FILE: algorithms/DPG/src/kgraph-data.h
================================================
#ifndef WDONG_KGRAPH_DATA
#define WDONG_KGRAPH_DATA

#include <cstring>
#include <malloc.h>
#include <vector>
#include <cmath>
#include <fstream>
#include <stdexcept>
#include <boost/assert.hpp>

#ifdef __GNUC__
#ifdef __AVX__
#define KGRAPH_MATRIX_ALIGN 32
#else
#ifdef __SSE2__
#define KGRAPH_MATRIX_ALIGN 16
#else
#define KGRAPH_MATRIX_ALIGN 4
#endif
#endif
#endif

namespace kgraph {

    /// L2 square distance with AVX instructions.
    /** AVX instructions have strong alignment requirement for t1 and t2.
     */
    extern float float_l2sqr_avx (float const *t1, float const *t2, unsigned dim);
    /// L2 square distance with SSE2 instructions.
    extern float float_l2sqr_sse2 (float const *t1, float const *t2, unsigned dim);
    /// L2 square distance for uint8_t with SSE2 instructions (for SIFT).
    extern float uint8_l2sqr_sse2 (uint8_t const *t1, uint8_t const *t2, unsigned dim);

    using std::vector;
    using std::runtime_error;

    /// namespace for various distance metrics.
    namespace metric {
        /// L2 square distance.
        struct l2sqr {
            template <typename T>
            static float apply (T const *t1, T const *t2, unsigned dim) {
	      //				cout<<"apply \n";
                float r = 0;
                for (unsigned i = 0; i < dim; ++i) {
                    float v = float(t1[i]) - float(t2[i]);
                    v *= v;
                    r += v;
                }
                return r;
            }
        };
        /// L2 distance.
        struct l2 {
            template <typename T>
            static float apply (T const *t1, T const *t2, unsigned dim) {
                return sqrt(l2sqr::apply<T>(t1, t2, dim));
            }
        };
    }

    /// Matrix data.
    template <typename T, unsigned A = KGRAPH_MATRIX_ALIGN>
    class Matrix {
        unsigned col;
        unsigned row;
        size_t stride;
        char *data;

        void reset (unsigned r, unsigned c) {
            row = r;
            col = c;
            stride = (sizeof(T) * c + A - 1) / A * A;
            /*
            data.resize(row * stride);
            */
            if (data) free(data);
            data = (char *)memalign(A, row * stride); // SSE instruction needs data to be aligned
            if (!data) throw runtime_error("memalign");
        }
    public:
        Matrix (): col(0), row(0), stride(0), data(0) {}
        Matrix (unsigned r, unsigned c): data(0) {
            reset(r, c);
        }
        ~Matrix () {
            if (data) free(data);
        }
        unsigned size () const {
            return row;
        }
        unsigned dim () const {
            return col;
        }
        size_t step () const {
            return stride;
        }
        void resize (unsigned r, unsigned c) {
            reset(r, c);
        }
        T const *operator [] (unsigned i) const {
            return reinterpret_cast<T const *>(&data[stride * i]);
        }
        T *operator [] (unsigned i) {
            return reinterpret_cast<T *>(&data[stride * i]);
        }
        void zero () {
            memset(data, 0, row * stride);
        }
        void load (const std::string &path, unsigned dim, unsigned skip = 0, unsigned gap = 0) {
            std::ifstream is(path.c_str(), std::ios::binary);
            BOOST_VERIFY(is);
            is.seekg(0, std::ios::end);
            size_t size = is.tellg();
            size -= skip;
            unsigned line = sizeof(T) * dim + gap;
            unsigned N =  size / line;
            reset(N, dim);
            zero();
            is.seekg(skip, std::ios::beg);
            for (unsigned i = 0; i < N; ++i) {
                is.read(&data[stride * i], sizeof(T) * dim);
                is.seekg(gap, std::ios::cur);
            }
            BOOST_VERIFY(is);
        }

        void load_lshkit (std::string const &path) {
            static const unsigned LSHKIT_HEADER = 3;
            std::ifstream is(path.c_str(), std::ios::binary);
            unsigned header[LSHKIT_HEADER]; /* entry size, row, col */
            is.read((char *)header, sizeof header);
            BOOST_VERIFY(is);
            BOOST_VERIFY(header[0] == sizeof(T));
            is.close();
            unsigned D = header[2];
            unsigned skip = LSHKIT_HEADER * sizeof(unsigned);
            unsigned gap = 0;
            load(path, D, skip, gap);
        }

        void save_lshkit (std::string const &path) {
            std::ofstream os(path.c_str(), std::ios::binary);
            unsigned header[3];
            assert(sizeof header == 3*4);
            header[0] = sizeof(T);
            header[1] = row;
            header[2] = col;
            os.write((const char *)header, sizeof(header));
            for (unsigned i = 0; i < row; ++i) {
                os.write(&data[stride * i], sizeof(T) * col);
            }
        }
    };

    /// Matrix proxy to interface with 3rd party libraries (FLANN, OpenCV, NumPy).
    template <typename DATA_TYPE, unsigned A = KGRAPH_MATRIX_ALIGN>
    class MatrixProxy {
        unsigned rows;
        unsigned cols;      // # elements, not bytes, in a row,
        size_t stride;    // # bytes in a row, >= cols * sizeof(element)
        uint8_t const *data;
    public:
        MatrixProxy (Matrix<DATA_TYPE> const &m)
            : rows(m.size()), cols(m.dim()), stride(m.step()), data(reinterpret_cast<uint8_t const *>(m[0])) {
        }

#ifndef __AVX__
#ifdef FLANN_DATASET_H_
        /// Construct from FLANN matrix.
        MatrixProxy (flann::Matrix<DATA_TYPE> const &m)
            : rows(m.rows), cols(m.cols), stride(m.stride), data(m.data) {
            BOOST_VERIFY(stride % A == 0);
        }
#endif
#ifdef __OPENCV_CORE_HPP__
        /// Construct from OpenCV matrix.
        MatrixProxy (cv::Mat const &m)
            : rows(m.rows), cols(m.cols), stride(m.step), data(m.data) {
            BOOST_VERIFY(stride % A == 0);
        }
#endif
#ifdef NPY_NDARRAYOBJECT_H
        /// Construct from NumPy matrix.
        MatrixProxy (PyArrayObject *obj) {
            BOOST_VERIFY(obj->nd == 2);
            rows = obj->dimensions[0];
            cols = obj->dimensions[1];
            stride = obj->strides[0];
            data = reinterpret_cast<uint8_t const *>(obj->data);
            BOOST_VERIFY(obj->descr->elsize == sizeof(DATA_TYPE));
            BOOST_VERIFY(stride % A == 0);
            BOOST_VERIFY(stride >= cols * sizeof(DATA_TYPE));
        }
#endif
#endif
        unsigned size () const {
            return rows;
        }
        unsigned dim () const {
            return cols;
        }
        DATA_TYPE const *operator [] (unsigned i) const {
            return reinterpret_cast<DATA_TYPE const *>(data + stride * i);
        }
    };

    /// Oracle for matrix data.
    /** DATA_TYPE can be Matrix or MatrixProxy,
    * DIST_TYPE should be one class within the namespace kgraph.metric.
    */
    template <typename DATA_TYPE, typename DIST_TYPE>
    class MatrixOracle: public kgraph::IndexOracle {
        MatrixProxy<DATA_TYPE> proxy;
    public:
        class SearchOracle: public kgraph::SearchOracle {
            MatrixProxy<DATA_TYPE> proxy;
            DATA_TYPE const *query;
        public:
            SearchOracle (MatrixProxy<DATA_TYPE> const &p, DATA_TYPE const *q): proxy(p), query(q) {
            }
            virtual unsigned size () const {
                return proxy.size();
            }
            virtual float operator () (unsigned i) const {
                return DIST_TYPE::apply(proxy[i], query, proxy.dim());
            }
        };
        template <typename MATRIX_TYPE>
        MatrixOracle (MATRIX_TYPE const &m): proxy(m) {
        }
        virtual unsigned size () const {
            return proxy.size();
        }
        virtual float operator () (unsigned i, unsigned j) const {
            return DIST_TYPE::apply(proxy[i], proxy[j], proxy.dim());
        }

	virtual float angle (unsigned orign, unsigned pivot, unsigned x) const { // return cos(\theta), where \theta is the angle between vector orign - pivot and orign - x
	  float dot_prod = 0.0, norm = 0.0, norm2 = 0.0;
	  float pi = 3.1415926;
	  for (unsigned k = 0; k < proxy.dim(); ++k){
	    dot_prod += (float)(proxy[pivot][k] - proxy[orign][k])* (float)(proxy[x][k] - proxy[orign][k]);
	    norm += (float)(proxy[x][k] - proxy[orign][k]) * (proxy[x][k] - proxy[orign][k]);
	    norm2 += (float)(proxy[pivot][k] - proxy[orign][k]) * (proxy[pivot][k] - proxy[orign][k]);
	  }
	  //	  if (dot_prod / sqrt(norm * norm2) < 0.001){
	  //  fprintf(stderr, "IN: %d %d %d", orign, pivot, x);
	  //}
	  //fprintf(stderr, "%f ", dot_prod);
	  //fprintf(stderr, "%f\n", sqrt ( norm1 * norm2 ));
	  return acos(dot_prod / sqrt(norm * norm2) ) * 180 / pi;
	}
	SearchOracle query (DATA_TYPE const *query) const {
            return SearchOracle(proxy, query);
        }
    };

    inline float AverageRecall (Matrix<float> const &gs, Matrix<float> const &result, unsigned K = 0) {
        if (K == 0) {
            K = result.dim();
        }
        BOOST_VERIFY(gs.dim() >= K);
        BOOST_VERIFY(result.dim() >= K);
        BOOST_VERIFY(gs.size() >= result.size());
        float sum = 0;
        for (unsigned i = 0; i < result.size(); ++i) {
            float const *gs_row = gs[i];
            float const *re_row = result[i];
            // compare
            unsigned found = 0;
            unsigned gs_n = 0;
            unsigned re_n = 0;
            while ((gs_n < K) && (re_n < K)) {
                if (gs_row[gs_n] < re_row[re_n]) {
                    ++gs_n;
                }
                else if (gs_row[gs_n] == re_row[re_n]) {
                    ++found;
                    ++gs_n;
                    ++re_n;
                }
                else {
                    throw runtime_error("distance is unstable");
                }
            }
            sum += float(found) / K;
        }
        return sum / result.size();
    }
	inline void AveragePrecision(Matrix<float> const &gs, Matrix<float> const &result, float *precision) {
		unsigned K = result.dim();
        BOOST_VERIFY(gs.dim() >= K);
        BOOST_VERIFY(result.dim() >= K);
        BOOST_VERIFY(gs.size() >= result.size());
        unsigned found = 0;
		unsigned gs_n = 0;
        unsigned re_n = 0;
        for (unsigned i = 0; i < result.size(); ++i) {
            float const *gs_row = gs[i];
            float const *re_row = result[i];
			while ((gs_n < K) && (re_n < K)) {
                if (gs_row[gs_n] < re_row[re_n]) {
                    ++gs_n;
                }
                else if (gs_row[gs_n] == re_row[re_n]) {
                    ++found;
                    ++gs_n;
                    ++re_n;
                }
                else {
                    throw runtime_error("distance is unstable");
                }
            }
			if (gs_row[0] == re_row[0]) {
                ++found;

            }
        }
        *precision = found / result.size();
    }

	inline void AverageAccuracy(Matrix<float> const &gs, Matrix<float> const &result, float *accuracy) 
	{
        unsigned  K = result.dim();
        BOOST_VERIFY(gs.dim() >= K);
        BOOST_VERIFY(result.dim() >= K);
        BOOST_VERIFY(gs.size() >= result.size());

		float avg = 0;
        for (unsigned i = 0; i < result.size(); ++i) {
            float const *gs_row = gs[i];
            float const *re_row = result[i];
        	float dist = 0;
			unsigned gs_n = 0;
            unsigned re_n = 0;
            while ((gs_n < K) && (re_n < K)) {
                float d=(re_row[re_n]-gs_row[gs_n])/gs_row[gs_n];
				if(d<=4)
					dist += d;
				else
					dist+=4; 
  				++gs_n;
                ++re_n;
			}
			avg += dist/K;
        }
        *accuracy=avg / result.size();
    }

	inline float compute_number_closer (Matrix<float> const &gs, Matrix<float> const &result, unsigned K = 0) {
        if (K == 0) {
            K = result.dim();
        }
        BOOST_VERIFY(gs.dim() >= K);
        BOOST_VERIFY(result.dim() >= K);
        BOOST_VERIFY(gs.size() >= result.size());
        float sum = 0;
        for (unsigned i = 0; i < result.size(); ++i) {
            float const *gs_row = gs[i];
            float const *re_row = result[i];
			float rate = 0.0;
			for (unsigned gs_n=0;gs_n < K ;gs_n++)
			{
				for(unsigned re_n=0; re_n < K; re_n++)
				{
					if(gs_row[gs_n]==re_row[re_n])
					{
						rate += (float)(gs_n+1)/(re_n+1);
						break;
					}
				}
			}
            sum += rate/K;
        }
        return sum / result.size();
    }

	inline float compute_mean_reciprocal_rank (Matrix<float> const &gs, Matrix<float> const &result, unsigned K = 0) {
        if (K == 0) {
            K = result.dim();
        }
        BOOST_VERIFY(gs.dim() >= K);
        BOOST_VERIFY(result.dim() >= K);
        BOOST_VERIFY(gs.size() >= result.size());
        float sum = 0;
        for (unsigned i = 0; i < result.size(); ++i) {
            float const *gs_row = gs[i];
            float const *re_row = result[i];
			float rate = 0.0;
			for(unsigned re_n=0; re_n < K; re_n++)
			{
				if(gs_row[0]==re_row[re_n])
				{
					rate += 1.0/(re_n+1);
					break;
				}
			}
            sum += rate;
        }
        return sum / result.size();
    }


	inline float compute_mean_average_precision (Matrix<float> const &gs, Matrix<float> const &result, unsigned K = 0) {
        if (K == 0) {
            K = result.dim();
        }
        BOOST_VERIFY(gs.dim() >= K);
        BOOST_VERIFY(result.dim() >= K);
        BOOST_VERIFY(gs.size() >= result.size());
        float sum = 0;
        for (unsigned i = 0; i < result.size(); ++i) {
            float const *gs_row = gs[i];
            float const *re_row = result[i];
			float rate = 0.0;
			unsigned re_n = 0;
			int count = 0;
			for(unsigned gs_n=0; gs_n < K; gs_n++)
			{
				if(gs_row[gs_n]==re_row[re_n])
				{
					count++;
					rate += 1.0*(count)/(gs_n+1);
					re_n ++;
				}
			}
            sum += rate/K;
        }
        return sum / result.size();
    }

	inline float compute_discounted_culmulative_gain (Matrix<float> const &gs, Matrix<float> const &result, unsigned K = 0) {
        if (K == 0) {
            K = result.dim();
        }
        BOOST_VERIFY(gs.dim() >= K);
        BOOST_VERIFY(result.dim() >= K);
        BOOST_VERIFY(gs.size() >= result.size());
        float sum = 0;
        for (unsigned i = 0; i < result.size(); ++i) {
            float const *gs_row = gs[i];
            float const *re_row = result[i];
			float rate = 0.0;
			unsigned re_n = 0;
			for(unsigned gs_n=0; gs_n < K; gs_n++)
			{
				if(gs_row[gs_n]==re_row[re_n])
				{
					rate += 1.0/log2(gs_n+2);
					re_n ++;
				}
			}
            sum += rate;
        }
        return sum / result.size();
    }

    inline void AverageMinDist (Matrix<float> const &gs, Matrix<float> const &result, float *MinDist,float *AvgDist,float *MaxDist) {

        BOOST_VERIFY(gs.size() >= result.size());
        for (unsigned i = 0; i < result.size(); ++i) {
            float const *gs_row = gs[i];
            float const *re_row = result[i];
            *MinDist += re_row[0]-gs_row[0];
            *MaxDist += abs(re_row[result.dim()]-gs_row[0]);
            for(unsigned j=0;j<result.dim();j++)
            {
                *AvgDist += re_row[j]-gs_row[j];
            }
        }
	    *MinDist /= result.size();
        *AvgDist /= result.size()*result.dim();
        *MaxDist /= result.size();
    }
}

#ifndef KGRAPH_NO_VECTORIZE
#ifdef __GNUC__
#ifdef __AVX__
namespace kgraph { namespace metric {
        template <>
        inline float l2sqr::apply<float> (float const *t1, float const *t2, unsigned dim) {
            return float_l2sqr_avx(t1, t2, dim);
        }
}}
#else
#ifdef __SSE2__
namespace kgraph { namespace metric {
        template <>
        inline float l2sqr::apply<float> (float const *t1, float const *t2, unsigned dim) {
            return float_l2sqr_sse2(t1, t2, dim);
        }
        template <>
        inline float l2sqr::apply<uint8_t> (uint8_t const *t1, uint8_t const *t2, unsigned dim) {
            return uint8_l2sqr_sse2(t1, t2, dim);
        }
}}
#endif
#endif
#endif
#endif



#endif



================================================
FILE: algorithms/DPG/src/kgraph.cpp
================================================
//static char const *kgraph_version = KGRAPH_VERSION "-" KGRAPH_BUILD_NUMBER "," KGRAPH_BUILD_ID;
static char const *kgraph_version = "deiversified proximity graph";

#include <omp.h>
#include <unordered_set>
#include <mutex>
#include <iostream>
#include <fstream>
#include <random>
#include <algorithm>
#include <queue>
#include <boost/timer/timer.hpp>
#define timer timer_for_boost_progress_t
#include <boost/progress.hpp>
#undef timer
#include <boost/dynamic_bitset.hpp>
#include <boost/accumulators/accumulators.hpp>
#include <boost/accumulators/statistics/stats.hpp>
#include <boost/accumulators/statistics/mean.hpp>
#include <boost/accumulators/statistics/moment.hpp>
#include "boost/smart_ptr/detail/spinlock.hpp"
#include "kgraph.h"
#include "kgraph-data.h"

namespace kgraph {

    using namespace std;
    using namespace boost;
    using namespace boost::accumulators;

    unsigned verbosity = default_verbosity;

    typedef boost::detail::spinlock Lock;
    typedef std::lock_guard<Lock> LockGuard;

    // generate size distinct random numbers < N
    template <typename RNG>
    static void GenRandom (RNG &rng, unsigned *addr, unsigned size, unsigned N) {
        for (unsigned i = 0; i < size; ++i) {
            addr[i] = rng() % (N - size);
        }
        sort(addr, addr + size);
        for (unsigned i = 1; i < size; ++i) {
            if (addr[i] <= addr[i-1]) {
                addr[i] = addr[i-1] + 1;
            }
        }
        unsigned off = rng() % N;
        for (unsigned i = 0; i < size; ++i) {
            addr[i] = (addr[i] + off) % N;
        }
    }

    struct Neighbor {
        unsigned id;
        float dist;
        bool flag;  // whether this entry is a newly found one      
        Neighbor () {}
        Neighbor (unsigned i, float d, bool f = true): id(i), dist(d), flag(f) {
        }
    };

    static inline bool operator < (Neighbor const &n1, Neighbor const &n2) {
      if (n1.dist == n2.dist)
	return n1.id < n2.id;
      else 
        return n1.dist < n2.dist;
    }

    typedef vector<Neighbor> Neighbors;

    // both pool and knn should be sorted in ascending order
    static float EvaluateRecall (Neighbors const &pool, Neighbors const &knn) {
        if (knn.empty()) return 1.0;
        unsigned found = 0;
        unsigned n_p = 0;
        unsigned n_k = 0;
        for (;;) {
            if (n_p >= pool.size()) break;
            if (n_k >= knn.size()) break;
            if (knn[n_k].dist < pool[n_p].dist) {
                ++n_k;
            }
            else if (knn[n_k].dist == pool[n_p].dist) {
                ++found;
                ++n_k;
                ++n_p;
            }
            else {
                cerr << "Distance is unstable." << endl;
                cerr << "Exact";
                for (auto const &p: knn) {
                    cerr << ' ' << p.id << ':' << p.dist;
                }
                cerr << endl;
                cerr << "Approx";
                for (auto const &p: pool) {
                    cerr << ' ' << p.id << ':' << p.dist;
                }
                cerr << endl;
                throw runtime_error("distance is unstable");
            }
        }
        return float(found) / knn.size(); //recall
    }

    static float EvaluateAccuracy (Neighbors const &pool, Neighbors const &knn) {
        unsigned m = std::min(pool.size(), knn.size());
        float sum = 0;
        unsigned cnt = 0;
        for (unsigned i = 0; i < m; ++i) {
            if (knn[i].dist >  0) {
                sum += abs(pool[i].dist - knn[i].dist) / knn[i].dist;
                ++cnt;
            }
        }
        return cnt > 0 ? sum / cnt: 0;
    }

    static float EvaluateOneRecall (Neighbors const &pool, Neighbors const &knn) {
        if (pool[0].dist == knn[0].dist) return 1.0;
        return 0;
    }
  
    static float EvaluateDelta (Neighbors const &pool, unsigned K) {
        unsigned c = 0;
        unsigned N = K;
        if (pool.size() < N) N = pool.size();
        for (unsigned i = 0; i < N; ++i) {
            if (pool[i].flag) ++c;
        }
        return float(c) / K;  //the fraction of true in pool's flags
    }

    struct Control {
        unsigned id;
        Neighbors neighbors;
    };

    // try insert nn into the list
    // the array addr must contain at least K+1 entries:
    //      addr[0..K-1] is a sorted list
    //      addr[K] is as output parameter
    // * if nn is already in addr[0..K-1], return K+1
    // * Otherwise, do the equivalent of the following
    //      put nn into addr[K]
    //      make addr[0..K] sorted
    //      return the offset of nn's index in addr (could be K)
    //
    // Special case:  K == 0
    //      addr[0] <- nn
    //      return 0
    static inline unsigned UpdateKnnList (Neighbor *addr, unsigned K, Neighbor nn) {
        // find the location to insert
        unsigned j;
        unsigned i = K;
        while (i > 0) {
            j = i - 1;
            if (addr[j].dist <= nn.dist) break;
            i = j;
        }
        // check for equal ID
        unsigned l = i;
        while (l > 0) {
            j = l - 1;
            if (addr[j].dist < nn.dist) break;
            if (addr[j].id == nn.id) return K + 1;
            l = j;
        }
        // i <= K-1
        j = K;
        while (j > i) {
            addr[j] = addr[j-1];
            --j;
        }
        addr[i] = nn;
        return i;
    }

    void LinearSearch (IndexOracle const &oracle, unsigned i, unsigned K, vector<Neighbor> *pnns) {
        vector<Neighbor> nns(K+1);
        unsigned N = oracle.size();
        Neighbor nn;
        nn.id = 0;
        nn.flag = true; // we don't really use this
        unsigned k = 0;
        while (nn.id < N) {
            if (nn.id != i) {
                nn.dist = oracle(i, nn.id);
                UpdateKnnList(&nns[0], k, nn);
                if (k < K) ++k;
            }
            ++nn.id;
        }
        nns.resize(K);
        pnns->swap(nns);
    }

    unsigned SearchOracle::search (unsigned K, float epsilon, unsigned *ids, float *dists) const {
        vector<Neighbor> nns(K+1);
        //cout<<"oracle searching"<<endl;
        unsigned N = size();
        unsigned L = 0;
        for (unsigned k = 0; k < N; ++k) {
            float k_dist = operator () (k);
            if (k_dist > epsilon) continue;
            UpdateKnnList(&nns[0], L, Neighbor(k, k_dist));
            if (L < K) ++L;
        }
        if (ids) {
            for (unsigned k = 0; k < L; ++k) {
                ids[k] = nns[k].id;
            }
        }
        if (dists) {
            for (unsigned k = 0; k < L; ++k) {
                dists[k] = nns[k].dist;
            }
        }
        return L;
    }

    void GenerateControl (IndexOracle const &oracle, unsigned C, unsigned K, vector<Control> *pcontrols) {
        vector<Control> controls(C);
        {
            vector<unsigned> index(oracle.size());
            int i = 0;
            for (unsigned &v: index) {
                v = i++;
            }
            random_shuffle(index.begin(), index.end());
#ifdef PARALLEL            
#pragma omp parallel for
#endif             
            for (unsigned i = 0; i < C; ++i) {
                controls[i].id = index[i];
                LinearSearch(oracle, index[i], K, &controls[i].neighbors);
            }
        }
        pcontrols->swap(controls);
    }

    static char const *KGRAPH_MAGIC = "KNNGRAPH";
    static unsigned constexpr KGRAPH_MAGIC_SIZE = 8;
    static uint32_t constexpr VERSION_MAJOR = 2;
    static uint32_t constexpr VERSION_MINOR = 0;

    class KGraphImpl: public KGraph {
    protected:
        vector<unsigned> M;
        vector<vector<Neighbor>> graph;
    public:
        virtual ~KGraphImpl () {
        }
        virtual void load (char const *path) {
            BOOST_VERIFY(sizeof(unsigned) == sizeof(uint32_t));
            ifstream is(path, ios::binary);
            char magic[KGRAPH_MAGIC_SIZE];
            uint32_t major;
            uint32_t minor;
            uint32_t N;
            is.read(magic, sizeof(magic));
            is.read(reinterpret_cast<char *>(&major), sizeof(major));
            is.read(reinterpret_cast<char *>(&minor), sizeof(minor));
            if (major != VERSION_MAJOR) throw runtime_error("data version not supported.");
            is.read(reinterpret_cast<char *>(&N), sizeof(N));
            if (!is) runtime_error("error reading index file.");
            for (unsigned i = 0; i < KGRAPH_MAGIC_SIZE; ++i) {
                if (KGRAPH_MAGIC[i] != magic[i]) runtime_error("index corrupted.");
            }
            graph.resize(N);
            M.resize(N);
            for (unsigned i = 0; i < graph.size(); ++i) {
                auto &knn = graph[i];
                unsigned K;
                is.read(reinterpret_cast<char *>(&M[i]), sizeof(M[i]));
                is.read(reinterpret_cast<char *>(&K), sizeof(K));
                if (!is) runtime_error("error reading index file.");
                knn.resize(K);
                //modified by Yifang
                for (unsigned j = 0; j < K; ++j){
                  is.read(reinterpret_cast<char *>(&knn[j].id), sizeof(knn[j].id));
                  knn[j].flag = true;
                  knn[j].dist = 0.0;
                }
                //is.read(reinterpret_cast<char *>(&knn[0]), K * sizeof(knn[0]));
            }
        }

      virtual void merge(char const * graph_path, char const * id_path){
	ifstream is(graph_path, ios::binary);
	char magic[KGRAPH_MAGIC_SIZE];
	uint32_t major;
	uint32_t minor;
	uint32_t N;
	is.read(magic, sizeof(magic));
	is.read(reinterpret_cast<char *>(&major), sizeof(major));
	is.read(reinterpret_cast<char *>(&minor), sizeof(minor));
	if (major != VERSION_MAJOR) throw runtime_error("data version not supported.");
	is.read(reinterpret_cast<char *>(&N), sizeof(N));
	if (!is) runtime_error("error reading index file.");
	for (unsigned i = 0; i < KGRAPH_MAGIC_SIZE; ++i) {
	  if (KGRAPH_MAGIC[i] != magic[i]) runtime_error("index corrupted.");
	}
	vector<vector<Neighbor> > small_graph;
	vector<unsigned> small_M;
	small_graph.resize(N);
	small_M.resize(N);
	for (unsigned i = 0; i < small_graph.size(); ++i) {
	  auto &knn = small_graph[i];
	  unsigned K;
	  is.read(reinterpret_cast<char *>(&small_M[i]), sizeof(small_M[i]));
	  is.read(reinterpret_cast<char *>(&K), sizeof(K));
	  if (!is) runtime_error("error reading index file.");
	  knn.resize(K);
	  is.read(reinterpret_cast<char *>(&knn[0]), K * sizeof(knn[0]));
	}
	//loaded the small graph
	FILE *fp = fopen(id_path, "rb");
	unsigned * id_arr = new unsigned[N];
	fread(id_arr, sizeof(unsigned), N, fp);
	fclose(fp);

	for (unsigned i = 0; i < N; ++i){
	  unsigned real_id = id_arr[i];
	  auto &small_knn = small_graph[i];
	  auto &knn = graph[real_id];
	  if (M[real_id] != knn.size()){
	    knn.resize(M[real_id]);
	  }
	  for (unsigned k = 0; k < small_M[i]; ++k){
	    knn.push_back(Neighbor(id_arr[small_knn[k].id], small_knn[k].dist, false));
	  }
	  sort(knn.begin(), knn.end());
	  for (unsigned k = 1; k < knn.size(); ++k){
	    if (knn[k].id == knn[k-1].id){
	      knn.erase(knn.begin() + k);
	      k--;
	    }
	  }
	  M[real_id] = knn.size();
	}	
      }

        virtual void output_info(int const id){
	  if (id > graph.size()){
	    fprintf(stderr, "out_of_index_bound!\n");
	    return;
	  }
	  auto const &knn = graph[id];
	  knn.size();
	  
	  fprintf(stderr, "%d\n%d\n=================\n", M[id], knn.size());
	  for (int i = 0; i < knn.size(); ++i){
	    fprintf(stderr, "%d %f\n", knn[i].id, knn[i].dist);
	  }
	}


      struct hub_pair{
	unsigned id;
	int in_degree;
	hub_pair(unsigned x, int y){
	  id = x;
	  in_degree = y;
	}
	bool operator<(const hub_pair& rhs) const{
	  return in_degree > rhs.in_degree;
	}
      };
      
      struct rknn_pair{
	unsigned id;
	float dist;
	rknn_pair(unsigned x, float y){
	  id = x;
	  dist = y;
	}
      };

      virtual void connectivity(unsigned const source, unsigned const dest){
	uint32_t N = graph.size();
	int level[N];
	for (int i = 0; i < N; ++i){
	  level[i] = 0;
	}
	
	queue<unsigned> q;
	q.push(source);
	level[source] = 1;
	bool find = false;
	while (!q.empty() && !find){
	  unsigned cur_id = q.front();
	  auto const &knn = graph[cur_id];
	  q.pop();
	  for (int i = 0; i < M[cur_id]; ++i){
	    if (level[knn[i].id] != 0){
	      continue;
	    }
	    q.push(knn[i].id);
	    level[knn[i].id] = level[cur_id] + 1;
	    if (knn[i].id == dest){
	      find = true;
	      fprintf(stderr, "Found! Level = %d\n", level[knn[i].id]);
	    }
	  }
	}
	if (!find){
	  fprintf(stderr, "Not Found!\n");
	}
      }

      virtual void get_partitions(char const *output_path){
	vector<vector<int> > partitions;
	uint32_t N = graph.size();
	for (int i = 0; i < N; ++i){
	  if (i % 1000 == 0) {
            fprintf(stderr, "\r%d (%.3f\%)", i, 1.0 * i / N * 100);
          }
	  auto const &knn = graph[i];
	  int major_set_pos = -1;
	  for (int j = 0; j < partitions.size(); ++j){
	    if (find (partitions[j].begin(), partitions[j].end(), i) != partitions[j].end()){
	      major_set_pos = j;
	      break;
	    }
	  }
	  if (major_set_pos == -1){
	    vector<int> new_set;
	    new_set.push_back(i);
	    partitions.push_back(new_set);
	    major_set_pos = partitions
Download .txt
gitextract_qmxghsr6/

├── .gitignore
├── README.md
├── algorithms/
│   ├── AGH/
│   │   ├── README.md
│   │   ├── preprocess/
│   │   │   ├── OneLayerAGH_Test.m
│   │   │   ├── OneLayerAGH_Train.m
│   │   │   ├── TwoLayerAGH_Test.m
│   │   │   ├── TwoLayerAGH_Train.m
│   │   │   ├── compactbit.m
│   │   │   ├── fvecs_read.m
│   │   │   ├── get_anchor.m
│   │   │   ├── hammingDist.m
│   │   │   ├── ivecs_read.m
│   │   │   ├── ivecs_write.m
│   │   │   ├── main.m
│   │   │   ├── main_OneLayer.m
│   │   │   ├── main_TwoLayer.m
│   │   │   ├── main_c_OneLayer.m~
│   │   │   ├── main_c_TwoLayer.m~
│   │   │   └── sqdist.m
│   │   ├── script/
│   │   │   └── searcher.sh
│   │   └── src/
│   │       ├── AGH.cpp
│   │       ├── AGH.h
│   │       ├── Makefile
│   │       ├── center_chooser.h
│   │       ├── char_bit_cnt.h
│   │       ├── data_util.h
│   │       ├── dynamic_bitset.h
│   │       ├── eval.h
│   │       ├── hammingDist.h
│   │       ├── heap.h
│   │       ├── hierarchical_clustering_index.h
│   │       ├── random.h
│   │       └── result_set.h
│   ├── Annoy/
│   │   ├── README.html
│   │   ├── README.md
│   │   ├── script/
│   │   │   ├── indexer.sh
│   │   │   ├── run.sh
│   │   │   └── searcher.sh
│   │   └── src/
│   │       ├── Makefile
│   │       ├── annoy.cpp
│   │       ├── data.h
│   │       ├── indexer.cpp
│   │       ├── kissrandom.h
│   │       └── searcher.cpp
│   ├── DPG/
│   │   ├── README.html
│   │   ├── README.md
│   │   ├── script/
│   │   │   ├── build_index.sh
│   │   │   └── search.sh
│   │   └── src/
│   │       ├── DPG_diverse.cpp
│   │       ├── DPG_index.cpp
│   │       ├── DPG_search.cpp
│   │       ├── Makefile
│   │       ├── RandGen.cpp
│   │       ├── RandGen.h
│   │       ├── build.sh
│   │       ├── kgraph-data.h
│   │       ├── kgraph.cpp
│   │       ├── kgraph.h
│   │       ├── main.cpp
│   │       └── metric.cpp
│   ├── KGraph/
│   │   ├── README.html
│   │   ├── README.md
│   │   ├── script/
│   │   │   ├── kgraph_index.sh
│   │   │   └── kgraph_search.sh
│   │   └── src/
│   │       ├── Makefile
│   │       ├── RandGen.cpp
│   │       ├── RandGen.h
│   │       ├── build.sh
│   │       ├── kgraph-data.h
│   │       ├── kgraph.cpp
│   │       ├── kgraph.h
│   │       ├── kgraph_index.cpp
│   │       ├── kgraph_search.cpp
│   │       └── metric.cpp
│   ├── NMSLIB/
│   │   ├── README.md
│   │   ├── code/
│   │   │   ├── CMakeFiles/
│   │   │   │   ├── 3.2.3/
│   │   │   │   │   ├── CMakeCCompiler.cmake
│   │   │   │   │   ├── CMakeCXXCompiler.cmake
│   │   │   │   │   ├── CMakeSystem.cmake
│   │   │   │   │   ├── CompilerIdC/
│   │   │   │   │   │   └── CMakeCCompilerId.c
│   │   │   │   │   └── CompilerIdCXX/
│   │   │   │   │       └── CMakeCXXCompilerId.cpp
│   │   │   │   ├── CMakeDirectoryInformation.cmake
│   │   │   │   ├── CMakeError.log
│   │   │   │   ├── CMakeOutput.log
│   │   │   │   ├── Makefile.cmake
│   │   │   │   ├── Makefile2
│   │   │   │   ├── TargetDirectories.txt
│   │   │   │   ├── cmake.check_cache
│   │   │   │   ├── feature_tests.c
│   │   │   │   ├── feature_tests.cxx
│   │   │   │   └── progress.marks
│   │   │   ├── CMakeLists.txt
│   │   │   ├── CMakeLists.txt~
│   │   │   ├── FindEigen3.cmake
│   │   │   ├── FindGSL.cmake
│   │   │   ├── Makefile
│   │   │   ├── NonMetricSpaceLib.sln
│   │   │   ├── cmake_install.cmake
│   │   │   ├── include/
│   │   │   │   ├── cluster_util.h
│   │   │   │   ├── distcomp.h
│   │   │   │   ├── distcomp_edist.h
│   │   │   │   ├── eval_metrics.h
│   │   │   │   ├── eval_results.h
│   │   │   │   ├── experimentconf.h
│   │   │   │   ├── experiments.h
│   │   │   │   ├── factory/
│   │   │   │   │   ├── init_methods.h
│   │   │   │   │   ├── init_spaces.h
│   │   │   │   │   ├── method/
│   │   │   │   │   │   ├── bbtree.h
│   │   │   │   │   │   ├── dummy.h
│   │   │   │   │   │   ├── ghtree.h
│   │   │   │   │   │   ├── hnsw.h
│   │   │   │   │   │   ├── list_clusters.h
│   │   │   │   │   │   ├── lsh.h
│   │   │   │   │   │   ├── lsh_multiprobe.h
│   │   │   │   │   │   ├── multi_index.h
│   │   │   │   │   │   ├── multi_vantage_point_tree.h
│   │   │   │   │   │   ├── nndes.h
│   │   │   │   │   │   ├── nonmetr_list_clust.h
│   │   │   │   │   │   ├── omedrank.h
│   │   │   │   │   │   ├── perm_bin_vptree.h
│   │   │   │   │   │   ├── perm_index_incr_bin.h
│   │   │   │   │   │   ├── perm_lsh_bin.h
│   │   │   │   │   │   ├── permutation_inverted_index.h
│   │   │   │   │   │   ├── permutation_prefix_index.h
│   │   │   │   │   │   ├── pivot_neighb_invindx.h
│   │   │   │   │   │   ├── proj_vptree.h
│   │   │   │   │   │   ├── projection_index_incremental.h
│   │   │   │   │   │   ├── seqsearch.h
│   │   │   │   │   │   ├── small_world_rand.h
│   │   │   │   │   │   ├── spatial_approx_tree.h
│   │   │   │   │   │   └── vptree.h
│   │   │   │   │   └── space/
│   │   │   │   │       ├── space_bit_hamming.h
│   │   │   │   │       ├── space_bregman.h
│   │   │   │   │       ├── space_dummy.h
│   │   │   │   │       ├── space_edist.h
│   │   │   │   │       ├── space_js.h
│   │   │   │   │       ├── space_lp.h
│   │   │   │   │       ├── space_savch.h
│   │   │   │   │       ├── space_scalar.h
│   │   │   │   │       ├── space_sparse_lp.h
│   │   │   │   │       ├── space_sparse_scalar.h
│   │   │   │   │       ├── space_sqfd.h
│   │   │   │   │       └── space_word_embed.h
│   │   │   │   ├── flexbuff.h
│   │   │   │   ├── floatdiff.h
│   │   │   │   ├── global.h
│   │   │   │   ├── gold_standard.h
│   │   │   │   ├── idtype.h
│   │   │   │   ├── incremental_quick_select.h
│   │   │   │   ├── index.h
│   │   │   │   ├── init.h
│   │   │   │   ├── knnquery.h
│   │   │   │   ├── knnqueue.h
│   │   │   │   ├── logging.h
│   │   │   │   ├── memory.h
│   │   │   │   ├── meta_analysis.h
│   │   │   │   ├── method/
│   │   │   │   │   ├── bbtree.h
│   │   │   │   │   ├── dummy.h
│   │   │   │   │   ├── ghtree.h
│   │   │   │   │   ├── hnsw.h
│   │   │   │   │   ├── lcstrategy.h
│   │   │   │   │   ├── list_clusters.h
│   │   │   │   │   ├── lsh.h
│   │   │   │   │   ├── lsh_multiprobe.h
│   │   │   │   │   ├── lsh_space.h
│   │   │   │   │   ├── multi_index.h
│   │   │   │   │   ├── multi_vantage_point_tree.h
│   │   │   │   │   ├── multi_vantage_point_tree_utils.h
│   │   │   │   │   ├── nndes.h
│   │   │   │   │   ├── nonmetr_list_clust.h
│   │   │   │   │   ├── omedrank.h
│   │   │   │   │   ├── perm_bin_vptree.h
│   │   │   │   │   ├── perm_index_incr_bin.h
│   │   │   │   │   ├── perm_lsh_bin.h
│   │   │   │   │   ├── permutation_inverted_index.h
│   │   │   │   │   ├── permutation_prefix_index.h
│   │   │   │   │   ├── pivot_neighb_common.h
│   │   │   │   │   ├── pivot_neighb_invindx.h
│   │   │   │   │   ├── proj_vptree.h
│   │   │   │   │   ├── projection_index_incremental.h
│   │   │   │   │   ├── seqsearch.h
│   │   │   │   │   ├── small_world_rand.h
│   │   │   │   │   ├── small_world_rand_split.h
│   │   │   │   │   ├── spatial_approx_tree.h
│   │   │   │   │   ├── vptree.h
│   │   │   │   │   └── vptree_utils.h
│   │   │   │   ├── methodfactory.h
│   │   │   │   ├── nndes/
│   │   │   │   │   ├── nndes-common.h
│   │   │   │   │   └── nndes.h
│   │   │   │   ├── object.h
│   │   │   │   ├── params.h
│   │   │   │   ├── params_cmdline.h
│   │   │   │   ├── params_def.h
│   │   │   │   ├── permutation_type.h
│   │   │   │   ├── permutation_utils.h
│   │   │   │   ├── ported_boost_progress.h
│   │   │   │   ├── pow.h
│   │   │   │   ├── projection.h
│   │   │   │   ├── query.h
│   │   │   │   ├── query_creator.h
│   │   │   │   ├── randproj_util.h
│   │   │   │   ├── rangequery.h
│   │   │   │   ├── report.h
│   │   │   │   ├── report.h~
│   │   │   │   ├── report_intr_dim.h
│   │   │   │   ├── searchoracle.h
│   │   │   │   ├── simddebug.h
│   │   │   │   ├── simdutils.h
│   │   │   │   ├── sort_arr_bi.h
│   │   │   │   ├── space/
│   │   │   │   │   ├── space_bit_hamming.h
│   │   │   │   │   ├── space_bregman.h
│   │   │   │   │   ├── space_dummy.h
│   │   │   │   │   ├── space_js.h
│   │   │   │   │   ├── space_leven.h
│   │   │   │   │   ├── space_lp.h
│   │   │   │   │   ├── space_rank_correl.h
│   │   │   │   │   ├── space_scalar.h
│   │   │   │   │   ├── space_sparse_lp.h
│   │   │   │   │   ├── space_sparse_scalar.h
│   │   │   │   │   ├── space_sparse_scalar_fast.h
│   │   │   │   │   ├── space_sparse_vector.h
│   │   │   │   │   ├── space_sparse_vector_inter.h
│   │   │   │   │   ├── space_sqfd.h
│   │   │   │   │   ├── space_string.h
│   │   │   │   │   ├── space_vector.h
│   │   │   │   │   ├── space_vector_gen.h
│   │   │   │   │   └── space_word_embed.h
│   │   │   │   ├── space.h
│   │   │   │   ├── spacefactory.h
│   │   │   │   ├── tune.h
│   │   │   │   ├── utils.h
│   │   │   │   ├── utils.h~
│   │   │   │   └── ztimer.h
│   │   │   ├── launches/
│   │   │   │   └── sample.launch
│   │   │   ├── lshkit/
│   │   │   │   ├── CMakeFiles/
│   │   │   │   │   ├── CMakeDirectoryInformation.cmake
│   │   │   │   │   ├── lshkit.dir/
│   │   │   │   │   │   ├── CXX.includecache
│   │   │   │   │   │   ├── DependInfo.cmake
│   │   │   │   │   │   ├── build.make
│   │   │   │   │   │   ├── cmake_clean.cmake
│   │   │   │   │   │   ├── cmake_clean_target.cmake
│   │   │   │   │   │   ├── depend.internal
│   │   │   │   │   │   ├── depend.make
│   │   │   │   │   │   ├── flags.make
│   │   │   │   │   │   ├── link.txt
│   │   │   │   │   │   └── progress.make
│   │   │   │   │   └── progress.marks
│   │   │   │   ├── CMakeLists.txt
│   │   │   │   ├── Makefile
│   │   │   │   ├── cmake_install.cmake
│   │   │   │   ├── include/
│   │   │   │   │   ├── lshkit/
│   │   │   │   │   │   ├── apost.h
│   │   │   │   │   │   ├── archive.h
│   │   │   │   │   │   ├── common.h
│   │   │   │   │   │   ├── composite.h
│   │   │   │   │   │   ├── concept.h
│   │   │   │   │   │   ├── eval.h
│   │   │   │   │   │   ├── forest.h
│   │   │   │   │   │   ├── histogram.h
│   │   │   │   │   │   ├── kernel.h
│   │   │   │   │   │   ├── lsh-index.h
│   │   │   │   │   │   ├── lsh.h
│   │   │   │   │   │   ├── matrix-io.h
│   │   │   │   │   │   ├── matrix.h
│   │   │   │   │   │   ├── metric.h
│   │   │   │   │   │   ├── mplsh-model.h
│   │   │   │   │   │   ├── mplsh.h
│   │   │   │   │   │   ├── multiprobelsh-fitdata.h
│   │   │   │   │   │   ├── multiprobelsh-tune.h
│   │   │   │   │   │   ├── sketch.h
│   │   │   │   │   │   ├── spectral-hash.h
│   │   │   │   │   │   ├── topk.h
│   │   │   │   │   │   ├── tune.h
│   │   │   │   │   │   └── vq.h
│   │   │   │   │   └── lshkit.h
│   │   │   │   ├── src/
│   │   │   │   │   ├── apost.cpp
│   │   │   │   │   ├── char_bit_cnt.cpp
│   │   │   │   │   ├── kdtree.cpp
│   │   │   │   │   ├── kdtree.h
│   │   │   │   │   ├── mplsh-model.cpp
│   │   │   │   │   ├── mplsh.cpp
│   │   │   │   │   └── vq.cpp
│   │   │   │   └── tools/
│   │   │   │       ├── CMakeLists.txt
│   │   │   │       ├── apost-run.cpp
│   │   │   │       ├── dump-query.cpp
│   │   │   │       ├── embed.cpp
│   │   │   │       ├── fitdata.cpp
│   │   │   │       ├── forest-run.cpp
│   │   │   │       ├── lsh-run.cpp
│   │   │   │       ├── mplsh-predict.cpp
│   │   │   │       ├── mplsh-run.cpp
│   │   │   │       ├── mplsh-tune.cpp
│   │   │   │       ├── run-spectral.cpp
│   │   │   │       ├── scan.cpp
│   │   │   │       ├── sketch-run.cpp
│   │   │   │       └── txt2bin.cpp
│   │   │   ├── src/
│   │   │   │   ├── CMakeFiles/
│   │   │   │   │   ├── CMakeDirectoryInformation.cmake
│   │   │   │   │   ├── NonMetricSpaceLib.dir/
│   │   │   │   │   │   ├── CXX.includecache
│   │   │   │   │   │   ├── DependInfo.cmake
│   │   │   │   │   │   ├── build.make
│   │   │   │   │   │   ├── cmake_clean.cmake
│   │   │   │   │   │   ├── cmake_clean_target.cmake
│   │   │   │   │   │   ├── depend.internal
│   │   │   │   │   │   ├── depend.make
│   │   │   │   │   │   ├── flags.make
│   │   │   │   │   │   ├── link.txt
│   │   │   │   │   │   └── progress.make
│   │   │   │   │   ├── dummy_app.dir/
│   │   │   │   │   │   ├── CXX.includecache
│   │   │   │   │   │   ├── DependInfo.cmake
│   │   │   │   │   │   ├── build.make
│   │   │   │   │   │   ├── cmake_clean.cmake
│   │   │   │   │   │   ├── depend.internal
│   │   │   │   │   │   ├── depend.make
│   │   │   │   │   │   ├── flags.make
│   │   │   │   │   │   ├── link.txt
│   │   │   │   │   │   └── progress.make
│   │   │   │   │   ├── experiment.dir/
│   │   │   │   │   │   ├── CXX.includecache
│   │   │   │   │   │   ├── DependInfo.cmake
│   │   │   │   │   │   ├── build.make
│   │   │   │   │   │   ├── cmake_clean.cmake
│   │   │   │   │   │   ├── depend.internal
│   │   │   │   │   │   ├── depend.make
│   │   │   │   │   │   ├── flags.make
│   │   │   │   │   │   ├── link.txt
│   │   │   │   │   │   └── progress.make
│   │   │   │   │   ├── progress.marks
│   │   │   │   │   └── tune_vptree.dir/
│   │   │   │   │       ├── CXX.includecache
│   │   │   │   │       ├── DependInfo.cmake
│   │   │   │   │       ├── build.make
│   │   │   │   │       ├── cmake_clean.cmake
│   │   │   │   │       ├── depend.internal
│   │   │   │   │       ├── depend.make
│   │   │   │   │       ├── flags.make
│   │   │   │   │       ├── link.txt
│   │   │   │   │       └── progress.make
│   │   │   │   ├── CMakeLists.txt
│   │   │   │   ├── Makefile
│   │   │   │   ├── NonMetricSpaceLib.vcxproj
│   │   │   │   ├── NonMetricSpaceLib.vcxproj.filters
│   │   │   │   ├── cluster_util.cc
│   │   │   │   ├── cmake_install.cmake
│   │   │   │   ├── distcomp_bregman.cc
│   │   │   │   ├── distcomp_edist.cc
│   │   │   │   ├── distcomp_js.cc
│   │   │   │   ├── distcomp_lp.cc
│   │   │   │   ├── distcomp_lp.cc~
│   │   │   │   ├── distcomp_rankcorr.cc
│   │   │   │   ├── distcomp_scalar.cc
│   │   │   │   ├── distcomp_sparse_scalar_fast.cc
│   │   │   │   ├── dummy_app.cc
│   │   │   │   ├── dummy_app.vcxproj
│   │   │   │   ├── dummy_app.vcxproj.filters
│   │   │   │   ├── experiment.vcxproj
│   │   │   │   ├── experiment.vcxproj.filters
│   │   │   │   ├── experimentconf.cc
│   │   │   │   ├── global.cc
│   │   │   │   ├── init.cc
│   │   │   │   ├── knnquery.cc
│   │   │   │   ├── logging.cc
│   │   │   │   ├── main.cc
│   │   │   │   ├── main.cc~
│   │   │   │   ├── memory.cc
│   │   │   │   ├── method/
│   │   │   │   │   ├── bbtree.cc
│   │   │   │   │   ├── dummy.cc
│   │   │   │   │   ├── ghtree.cc
│   │   │   │   │   ├── hnsw.cc
│   │   │   │   │   ├── hnsw.cc~
│   │   │   │   │   ├── hnsw_distfunc_opt.cc
│   │   │   │   │   ├── hnsw_distfunc_opt.cc~
│   │   │   │   │   ├── list_clusters.cc
│   │   │   │   │   ├── lsh.cc
│   │   │   │   │   ├── lsh_multiprobe.cc
│   │   │   │   │   ├── lsh_space.cc
│   │   │   │   │   ├── multi_index.cc
│   │   │   │   │   ├── multi_vantage_point_tree.cc
│   │   │   │   │   ├── nndes.cc
│   │   │   │   │   ├── nonmetr_list_clust.cc
│   │   │   │   │   ├── omedrank.cc
│   │   │   │   │   ├── perm_bin_vptree.cc
│   │   │   │   │   ├── perm_index_incr_bin.cc
│   │   │   │   │   ├── perm_lsh_bin.cc
│   │   │   │   │   ├── permutation_inverted_index.cc
│   │   │   │   │   ├── permutation_prefix_index.cc
│   │   │   │   │   ├── pivot_neighb_invindx.cc
│   │   │   │   │   ├── proj_vptree.cc
│   │   │   │   │   ├── projection_index_incremental.cc
│   │   │   │   │   ├── seqsearch.cc
│   │   │   │   │   ├── small_world_rand.cc
│   │   │   │   │   ├── small_world_rand.cc~
│   │   │   │   │   ├── small_world_rand_split.cc
│   │   │   │   │   ├── spatial_approx_tree.cc
│   │   │   │   │   └── vptree.cc
│   │   │   │   ├── params.cc
│   │   │   │   ├── params_cmdline.cc
│   │   │   │   ├── projection.cc
│   │   │   │   ├── query.cc
│   │   │   │   ├── randproj_util.cc
│   │   │   │   ├── rangequery.cc
│   │   │   │   ├── searchoracle.cc
│   │   │   │   ├── space/
│   │   │   │   │   ├── space_bit_hamming.cc
│   │   │   │   │   ├── space_bregman.cc
│   │   │   │   │   ├── space_dummy.cc
│   │   │   │   │   ├── space_js.cc
│   │   │   │   │   ├── space_lp.cc
│   │   │   │   │   ├── space_scalar.cc
│   │   │   │   │   ├── space_sparse_lp.cc
│   │   │   │   │   ├── space_sparse_scalar_fast.cc
│   │   │   │   │   ├── space_sparse_vector.cc
│   │   │   │   │   ├── space_sparse_vector_inter.cc
│   │   │   │   │   ├── space_sqfd.cc
│   │   │   │   │   ├── space_string.cc
│   │   │   │   │   ├── space_vector.cc
│   │   │   │   │   └── space_word_embed.cc
│   │   │   │   ├── space.cc
│   │   │   │   ├── tune_vptree.cc
│   │   │   │   ├── tune_vptree.vcxproj
│   │   │   │   ├── tune_vptree.vcxproj.filters
│   │   │   │   └── utils.cc
│   │   │   └── test/
│   │   │       ├── CMakeFiles/
│   │   │       │   ├── CMakeDirectoryInformation.cmake
│   │   │       │   ├── bench_distfunc.dir/
│   │   │       │   │   ├── CXX.includecache
│   │   │       │   │   ├── DependInfo.cmake
│   │   │       │   │   ├── build.make
│   │   │       │   │   ├── cmake_clean.cmake
│   │   │       │   │   ├── depend.internal
│   │   │       │   │   ├── depend.make
│   │   │       │   │   ├── flags.make
│   │   │       │   │   ├── link.txt
│   │   │       │   │   └── progress.make
│   │   │       │   ├── bench_projection.dir/
│   │   │       │   │   ├── CXX.includecache
│   │   │       │   │   ├── DependInfo.cmake
│   │   │       │   │   ├── build.make
│   │   │       │   │   ├── cmake_clean.cmake
│   │   │       │   │   ├── depend.internal
│   │   │       │   │   ├── depend.make
│   │   │       │   │   ├── flags.make
│   │   │       │   │   ├── link.txt
│   │   │       │   │   └── progress.make
│   │   │       │   ├── bunit.dir/
│   │   │       │   │   ├── CXX.includecache
│   │   │       │   │   ├── DependInfo.cmake
│   │   │       │   │   ├── build.make
│   │   │       │   │   ├── cmake_clean.cmake
│   │   │       │   │   ├── depend.internal
│   │   │       │   │   ├── depend.make
│   │   │       │   │   ├── flags.make
│   │   │       │   │   ├── link.txt
│   │   │       │   │   └── progress.make
│   │   │       │   ├── progress.marks
│   │   │       │   ├── report_intr_dim.dir/
│   │   │       │   │   ├── CXX.includecache
│   │   │       │   │   ├── DependInfo.cmake
│   │   │       │   │   ├── build.make
│   │   │       │   │   ├── cmake_clean.cmake
│   │   │       │   │   ├── depend.internal
│   │   │       │   │   ├── depend.make
│   │   │       │   │   ├── flags.make
│   │   │       │   │   ├── link.txt
│   │   │       │   │   └── progress.make
│   │   │       │   ├── test_clust.dir/
│   │   │       │   │   ├── CXX.includecache
│   │   │       │   │   ├── DependInfo.cmake
│   │   │       │   │   ├── build.make
│   │   │       │   │   ├── cmake_clean.cmake
│   │   │       │   │   ├── depend.internal
│   │   │       │   │   ├── depend.make
│   │   │       │   │   ├── flags.make
│   │   │       │   │   ├── link.txt
│   │   │       │   │   └── progress.make
│   │   │       │   └── test_integr.dir/
│   │   │       │       ├── CXX.includecache
│   │   │       │       ├── DependInfo.cmake
│   │   │       │       ├── build.make
│   │   │       │       ├── cmake_clean.cmake
│   │   │       │       ├── depend.internal
│   │   │       │       ├── depend.make
│   │   │       │       ├── flags.make
│   │   │       │       ├── link.txt
│   │   │       │       └── progress.make
│   │   │       ├── CMakeLists.txt
│   │   │       ├── Makefile
│   │   │       ├── bench_distfunc.cc
│   │   │       ├── bench_distfunc.vcxproj
│   │   │       ├── bench_projection.cc
│   │   │       ├── bunit.cc
│   │   │       ├── bunit.h
│   │   │       ├── bunit.vcxproj
│   │   │       ├── bunit.vcxproj.filters
│   │   │       ├── bunit.vcxproj.user
│   │   │       ├── cmake_install.cmake
│   │   │       ├── genrand_vect.h
│   │   │       ├── report_intr_dim.cc
│   │   │       ├── test_clust.cc
│   │   │       ├── test_distfunc.cc
│   │   │       ├── test_editdist.cc
│   │   │       ├── test_eval.cc
│   │   │       ├── test_fp.cc
│   │   │       ├── test_integr.cc
│   │   │       ├── test_integr.vcxproj
│   │   │       ├── test_integr_util.h
│   │   │       ├── test_lpnorm.cc
│   │   │       ├── test_object.cc
│   │   │       ├── test_proj.cc
│   │   │       ├── test_space_serial.cc
│   │   │       ├── test_sqfd.cc
│   │   │       ├── test_timer.cc
│   │   │       └── testdataset.h
│   │   └── script/
│   │       ├── run_HNSW.sh
│   │       ├── run_NAPP.sh
│   │       ├── run_SW.sh
│   │       └── run_vptree.sh
│   ├── NSH/
│   │   ├── README.md
│   │   ├── preprocess/
│   │   │   ├── compactbit.m
│   │   │   ├── computeRecall.m
│   │   │   ├── distMat.m
│   │   │   ├── fvecs_read.m
│   │   │   ├── hammingDist.m
│   │   │   ├── ivecs_read.m
│   │   │   ├── ivecs_write.m
│   │   │   ├── main.m
│   │   │   ├── readme.markdown
│   │   │   ├── run_NSH.m
│   │   │   └── trainNSH.m
│   │   ├── script/
│   │   │   └── searcher.sh
│   │   └── src/
│   │       ├── Makefile
│   │       ├── NSH.cpp
│   │       ├── NSH.h
│   │       ├── center_chooser.h
│   │       ├── char_bit_cnt.h
│   │       ├── data_util.h
│   │       ├── dynamic_bitset.h
│   │       ├── eval.h
│   │       ├── hammingDist.h
│   │       ├── heap.h
│   │       ├── hierarchical_clustering_index.h
│   │       ├── random.h
│   │       └── result_set.h
│   ├── OPQ/
│   │   ├── README.html
│   │   ├── README.md
│   │   ├── TransForm_Data/
│   │   │   ├── coarse_vocabularies.m
│   │   │   ├── coarse_vocabularies.m~
│   │   │   ├── fine_vocabularies.m
│   │   │   ├── fvecs_read.m
│   │   │   ├── fvecs_write.m
│   │   │   ├── generate_learn.m
│   │   │   ├── generate_learn.m~
│   │   │   ├── main.m
│   │   │   ├── sqdist.m
│   │   │   ├── train_opq_np.m
│   │   │   ├── transform_base_query.m
│   │   │   └── transform_base_query.m~
│   │   ├── script/
│   │   │   ├── indexer.sh
│   │   │   └── searcher.sh
│   │   └── src/
│   │       ├── CMakeLists.txt
│   │       ├── IndexerLauncher.cmake
│   │       ├── NearestSearch.cmake
│   │       ├── SearcherTester.cmake
│   │       ├── build_release.sh
│   │       ├── data_util.cpp
│   │       ├── data_util.h
│   │       ├── indexer.h
│   │       ├── indexer_launcher.cpp
│   │       ├── make_project.bat
│   │       ├── multitable.hpp
│   │       ├── ordered_lists_merger.h
│   │       ├── perfomance_util.cpp
│   │       ├── perfomance_util.h
│   │       ├── run_indexer.py
│   │       ├── run_indexer_vlad.py
│   │       ├── run_searcher.py
│   │       ├── run_searcher_vlad.py
│   │       ├── searcher.h
│   │       └── searcher_tester.cpp
│   ├── QALSH/
│   │   ├── Makefile
│   │   ├── README.md
│   │   ├── script/
│   │   │   ├── build.sh
│   │   │   └── search.sh
│   │   └── src/
│   │       ├── ann.cpp
│   │       ├── ann.h
│   │       ├── b_node.cpp
│   │       ├── b_node.h
│   │       ├── b_tree.cpp
│   │       ├── b_tree.h
│   │       ├── block_file.cpp
│   │       ├── block_file.h
│   │       ├── def.h
│   │       ├── headers.h
│   │       ├── main.cpp
│   │       ├── qalsh.cpp
│   │       ├── qalsh.h
│   │       ├── random.cpp
│   │       ├── random.h
│   │       ├── util.cpp
│   │       └── util.h
│   ├── RCT/
│   │   ├── README.html
│   │   ├── README.md
│   │   ├── script/
│   │   │   ├── build.sh
│   │   │   └── search.sh
│   │   └── src/
│   │       ├── DistData.cpp
│   │       ├── DistData.h
│   │       ├── Makefile
│   │       ├── data_util.h
│   │       ├── indexer.cpp
│   │       ├── random.cpp
│   │       ├── random.h
│   │       ├── rct.cpp
│   │       ├── rct.h
│   │       ├── searcher
│   │       └── searcher.cpp
│   ├── README.md
│   ├── SGH/
│   │   ├── README.md
│   │   ├── preprocess/
│   │   │   ├── calculateMap.m
│   │   │   ├── calculaterecall.m
│   │   │   ├── compactbit.m
│   │   │   ├── distMat.m
│   │   │   ├── fvecs_read.m
│   │   │   ├── genGroundTruth.m
│   │   │   ├── hammingDist.m
│   │   │   ├── ivecs_read.m
│   │   │   ├── ivecs_write.m
│   │   │   ├── main.m
│   │   │   ├── run_SGH.m
│   │   │   ├── sqdist.m
│   │   │   └── trainSGH.m
│   │   ├── script/
│   │   │   └── searcher.sh
│   │   └── src/
│   │       ├── Makefile
│   │       ├── SGH.cpp
│   │       ├── SGH.h
│   │       ├── center_chooser.h
│   │       ├── char_bit_cnt.h
│   │       ├── data_util.h
│   │       ├── dynamic_bitset.h
│   │       ├── eval.h
│   │       ├── hammingDist.h
│   │       ├── heap.h
│   │       ├── hierarchical_clustering_index.h
│   │       ├── random.h
│   │       └── result_set.h
│   ├── SH/
│   │   ├── README.md
│   │   ├── script/
│   │   │   └── run.sh
│   │   └── src/
│   │       ├── SHgeneral.cpp
│   │       ├── SHgeneral.h
│   │       ├── SHindex.cpp
│   │       ├── SHindex.h
│   │       ├── SHselection.cpp
│   │       ├── SHselection.h
│   │       ├── build.sh
│   │       ├── constants.h
│   │       ├── data.h
│   │       ├── io.cpp
│   │       ├── io.h
│   │       ├── knn.cpp
│   │       ├── knn.h
│   │       ├── main.cpp
│   │       ├── myrandom.cpp
│   │       ├── myrandom.h
│   │       ├── myvector.cpp
│   │       ├── myvector.h
│   │       ├── statisticsmodule.cpp
│   │       └── statisticsmodule.h
│   ├── SRS/
│   │   ├── README.html
│   │   ├── README.md
│   │   ├── script/
│   │   │   ├── build.sh
│   │   │   └── search.sh
│   │   └── src/
│   │       ├── Makefile
│   │       ├── ParamFile.cpp
│   │       ├── ParamFile.h
│   │       ├── ProjData.cpp
│   │       ├── ProjData.h
│   │       ├── README.html
│   │       ├── RandGen.cpp
│   │       ├── RandGen.h
│   │       ├── Rawdata.h
│   │       ├── SRSCoverTree.cpp
│   │       ├── SRSCoverTree.h
│   │       ├── SRSInMemory.h
│   │       ├── cal_param.cpp
│   │       ├── gen_gt.cpp
│   │       ├── gen_hard_data.cpp
│   │       ├── srs.cpp
│   │       └── stack.h
│   └── flann/
│       ├── README.html
│       ├── README.md
│       ├── code/
│       │   ├── CMakeLists.txt
│       │   ├── COPYING
│       │   ├── ChangeLog
│       │   ├── README.md
│       │   ├── bin/
│       │   │   ├── download_checkmd5.py
│       │   │   ├── indent.sh
│       │   │   ├── make_release.sh
│       │   │   ├── run_test.py
│       │   │   └── uncrustify.cfg
│       │   ├── build/
│       │   │   ├── .Makefile.swp
│       │   │   ├── CMakeFiles/
│       │   │   │   ├── 3.2.3/
│       │   │   │   │   ├── CMakeCCompiler.cmake
│       │   │   │   │   ├── CMakeCXXCompiler.cmake
│       │   │   │   │   ├── CMakeSystem.cmake
│       │   │   │   │   ├── CompilerIdC/
│       │   │   │   │   │   └── CMakeCCompilerId.c
│       │   │   │   │   └── CompilerIdCXX/
│       │   │   │   │       └── CMakeCXXCompilerId.cpp
│       │   │   │   ├── CMakeDirectoryInformation.cmake
│       │   │   │   ├── CMakeOutput.log
│       │   │   │   ├── CMakeRuleHashes.txt
│       │   │   │   ├── Makefile.cmake
│       │   │   │   ├── Makefile2
│       │   │   │   ├── TargetDirectories.txt
│       │   │   │   ├── cmake.check_cache
│       │   │   │   ├── feature_tests.c
│       │   │   │   ├── feature_tests.cxx
│       │   │   │   ├── progress.marks
│       │   │   │   └── uninstall.dir/
│       │   │   │       ├── DependInfo.cmake
│       │   │   │       ├── build.make
│       │   │   │       ├── cmake_clean.cmake
│       │   │   │       └── progress.make
│       │   │   ├── CPackConfig.cmake
│       │   │   ├── CPackSourceConfig.cmake
│       │   │   ├── Makefile
│       │   │   ├── bin/
│       │   │   │   ├── build_auto
│       │   │   │   ├── build_hkmeans
│       │   │   │   ├── build_kdtree
│       │   │   │   ├── flann_h_kmeans_tunning_cpp
│       │   │   │   ├── flann_kdtree_tunning_cpp
│       │   │   │   ├── flann_linear_example_cpp
│       │   │   │   ├── linear
│       │   │   │   ├── search_auto
│       │   │   │   ├── search_hkmeans
│       │   │   │   └── search_kdtree
│       │   │   ├── cmake/
│       │   │   │   ├── CMakeFiles/
│       │   │   │   │   ├── CMakeDirectoryInformation.cmake
│       │   │   │   │   └── progress.marks
│       │   │   │   ├── Makefile
│       │   │   │   ├── cmake_install.cmake
│       │   │   │   └── flann.pc
│       │   │   ├── cmake_install.cmake
│       │   │   ├── doc/
│       │   │   │   ├── CMakeFiles/
│       │   │   │   │   ├── CMakeDirectoryInformation.cmake
│       │   │   │   │   ├── auxclean.dir/
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── doc.dir/
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── dvi.dir/
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── pdf.dir/
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── progress.marks
│       │   │   │   │   ├── ps.dir/
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   └── safepdf.dir/
│       │   │   │   │       ├── DependInfo.cmake
│       │   │   │   │       ├── build.make
│       │   │   │   │       ├── cmake_clean.cmake
│       │   │   │   │       └── progress.make
│       │   │   │   ├── Makefile
│       │   │   │   ├── cmake_install.cmake
│       │   │   │   └── references.bib
│       │   │   ├── examples/
│       │   │   │   ├── CMakeFiles/
│       │   │   │   │   ├── CMakeDirectoryInformation.cmake
│       │   │   │   │   ├── build_auto.dir/
│       │   │   │   │   │   ├── CXX.includecache
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── build_hkmeans.dir/
│       │   │   │   │   │   ├── CXX.includecache
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── build_kdtree.dir/
│       │   │   │   │   │   ├── CXX.includecache
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── examples.dir/
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── flann_h_kmeans_tunning_cpp.dir/
│       │   │   │   │   │   ├── CXX.includecache
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── flann_kdtree_tunning_cpp.dir/
│       │   │   │   │   │   ├── CXX.includecache
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── flann_linear_example_cpp.dir/
│       │   │   │   │   │   ├── CXX.includecache
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── linear.dir/
│       │   │   │   │   │   ├── CXX.includecache
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── progress.marks
│       │   │   │   │   ├── search_auto.dir/
│       │   │   │   │   │   ├── CXX.includecache
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   ├── search_hkmeans.dir/
│       │   │   │   │   │   ├── CXX.includecache
│       │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   ├── build.make
│       │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   └── progress.make
│       │   │   │   │   └── search_kdtree.dir/
│       │   │   │   │       ├── CXX.includecache
│       │   │   │   │       ├── DependInfo.cmake
│       │   │   │   │       ├── build.make
│       │   │   │   │       ├── cmake_clean.cmake
│       │   │   │   │       ├── depend.internal
│       │   │   │   │       ├── depend.make
│       │   │   │   │       ├── flags.make
│       │   │   │   │       ├── link.txt
│       │   │   │   │       └── progress.make
│       │   │   │   ├── Makefile
│       │   │   │   └── cmake_install.cmake
│       │   │   ├── lib/
│       │   │   │   ├── libflann.so.1.8
│       │   │   │   ├── libflann.so.1.8.4
│       │   │   │   ├── libflann_cpp.so.1.8
│       │   │   │   └── libflann_cpp.so.1.8.4
│       │   │   ├── src/
│       │   │   │   ├── CMakeFiles/
│       │   │   │   │   ├── CMakeDirectoryInformation.cmake
│       │   │   │   │   └── progress.marks
│       │   │   │   ├── Makefile
│       │   │   │   ├── cmake_install.cmake
│       │   │   │   ├── cpp/
│       │   │   │   │   ├── CMakeFiles/
│       │   │   │   │   │   ├── CMakeDirectoryInformation.cmake
│       │   │   │   │   │   ├── flann.dir/
│       │   │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   │   ├── build.make
│       │   │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   │   └── progress.make
│       │   │   │   │   │   ├── flann_cpp.dir/
│       │   │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   │   ├── build.make
│       │   │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   │   └── progress.make
│       │   │   │   │   │   ├── flann_cpp_s.dir/
│       │   │   │   │   │   │   ├── CXX.includecache
│       │   │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   │   ├── build.make
│       │   │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   │   ├── cmake_clean_target.cmake
│       │   │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   │   └── progress.make
│       │   │   │   │   │   ├── flann_s.dir/
│       │   │   │   │   │   │   ├── CXX.includecache
│       │   │   │   │   │   │   ├── DependInfo.cmake
│       │   │   │   │   │   │   ├── build.make
│       │   │   │   │   │   │   ├── cmake_clean.cmake
│       │   │   │   │   │   │   ├── cmake_clean_target.cmake
│       │   │   │   │   │   │   ├── depend.internal
│       │   │   │   │   │   │   ├── depend.make
│       │   │   │   │   │   │   ├── flags.make
│       │   │   │   │   │   │   ├── link.txt
│       │   │   │   │   │   │   └── progress.make
│       │   │   │   │   │   └── progress.marks
│       │   │   │   │   ├── Makefile
│       │   │   │   │   └── cmake_install.cmake
│       │   │   │   ├── matlab/
│       │   │   │   │   ├── CMakeFiles/
│       │   │   │   │   │   ├── CMakeDirectoryInformation.cmake
│       │   │   │   │   │   └── progress.marks
│       │   │   │   │   ├── Makefile
│       │   │   │   │   └── cmake_install.cmake
│       │   │   │   └── python/
│       │   │   │       ├── CMakeFiles/
│       │   │   │       │   ├── CMakeDirectoryInformation.cmake
│       │   │   │       │   └── progress.marks
│       │   │   │       ├── Makefile
│       │   │   │       ├── cmake_install.cmake
│       │   │   │       └── setup.py
│       │   │   └── uninstall_target.cmake
│       │   ├── cmake/
│       │   │   ├── CMakeLists.txt
│       │   │   ├── FindFlann.cmake
│       │   │   ├── UseLATEX.cmake
│       │   │   ├── flann.pc
│       │   │   ├── flann.pc.in
│       │   │   ├── flann_utils.cmake
│       │   │   └── uninstall_target.cmake.in
│       │   ├── doc/
│       │   │   ├── CMakeLists.txt
│       │   │   ├── manual.tex
│       │   │   └── references.bib
│       │   ├── examples/
│       │   │   ├── CMakeLists.txt
│       │   │   ├── CMakeLists.txt~
│       │   │   ├── GIST_flann_auto_example.cpp~
│       │   │   ├── GIST_flann_h_kmeans_example.cpp~
│       │   │   ├── GIST_flann_kdtree_example (copy).cpp~
│       │   │   ├── GIST_flann_kdtree_example.cpp~
│       │   │   ├── GIST_flann_linear_example.cpp~
│       │   │   ├── MNIST_flann_auto_example.cpp~
│       │   │   ├── MNIST_flann_h_kmeans_example.cpp~
│       │   │   ├── MNIST_flann_kdtree_example (copy).cpp~
│       │   │   ├── MNIST_flann_kdtree_example.cpp~
│       │   │   ├── MNIST_flann_linear_example.cpp~
│       │   │   ├── README
│       │   │   ├── SIFT_flann_auto_example.cpp~
│       │   │   ├── SIFT_flann_h_kmeans_example.cpp~
│       │   │   ├── SIFT_flann_kdtree_example (copy).cpp~
│       │   │   ├── SIFT_flann_kdtree_example.cpp~
│       │   │   ├── SIFT_flann_linear_example (copy).cpp~
│       │   │   ├── SIFT_flann_linear_example.cpp~
│       │   │   ├── audio_flann_auto_example.cpp~
│       │   │   ├── audio_flann_h_kmeans_example.cpp~
│       │   │   ├── audio_flann_kdtree_example.cpp~
│       │   │   ├── audio_flann_kdtree_tunning.cpp~
│       │   │   ├── audio_flann_linear_example.cpp~
│       │   │   ├── build_auto.cpp
│       │   │   ├── build_auto.cpp~
│       │   │   ├── build_hkmeans.cpp
│       │   │   ├── build_hkmeans.cpp~
│       │   │   ├── build_kdtree.cpp
│       │   │   ├── build_kdtree.cpp~
│       │   │   ├── cifar10_flann_auto_example.cpp~
│       │   │   ├── cifar10_flann_h_kmeans_example.cpp~
│       │   │   ├── cifar10_flann_kdtree_example.cpp~
│       │   │   ├── cifar10_flann_linear_example.cpp~
│       │   │   ├── flann_auto_example.cpp~
│       │   │   ├── flann_example.cpp~
│       │   │   ├── flann_example.c~
│       │   │   ├── flann_h_kmeans_example.cpp~
│       │   │   ├── flann_kdtree_example.cpp~
│       │   │   ├── flann_kdtree_tunning.cpp~
│       │   │   ├── flann_linear_example.cpp~
│       │   │   ├── get_kdtree_level.cpp~
│       │   │   ├── glove_flann_auto_example.cpp~
│       │   │   ├── glove_flann_h_kmeans_example.cpp~
│       │   │   ├── glove_flann_kdtree_example.cpp~
│       │   │   ├── glove_flann_linear_example.cpp~
│       │   │   ├── hard_flann_auto_example.cpp~
│       │   │   ├── hard_flann_h_kmeans_example.cpp~
│       │   │   ├── hard_flann_kdtree_example.cpp~
│       │   │   ├── hard_flann_linear_example.cpp~
│       │   │   ├── linear.cpp
│       │   │   ├── measure_flann.cpp~
│       │   │   ├── measure_hkmeans.cpp~
│       │   │   ├── ran_flann_auto_example.cpp~
│       │   │   ├── ran_flann_h_kmeans_example.cpp~
│       │   │   ├── ran_flann_kdtree_example.cpp~
│       │   │   ├── ran_flann_linear_example.cpp~
│       │   │   ├── search_auto.cpp
│       │   │   ├── search_auto.cpp~
│       │   │   ├── search_hkmeans.cpp
│       │   │   ├── search_hkmeans.cpp~
│       │   │   ├── search_kdtree.cpp
│       │   │   ├── search_kdtree.cpp~
│       │   │   ├── sun_flann_linear_example.cpp~
│       │   │   ├── trevi_flann_linear_example.cpp~
│       │   │   └── youtube_flann_linear_example.cpp~
│       │   └── src/
│       │       ├── CMakeLists.txt
│       │       ├── cpp/
│       │       │   ├── CMakeLists.txt
│       │       │   └── flann/
│       │       │       ├── algorithms/
│       │       │       │   ├── #kmeans_index.h
│       │       │       │   ├── #kmeans_index.h~
│       │       │       │   ├── #nn_index.h
│       │       │       │   ├── all_indices.h
│       │       │       │   ├── autotuned_index.h
│       │       │       │   ├── autotuned_index.h~
│       │       │       │   ├── center_chooser.h
│       │       │       │   ├── center_chooser.h~
│       │       │       │   ├── composite_index.h
│       │       │       │   ├── dist.h
│       │       │       │   ├── dist.h~
│       │       │       │   ├── hierarchical_clustering_index.h
│       │       │       │   ├── hierarchical_clustering_index.h~
│       │       │       │   ├── kdtree_cuda_3d_index.cu
│       │       │       │   ├── kdtree_cuda_3d_index.h
│       │       │       │   ├── kdtree_cuda_builder.h
│       │       │       │   ├── kdtree_index.h
│       │       │       │   ├── kdtree_index.h~
│       │       │       │   ├── kdtree_single_index.h
│       │       │       │   ├── kmeans_index.h
│       │       │       │   ├── kmeans_index.h~
│       │       │       │   ├── kmeans_index_print.h
│       │       │       │   ├── linear_index.h
│       │       │       │   ├── linear_index.h~
│       │       │       │   ├── lsh_index.h
│       │       │       │   ├── nn_index.h
│       │       │       │   └── nn_index.h~
│       │       │       ├── config.h
│       │       │       ├── config.h.in
│       │       │       ├── defines.h
│       │       │       ├── flann.cpp
│       │       │       ├── flann.h
│       │       │       ├── flann.hpp
│       │       │       ├── flann.hpp~
│       │       │       ├── flann_cpp.cpp
│       │       │       ├── general.h
│       │       │       ├── io/
│       │       │       │   └── hdf5.h
│       │       │       ├── kmeans_index.h
│       │       │       ├── mpi/
│       │       │       │   ├── client.h
│       │       │       │   ├── flann_mpi_client.cpp
│       │       │       │   ├── flann_mpi_server.cpp
│       │       │       │   ├── index.h
│       │       │       │   ├── matrix.h
│       │       │       │   ├── queries.h
│       │       │       │   └── server.h
│       │       │       ├── nn/
│       │       │       │   ├── ground_truth.h
│       │       │       │   ├── index_testing.h
│       │       │       │   ├── index_testing.h~
│       │       │       │   └── simplex_downhill.h
│       │       │       └── util/
│       │       │           ├── #result_set.h
│       │       │           ├── allocator.h
│       │       │           ├── any.h
│       │       │           ├── cuda/
│       │       │           │   ├── heap.h
│       │       │           │   └── result_set.h
│       │       │           ├── cutil_math.h
│       │       │           ├── dynamic_bitset.h
│       │       │           ├── heap.h
│       │       │           ├── logger.h
│       │       │           ├── lsh_table.h
│       │       │           ├── matrix.h
│       │       │           ├── object_factory.h
│       │       │           ├── params.h
│       │       │           ├── random.h
│       │       │           ├── random.h~
│       │       │           ├── result_set.h
│       │       │           ├── result_set.h~
│       │       │           ├── sampling.h
│       │       │           ├── saving.h
│       │       │           ├── serialization.h
│       │       │           └── timer.h
│       │       ├── matlab/
│       │       │   ├── CMakeLists.txt
│       │       │   ├── flann_build_index.m
│       │       │   ├── flann_free_index.m
│       │       │   ├── flann_load_index.m
│       │       │   ├── flann_save_index.m
│       │       │   ├── flann_search.m
│       │       │   ├── flann_set_distance_type.m
│       │       │   ├── nearest_neighbors.cpp
│       │       │   └── test_flann.m
│       │       └── python/
│       │           ├── CMakeLists.txt
│       │           ├── pyflann/
│       │           │   ├── __init__.py
│       │           │   ├── exceptions.py
│       │           │   ├── flann_ctypes.py
│       │           │   └── index.py
│       │           ├── setup.py
│       │           └── setup.py.tpl
│       └── script/
│           ├── build_auto.sh
│           ├── build_hkmeans.sh
│           ├── build_kdtree.sh
│           ├── run_linear.sh
│           ├── search_auto.sh
│           ├── search_hkmeans.sh
│           └── search_kdtree.sh
└── data/
    ├── Dataset_Link
    ├── README.html
    ├── README.md
    └── transformer/
        ├── README.md
        ├── script/
        │   └── run.sh
        └── src/
            ├── build.sh
            ├── compute_gnd.cpp
            ├── compute_groundtruth
            ├── gnd.h
            ├── load_from_hdf
            ├── load_from_hdf.cpp
            └── util.h
Download .txt
Showing preview only (222K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (2608 symbols across 439 files)

FILE: algorithms/AGH/src/AGH.cpp
  function diff_timeval (line 42) | float diff_timeval(timeval t1, timeval t2) {
  function main (line 46) | int main(int argc, char * argv[]) {

FILE: algorithms/AGH/src/AGH.h
  function class (line 21) | class AGH

FILE: algorithms/AGH/src/center_chooser.h
  function class (line 4) | class CenterChooser

FILE: algorithms/AGH/src/data_util.h
  function transpose (line 21) | void transpose(vector<vector<float> > X,vector<vector<float> >* Y)
  function ReadPoints (line 38) | void ReadPoints(char* filepath,vector<vector<float> >* points, int* len,...
  function ReadPoints (line 63) | void ReadPoints(const string& filename, vector<vector<float> >* points, ...
  function ReadGroundtruth (line 92) | void ReadGroundtruth(char* filepath, vector<vector<int> >* gnds, int* le...
  function ReadGroundtruth (line 116) | void ReadGroundtruth(const string& filename, vector<vector<int> >* gnds,...
  function ReadB1 (line 139) | void ReadB1(const string& filename, vector<vector<unsigned> >* B1,int n)...
  function ReadChecks (line 162) | void ReadChecks(const string& filename, vector<int>* checks) {

FILE: algorithms/AGH/src/dynamic_bitset.h
  function class (line 3) | class DynamicBitset
  function clear (line 17) | void clear()
  function reset (line 22) | void reset()
  function resize (line 28) | void resize(size_t size)
  function set (line 38) | void set(size_t index)
  function test (line 47) | bool test(size_t index) const

FILE: algorithms/AGH/src/eval.h
  function compute_recall (line 22) | float compute_recall(vector<vector<int> >* gnds, vector<vector<int> >* r...
  function compute_mean_reciprocal_rank (line 39) | float compute_mean_reciprocal_rank(vector<vector<int> >* gnds, vector<ve...
  function compute_number_closer (line 60) | float compute_number_closer(vector<vector<int> >* gnds, vector<vector<in...
  function compute_relative_distance_error (line 84) | float compute_relative_distance_error(vector<vector<float> >* points, ve...
  function compute_mean_average_precision (line 108) | float compute_mean_average_precision (vector<vector<int> >* gnds, vector...
  function compute_discounted_culmulative_gain (line 136) | float compute_discounted_culmulative_gain (vector<vector<int> >* gnds, v...
  function compute_recall (line 162) | float compute_recall(vector<vector<int> >* gnds, vector<vector<E_Neighbo...
  function compute_mean_reciprocal_rank (line 180) | float compute_mean_reciprocal_rank(vector<vector<int> >* gnds, vector<ve...
  function compute_number_closer (line 201) | float compute_number_closer(vector<vector<int> >* gnds, vector<vector<E_...
  function compute_relative_distance_error (line 225) | float compute_relative_distance_error(vector<vector<float> >* points, ve...
  function compute_mean_average_precision (line 251) | float compute_mean_average_precision (vector<vector<int> >* gnds, vector...
  function compute_discounted_culmulative_gain (line 279) | float compute_discounted_culmulative_gain (vector<vector<int> >* gnds, v...

FILE: algorithms/AGH/src/hammingDist.h
  type B_Neighbor (line 22) | struct B_Neighbor{
  type E_Neighbor (line 33) | struct E_Neighbor{
  function get_distance (line 43) | float get_distance(vector<float> point, vector<float> query)
  function hammingDist (line 54) | void hammingDist(vector<vector<unsigned> >* B2,vector<vector<unsigned> >...
  function UpdatePriorityList_Binary (line 76) | void UpdatePriorityList_Binary (B_Neighbor *BList, B_Neighbor tmp, int l...
  function hammingDist (line 96) | void hammingDist(vector<vector<unsigned> >* B2,vector<vector<unsigned> >...
  function hammingDist_ByRange (line 130) | void hammingDist_ByRange(vector<vector<unsigned> >* B2,vector<vector<uns...
  function UpdatePriorityList_Euclidean (line 154) | void UpdatePriorityList_Euclidean (E_Neighbor *BList, E_Neighbor tmp, in...

FILE: algorithms/AGH/src/heap.h
  function size (line 42) | int size()
  function empty (line 52) | bool empty()
  function clear (line 60) | void clear()
  type CompareT (line 66) | struct CompareT
  function const (line 68) | bool operator()(const T& t_1, const T& t_2) const
  function insert (line 83) | void insert(const T& value)
  function popMin (line 105) | bool popMin(T& value)
  type Interval (line 125) | struct Interval
  function size (line 155) | size_t size()
  function empty (line 164) | bool empty()
  function clear (line 172) | void clear()
  function insert (line 177) | void insert(const T& value)
  function popMin (line 251) | bool popMin(T& value)
  function popMax (line 296) | bool popMax(T& value)
  function getMin (line 336) | bool getMin(T& value)
  function getMax (line 346) | bool getMax(T& value)
  function size (line 371) | int size()
  function empty (line 380) | bool empty()
  function clear (line 388) | void clear()
  function insert (line 393) | void insert(const T& value)
  function popMin (line 404) | bool popMin(T& value)

FILE: algorithms/AGH/src/hierarchical_clustering_index.h
  function class (line 23) | class HierarchicalClusteringIndex
  type Node (line 126) | typedef Node* NodePtr;
  type BranchStruct (line 127) | struct BranchStruct
  function get_distance (line 143) | int get_distance(int p1, int p2)
  function get_distance (line 156) | int get_distance(const vector<unsigned>* p1, const vector<unsigned>* p2)
  function computeLabels (line 169) | void computeLabels(int* indices, int indices_length,  int* centers, int ...
  function computeClustering (line 184) | void computeClustering(Node* node, int* indices, int indices_length)
  type BranchStruct (line 240) | typedef BranchStruct BranchSt;
  function findNN (line 242) | void findNN(NodePtr node, ResultSet& result, const vector<unsigned>* vec...
  function findNeighborsWithRemoved (line 283) | void findNeighborsWithRemoved(ResultSet& result, const vector<unsigned>*...
  function knnSearch (line 308) | int knnSearch(const vector<vector<unsigned> >& queries, vector< vector<i...

FILE: algorithms/AGH/src/random.h
  function seed_random (line 9) | inline void seed_random(unsigned int seed)
  function class (line 40) | class RandomGenerator
  function class (line 51) | class UniqueRandom
  function init (line 72) | void init(int n)
  function next (line 91) | int next()

FILE: algorithms/AGH/src/result_set.h
  type DistanceIndex (line 9) | struct DistanceIndex
  function class (line 24) | class ResultSet
  function clear (line 44) | void clear()
  function full (line 64) | bool full()
  function addPoint (line 75) | void addPoint(int dist, int index)
  function copy (line 108) | void copy(vector<int>* indices, vector<int>* dists, size_t num_elements)

FILE: algorithms/Annoy/src/annoy.cpp
  type RandRandom (line 67) | struct RandRandom {
    method flip (line 70) | inline int flip() {
    method index (line 74) | inline size_t index(size_t n) {
  function T (line 81) | inline T get_norm(T* v, int f) {
  function normalize (line 89) | inline void normalize(T* v, int f) {
  function two_means (line 96) | inline void two_means(const vector<Node*>& nodes, int f, Random& random,...
  type Angular (line 132) | struct Angular {
    method Node (line 134) | struct ANNOY_NODE_ATTRIBUTE Node {
    method T (line 154) | static inline T distance(const T* x, const T* y, int f) {
    method T (line 169) | static inline T margin(const Node<S, T>* n, const T* y, int f) {
    method side (line 176) | static inline bool side(const Node<S, T>* n, const T* y, int f, Random...
    method create_split (line 184) | static inline void create_split(const vector<Node<S, T>*>& nodes, int ...
    method T (line 192) | static inline T normalized_distance(T distance) {
  type Euclidean (line 200) | struct Euclidean {
    method Node (line 202) | struct ANNOY_NODE_ATTRIBUTE Node {
    method T (line 210) | static inline T distance(const T* x, const T* y, int f) {
    method T (line 217) | static inline T margin(const Node<S, T>* n, const T* y, int f) {
    method side (line 224) | static inline bool side(const Node<S, T>* n, const T* y, int f, Random...
    method create_split (line 232) | static inline void create_split(const vector<Node<S, T>*>& nodes, int ...
    method T (line 244) | static inline T normalized_distance(T distance) {
  class AnnoyIndexInterface (line 250) | class AnnoyIndexInterface {
  class AnnoyIndex (line 267) | class AnnoyIndex : public AnnoyIndexInterface<S, T> {
    method AnnoyIndex (line 294) | AnnoyIndex(int f) : _random() {
    method add_item (line 305) | void add_item(S item, const T* w) {
    method build (line 320) | void build(int q) {
    method save (line 354) | bool save(const char* filename) {
    method reinitialize (line 367) | void reinitialize() {
    method unload (line 377) | void unload() {
    method load (line 391) | bool load(const char* filename) {
    method T (line 420) | T get_distance(S i, S j) {
    method get_nns_by_item (line 426) | void get_nns_by_item(S item, size_t n, size_t search_k, vector<S>* res...
    method get_nns_by_vector (line 431) | void get_nns_by_vector(const T* w, size_t n, size_t search_k, vector<S...
    method S (line 434) | S get_n_items() {
    method verbose (line 437) | void verbose(bool v) {
    method get_item (line 441) | void get_item(S item, T* v) {
    method _allocate_size (line 447) | void _allocate_size(S n) {
    method Node (line 459) | inline Node* _get(S i) {
    method S (line 463) | S _make_tree(const vector<S >& indices) {
    method _get_all_nns (line 534) | void _get_all_nns(const T* v, size_t n, size_t search_k, vector<S>* re...

FILE: algorithms/Annoy/src/data.h
  function namespace (line 24) | namespace kgraph {
  type l2 (line 55) | struct l2 {
  function reset (line 71) | void reset (unsigned r, unsigned c) {
  function data (line 84) | Matrix (unsigned r, unsigned c): data(0) {
  function resize (line 99) | void resize (unsigned r, unsigned c) {
  function T (line 102) | T const *operator [] (unsigned i) const {
  function T (line 105) | T *operator [] (unsigned i) {
  function zero (line 108) | void zero () {
  function load_lshkit (line 129) | void load_lshkit (std::string const &path) {
  function save_lshkit (line 143) | void save_lshkit (std::string const &path) {
  function DATA_TYPE (line 204) | DATA_TYPE const *operator [] (unsigned i) const {
  function virtual (line 226) | virtual float operator () (unsigned i) const {
  function proxy (line 231) | proxy(m) {
  function virtual (line 236) | virtual float operator () (unsigned i, unsigned j) const {
  function virtual (line 240) | virtual float angle (unsigned orign, unsigned pivot, unsigned x) const {...
  function SearchOracle (line 255) | SearchOracle query (DATA_TYPE const *query) const {
  function AverageAccuracy (line 324) | inline void AverageAccuracy(Matrix<float> const &gs, Matrix<float> const...
  function AverageMinDist (line 460) | inline void AverageMinDist (Matrix<float> const &gs, Matrix<float> const...
  function namespace (line 482) | namespace kgraph { namespace metric {
  function namespace (line 490) | namespace kgraph { namespace metric {

FILE: algorithms/Annoy/src/indexer.cpp
  type item (line 17) | struct item{
  function diff_timeval (line 22) | float diff_timeval(timeval t1, timeval t2) {
  function main (line 53) | int main(int argc, char *argv[]){

FILE: algorithms/Annoy/src/kissrandom.h
  function kiss (line 12) | struct Kiss32Random {
  function flip (line 42) | inline int flip() {
  function index (line 46) | inline size_t index(size_t n) {
  function kiss (line 53) | struct Kiss64Random {
  function flip (line 84) | inline int flip() {
  function index (line 88) | inline size_t index(size_t n) {

FILE: algorithms/Annoy/src/searcher.cpp
  type item (line 17) | struct item{
  function diff_timeval (line 22) | float diff_timeval(timeval t1, timeval t2) {
  function P (line 32) | P* load_data(const char* data_path, int* len, int* d)
  function T (line 54) | T get_recall(S * gt, vector<int32_t>* res, S k)
  function T (line 69) | T get_mAP(S * gt, vector<int32_t>* res, S k)
  function main (line 89) | int main(int argc, char *argv[]){

FILE: algorithms/DPG/src/DPG_diverse.cpp
  function main (line 32) | int main(int argc, char *argv[]){

FILE: algorithms/DPG/src/DPG_index.cpp
  function main (line 33) | int main(int argc, char *argv[]) {

FILE: algorithms/DPG/src/DPG_search.cpp
  function main (line 33) | int main(int argc, char *argv[]) {

FILE: algorithms/DPG/src/RandGen.cpp
  function gaussian (line 31) | float gaussian(float mean, float sigma) {
  function uniform (line 56) | float uniform(float _min, float _max) {

FILE: algorithms/DPG/src/kgraph-data.h
  function namespace (line 24) | namespace kgraph {
  type l2 (line 55) | struct l2 {
  function reset (line 71) | void reset (unsigned r, unsigned c) {
  function data (line 84) | Matrix (unsigned r, unsigned c): data(0) {
  function resize (line 99) | void resize (unsigned r, unsigned c) {
  function T (line 102) | T const *operator [] (unsigned i) const {
  function T (line 105) | T *operator [] (unsigned i) {
  function zero (line 108) | void zero () {
  function load_lshkit (line 129) | void load_lshkit (std::string const &path) {
  function save_lshkit (line 143) | void save_lshkit (std::string const &path) {
  function DATA_TYPE (line 204) | DATA_TYPE const *operator [] (unsigned i) const {
  function virtual (line 226) | virtual float operator () (unsigned i) const {
  function proxy (line 231) | proxy(m) {
  function virtual (line 236) | virtual float operator () (unsigned i, unsigned j) const {
  function virtual (line 240) | virtual float angle (unsigned orign, unsigned pivot, unsigned x) const {...
  function SearchOracle (line 255) | SearchOracle query (DATA_TYPE const *query) const {
  function AverageAccuracy (line 324) | inline void AverageAccuracy(Matrix<float> const &gs, Matrix<float> const...
  function AverageMinDist (line 460) | inline void AverageMinDist (Matrix<float> const &gs, Matrix<float> const...
  function namespace (line 482) | namespace kgraph { namespace metric {
  function namespace (line 490) | namespace kgraph { namespace metric {

FILE: algorithms/DPG/src/kgraph.cpp
  type kgraph (line 25) | namespace kgraph {
    function GenRandom (line 38) | static void GenRandom (RNG &rng, unsigned *addr, unsigned size, unsign...
    type Neighbor (line 54) | struct Neighbor {
      method Neighbor (line 58) | Neighbor () {}
      method Neighbor (line 59) | Neighbor (unsigned i, float d, bool f = true): id(i), dist(d), flag(...
    function EvaluateRecall (line 73) | static float EvaluateRecall (Neighbors const &pool, Neighbors const &k...
    function EvaluateAccuracy (line 107) | static float EvaluateAccuracy (Neighbors const &pool, Neighbors const ...
    function EvaluateOneRecall (line 120) | static float EvaluateOneRecall (Neighbors const &pool, Neighbors const...
    function EvaluateDelta (line 125) | static float EvaluateDelta (Neighbors const &pool, unsigned K) {
    type Control (line 135) | struct Control {
    function UpdateKnnList (line 153) | static inline unsigned UpdateKnnList (Neighbor *addr, unsigned K, Neig...
    function LinearSearch (line 180) | void LinearSearch (IndexOracle const &oracle, unsigned i, unsigned K, ...
    function GenerateControl (line 223) | void GenerateControl (IndexOracle const &oracle, unsigned C, unsigned ...
    class KGraphImpl (line 248) | class KGraphImpl: public KGraph {
      method load (line 255) | virtual void load (char const *path) {
      method merge (line 290) | virtual void merge(char const * graph_path, char const * id_path){
      method output_info (line 345) | virtual void output_info(int const id){
      type hub_pair (line 360) | struct hub_pair{
        method hub_pair (line 363) | hub_pair(unsigned x, int y){
      type rknn_pair (line 372) | struct rknn_pair{
        method rknn_pair (line 375) | rknn_pair(unsigned x, float y){
      method connectivity (line 381) | virtual void connectivity(unsigned const source, unsigned const dest){
      method get_partitions (line 413) | virtual void get_partitions(char const *output_path){
      method output_M (line 495) | virtual void output_M (char const* filename) {
      method make_inverse_graph (line 507) | virtual void make_inverse_graph(){
      method test_connectivity (line 527) | virtual void test_connectivity(unsigned dest){ // for inverse kgraph
      method add_random_backward_edges (line 552) | virtual void add_random_backward_edges(char const *data_path, char c...
      method add_backward_edges (line 624) | virtual void add_backward_edges(){
      method compute_diversity (line 665) | virtual void compute_diversity(IndexOracle const &oracle, int d, flo...
      method diversify_by_cut (line 720) | virtual void diversify_by_cut(IndexOracle const &oracle, const int e...
      method statistics (line 849) | virtual  float statistics(IndexOracle const &oracle, const int edge_...
      method remove_near_edges (line 911) | virtual void remove_near_edges(IndexOracle const &oracle, const int ...
      method remove_near_edges_2 (line 980) | virtual void remove_near_edges_2(IndexOracle const &oracle, vector<u...
      method add_long_edges (line 1028) | virtual void add_long_edges(IndexOracle const &oracle, int const ran...
      method saver (line 1090) | virtual void saver (char const *path) const {
      method save (line 1109) | virtual void save (char const *path) const {
      method get_hubs (line 1129) | virtual void get_hubs (char const *hubs_path,char const *knn_path) c...
      method kgraph2dot (line 1199) | virtual void kgraph2dot (char * const &filename){
      method advanced_search (line 1214) | virtual unsigned advanced_search (SearchOracle const &oracle, Search...
      method find_lm (line 1481) | virtual void find_lm (SearchOracle const &oracle) const {
      method search (line 1576) | virtual unsigned search (SearchOracle const &oracle, SearchParams co...
      method search_greedy (line 1849) | virtual unsigned search_greedy (SearchOracle const &oracle, SearchPa...
      method get_nn (line 2088) | virtual void get_nn (unsigned id, unsigned *nns, float *dist, unsign...
      method prune1 (line 2105) | void prune1 () {
      method prune2 (line 2113) | void prune2 () {
      method prune (line 2160) | virtual void prune (IndexOracle const &oracle, unsigned level) {
    class KGraphConstructor (line 2170) | class KGraphConstructor: public KGraphImpl {
      type Nhood (line 2174) | struct Nhood { // neighborhood
        method parallel_try_insert (line 2188) | unsigned parallel_try_insert (unsigned id, float dist) {
        method join (line 2205) | void join (C callback) const {
      method init (line 2225) | void init () {
      method join (line 2263) | void join () {
      method update (line 2282) | void update () {
      method KGraphConstructor (line 2353) | KGraphConstructor (IndexOracle const &o, IndexParams const &p, Index...
    function KGraph (line 2482) | KGraph *KGraph::create () {

FILE: algorithms/DPG/src/kgraph.h
  function namespace (line 19) | namespace kgraph {
  function namespace (line 262) | namespace kgraph {

FILE: algorithms/DPG/src/main.cpp
  function main_index (line 39) | int main_index(int argc, char *argv[]) {
  function main_statistic (line 203) | int main_statistic(int argc, char *argv[]){
  function main_diversify (line 256) | int main_diversify(int argc, char *argv[]){
  function main_search (line 330) | int main_search(int argc, char *argv[]) {
  function main (line 468) | int main(int argc, char *argv[])

FILE: algorithms/DPG/src/metric.cpp
  function float_l2sqr_avx (line 15) | float float_l2sqr_avx (float const *t1, float const *t2, unsigned dim) {
  type kgraph (line 58) | namespace kgraph {
    function float_l2sqr_sse2 (line 59) | float float_l2sqr_sse2 (float const *t1, float const *t2, unsigned dim) {
  function uint8_l2sqr_sse2 (line 164) | float uint8_l2sqr_sse2 (uint8_t const *t1, uint8_t const *t2, unsigned d...

FILE: algorithms/KGraph/src/RandGen.cpp
  function gaussian (line 31) | float gaussian(float mean, float sigma) {
  function uniform (line 56) | float uniform(float _min, float _max) {

FILE: algorithms/KGraph/src/kgraph-data.h
  function namespace (line 24) | namespace kgraph {
  type l2 (line 55) | struct l2 {
  function reset (line 71) | void reset (unsigned r, unsigned c) {
  function data (line 84) | Matrix (unsigned r, unsigned c): data(0) {
  function resize (line 99) | void resize (unsigned r, unsigned c) {
  function T (line 102) | T const *operator [] (unsigned i) const {
  function T (line 105) | T *operator [] (unsigned i) {
  function zero (line 108) | void zero () {
  function load_lshkit (line 129) | void load_lshkit (std::string const &path) {
  function save_lshkit (line 143) | void save_lshkit (std::string const &path) {
  function DATA_TYPE (line 204) | DATA_TYPE const *operator [] (unsigned i) const {
  function virtual (line 226) | virtual float operator () (unsigned i) const {
  function proxy (line 231) | proxy(m) {
  function virtual (line 236) | virtual float operator () (unsigned i, unsigned j) const {
  function virtual (line 240) | virtual float angle (unsigned orign, unsigned pivot, unsigned x) const {...
  function SearchOracle (line 255) | SearchOracle query (DATA_TYPE const *query) const {
  function AverageAccuracy (line 324) | inline void AverageAccuracy(Matrix<float> const &gs, Matrix<float> const...
  function AverageMinDist (line 460) | inline void AverageMinDist (Matrix<float> const &gs, Matrix<float> const...
  function namespace (line 482) | namespace kgraph { namespace metric {
  function namespace (line 490) | namespace kgraph { namespace metric {

FILE: algorithms/KGraph/src/kgraph.cpp
  type kgraph (line 25) | namespace kgraph {
    function GenRandom (line 38) | static void GenRandom (RNG &rng, unsigned *addr, unsigned size, unsign...
    type Neighbor (line 54) | struct Neighbor {
      method Neighbor (line 58) | Neighbor () {}
      method Neighbor (line 59) | Neighbor (unsigned i, float d, bool f = true): id(i), dist(d), flag(...
    function EvaluateRecall (line 73) | static float EvaluateRecall (Neighbors const &pool, Neighbors const &k...
    function EvaluateAccuracy (line 107) | static float EvaluateAccuracy (Neighbors const &pool, Neighbors const ...
    function EvaluateOneRecall (line 120) | static float EvaluateOneRecall (Neighbors const &pool, Neighbors const...
    function EvaluateDelta (line 125) | static float EvaluateDelta (Neighbors const &pool, unsigned K) {
    type Control (line 135) | struct Control {
    function UpdateKnnList (line 153) | static inline unsigned UpdateKnnList (Neighbor *addr, unsigned K, Neig...
    function LinearSearch (line 180) | void LinearSearch (IndexOracle const &oracle, unsigned i, unsigned K, ...
    function GenerateControl (line 223) | void GenerateControl (IndexOracle const &oracle, unsigned C, unsigned ...
    class KGraphImpl (line 248) | class KGraphImpl: public KGraph {
      method load (line 255) | virtual void load (char const *path) {
      method merge (line 290) | virtual void merge(char const * graph_path, char const * id_path){
      method output_info (line 345) | virtual void output_info(int const id){
      type hub_pair (line 360) | struct hub_pair{
        method hub_pair (line 363) | hub_pair(unsigned x, int y){
      type rknn_pair (line 372) | struct rknn_pair{
        method rknn_pair (line 375) | rknn_pair(unsigned x, float y){
      method connectivity (line 381) | virtual void connectivity(unsigned const source, unsigned const dest){
      method get_partitions (line 413) | virtual void get_partitions(char const *output_path){
      method output_M (line 495) | virtual void output_M (char const* filename) {
      method make_inverse_graph (line 507) | virtual void make_inverse_graph(){
      method test_connectivity (line 527) | virtual void test_connectivity(unsigned dest){ // for inverse kgraph
      method add_random_backward_edges (line 552) | virtual void add_random_backward_edges(char const *data_path, char c...
      method add_backward_edges (line 624) | virtual void add_backward_edges(){
      method compute_diversity (line 665) | virtual void compute_diversity(IndexOracle const &oracle, int d, flo...
      method diversify_by_cut (line 720) | virtual void diversify_by_cut(IndexOracle const &oracle, const int e...
      method statistics (line 849) | virtual  float statistics(IndexOracle const &oracle, const int edge_...
      method remove_near_edges (line 911) | virtual void remove_near_edges(IndexOracle const &oracle, const int ...
      method remove_near_edges_2 (line 965) | virtual void remove_near_edges_2(IndexOracle const &oracle, vector<u...
      method add_long_edges (line 1013) | virtual void add_long_edges(IndexOracle const &oracle, int const ran...
      method saver (line 1075) | virtual void saver (char const *path) const {
      method save (line 1094) | virtual void save (char const *path) const {
      method get_hubs (line 1114) | virtual void get_hubs (char const *hubs_path,char const *knn_path) c...
      method kgraph2dot (line 1184) | virtual void kgraph2dot (char * const &filename){
      method advanced_search (line 1199) | virtual unsigned advanced_search (SearchOracle const &oracle, Search...
      method find_lm (line 1466) | virtual void find_lm (SearchOracle const &oracle) const {
      method search (line 1561) | virtual unsigned search (SearchOracle const &oracle, SearchParams co...
      method search_greedy (line 1834) | virtual unsigned search_greedy (SearchOracle const &oracle, SearchPa...
      method get_nn (line 2073) | virtual void get_nn (unsigned id, unsigned *nns, float *dist, unsign...
      method prune1 (line 2090) | void prune1 () {
      method prune2 (line 2098) | void prune2 () {
      method prune (line 2145) | virtual void prune (IndexOracle const &oracle, unsigned level) {
    class KGraphConstructor (line 2155) | class KGraphConstructor: public KGraphImpl {
      type Nhood (line 2159) | struct Nhood { // neighborhood
        method parallel_try_insert (line 2173) | unsigned parallel_try_insert (unsigned id, float dist) {
        method join (line 2190) | void join (C callback) const {
      method init (line 2210) | void init () {
      method join (line 2248) | void join () {
      method update (line 2267) | void update () {
      method KGraphConstructor (line 2338) | KGraphConstructor (IndexOracle const &o, IndexParams const &p, Index...
    function KGraph (line 2467) | KGraph *KGraph::create () {

FILE: algorithms/KGraph/src/kgraph.h
  function namespace (line 19) | namespace kgraph {
  function namespace (line 259) | namespace kgraph {

FILE: algorithms/KGraph/src/kgraph_index.cpp
  function main (line 33) | int main(int argc, char *argv[]) {

FILE: algorithms/KGraph/src/kgraph_search.cpp
  function main (line 33) | int main(int argc, char *argv[]) {

FILE: algorithms/KGraph/src/metric.cpp
  function float_l2sqr_avx (line 15) | float float_l2sqr_avx (float const *t1, float const *t2, unsigned dim) {
  type kgraph (line 58) | namespace kgraph {
    function float_l2sqr_sse2 (line 59) | float float_l2sqr_sse2 (float const *t1, float const *t2, unsigned dim) {
  function uint8_l2sqr_sse2 (line 164) | float uint8_l2sqr_sse2 (uint8_t const *t1, uint8_t const *t2, unsigned d...

FILE: algorithms/NMSLIB/code/CMakeFiles/3.2.3/CompilerIdC/CMakeCCompilerId.c
  function main (line 479) | void main() {}
  function main (line 481) | int main(int argc, char* argv[])

FILE: algorithms/NMSLIB/code/CMakeFiles/3.2.3/CompilerIdCXX/CMakeCXXCompilerId.cpp
  function main (line 473) | int main(int argc, char* argv[])

FILE: algorithms/NMSLIB/code/CMakeFiles/feature_tests.c
  function main (line 34) | int main(int argc, char** argv) { (void)argv; return features[argc]; }

FILE: algorithms/NMSLIB/code/CMakeFiles/feature_tests.cxx
  function main (line 405) | int main(int argc, char** argv) { (void)argv; return features[argc]; }

FILE: algorithms/NMSLIB/code/include/cluster_util.h
  function namespace (line 27) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/distcomp.h
  function namespace (line 28) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/distcomp_edist.h
  function namespace (line 19) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/eval_metrics.h
  function namespace (line 28) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/eval_results.h
  function namespace (line 34) | namespace similarity {
  function GetKNNData (line 121) | void GetKNNData(const KNNQuery<dist_t>* query) {
  function GetRangeData (line 149) | void GetRangeData(const RangeQuery<dist_t>* query) {
  function ComputeMetrics (line 174) | void ComputeMetrics(LabelType queryLabel) {

FILE: algorithms/NMSLIB/code/include/experimentconf.h
  function namespace (line 30) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/experiments.h
  function namespace (line 47) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/init_methods.h
  function namespace (line 52) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/init_spaces.h
  function namespace (line 36) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/method/bbtree.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/method/dummy.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/method/ghtree.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/method/hnsw.h
  function namespace (line 32) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/method/list_clusters.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/method/lsh.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/method/lsh_multiprobe.h
  function namespace (line 24) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/method/multi_index.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/method/multi_vantage_point_tree.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/method/nndes.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/method/nonmetr_list_clust.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/method/omedrank.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/method/perm_bin_vptree.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/method/perm_index_incr_bin.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/method/perm_lsh_bin.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/method/permutation_inverted_index.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/method/permutation_prefix_index.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/method/pivot_neighb_invindx.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/method/proj_vptree.h
  function namespace (line 24) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/method/projection_index_incremental.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/method/seqsearch.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/method/small_world_rand.h
  function namespace (line 23) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/method/spatial_approx_tree.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/method/vptree.h
  function namespace (line 23) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/space/space_bit_hamming.h
  function namespace (line 21) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/space/space_bregman.h
  function namespace (line 21) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/space/space_dummy.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/space/space_edist.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/space/space_savch.h
  function ElementType (line 42) | ElementType accum_dist (ElementType a, ElementType b) const {
  function ElementType (line 55) | ElementType operator()(const ElementType* x, const ElementType* y, size_...

FILE: algorithms/NMSLIB/code/include/factory/space/space_scalar.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/space/space_sparse_scalar.h
  function namespace (line 23) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/space/space_sqfd.h
  function namespace (line 24) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/factory/space/space_word_embed.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/floatdiff.h
  type UInt (line 55) | typedef void UInt;
  type TypeWithSize (line 59) | struct TypeWithSize
  type UInt (line 61) | typedef uint32_t UInt;
  type TypeWithSize (line 65) | struct TypeWithSize
  type UInt (line 67) | typedef uint64_t UInt;
  function explicit (line 86) | explicit FloatingPointDiff(const RawType& x) : value_(x) {}
  function AlmostEquals (line 91) | bool AlmostEquals(const FloatingPointDiff& rhs, size_t maxUlps) const {
  function Bits (line 96) | Bits ULP_diff(const FloatingPointDiff& rhs) const {
  function Bits (line 114) | Bits ULP_diff(const Bits& sam1, const Bits& sam2) const

FILE: algorithms/NMSLIB/code/include/global.h
  function namespace (line 37) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/gold_standard.h
  function namespace (line 39) | namespace similarity {
  type ClassResult (line 91) | enum ClassResult {
  function Write (line 125) | void Write(ostream& controlStream, ostream& binaryStream) const {
  function Read (line 134) | void Read(istream& controlStream, istream& binaryStream) {
  function Compute (line 235) | void Compute(size_t threadQty, float maxKeepEntryCoeff) {
  function Read (line 251) | void Read(istream& controlStream, istream& binaryStream,
  function Write (line 273) | void Write(ostream& controlStream, ostream& binaryStream,
  function vector (line 292) | const vector<unique_ptr<GoldStandard<dist_t>>> &GetRangeGS(size_t i) con...
  function vector (line 295) | const vector<unique_ptr<GoldStandard<dist_t>>> &GetKNNGS(size_t i) const {
  function writeOneGS (line 303) | void writeOneGS(ostream& controlStream, ostream& binaryStream,
  function readOneGS (line 310) | void readOneGS(istream& controlStream, istream& binaryStream,

FILE: algorithms/NMSLIB/code/include/idtype.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/incremental_quick_select.h
  function namespace (line 24) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/index.h
  function namespace (line 26) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/init.h
  function namespace (line 27) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/knnquery.h
  function namespace (line 23) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/knnqueue.h
  function namespace (line 28) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/logging.h
  type LogSeverity (line 32) | enum LogSeverity {LIB_INFO, LIB_WARNING, LIB_ERROR, LIB_FATAL}
  type LogChoice (line 33) | enum LogChoice  {LIB_LOGNONE, LIB_LOGFILE, LIB_LOGSTDERR}
  function class (line 40) | class Logger {
  function class (line 58) | class RuntimeErrorWrapper {

FILE: algorithms/NMSLIB/code/include/memory.h
  function namespace (line 20) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/meta_analysis.h
  function namespace (line 25) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/method/bbtree.h
  function namespace (line 36) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/method/dummy.h
  function namespace (line 26) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/method/ghtree.h
  function namespace (line 25) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/method/hnsw.h
  function namespace (line 47) | namespace similarity {
  function Object (line 300) | const Object* getData() const {
  function vector (line 304) | const vector<HnswNode*>& getAllFriends(int level) const {
  function HnswNode (line 338) | HnswNode* getMSWNodeHier() const { return element; }
  function operator (line 339) | bool operator< (const HnswNodeDistFarther &obj1) const {
  function operator (line 362) | bool operator< (const EvaluatedMSWNodeInt &obj1) const {
  function HnswNode (line 384) | HnswNode* getMSWNodeHier() const { return element; }
  function operator (line 385) | bool operator< (const HnswNodeDistCloser &obj1) const {
  function std (line 409) | const std::string StrDesc() const override;
  function link (line 439) | void link(HnswNode* first, HnswNode* second, int level, const Space<dist...
  function class (line 486) | class VisitedList {
  function reset (line 496) | void reset() {
  function class (line 514) | class VisitedListPool {
  function VisitedList (line 527) | VisitedList * getFreeVisitedList() {
  function releaseVisitedList (line 540) | void releaseVisitedList(VisitedList *vl) {

FILE: algorithms/NMSLIB/code/include/method/lcstrategy.h
  function ListClustersStrategy (line 8) | enum class ListClustersStrategy {

FILE: algorithms/NMSLIB/code/include/method/list_clusters.h
  function namespace (line 26) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/method/lsh.h
  function namespace (line 28) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/method/lsh_multiprobe.h
  function namespace (line 27) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/method/lsh_space.h
  function namespace (line 23) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/method/multi_index.h
  function namespace (line 27) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/method/multi_vantage_point_tree.h
  function namespace (line 25) | namespace similarity {
  function class (line 131) | class LeafNode : public Node {

FILE: algorithms/NMSLIB/code/include/method/multi_vantage_point_tree_utils.h
  function namespace (line 20) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/method/nndes.h
  function namespace (line 43) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/method/omedrank.h
  function namespace (line 34) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/method/perm_bin_vptree.h
  function namespace (line 31) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/method/perm_index_incr_bin.h
  function namespace (line 28) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/method/perm_lsh_bin.h
  function namespace (line 27) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/method/permutation_inverted_index.h
  function namespace (line 29) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/method/permutation_prefix_index.h
  function namespace (line 27) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/method/pivot_neighb_common.h
  function namespace (line 8) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/method/pivot_neighb_invindx.h
  function namespace (line 32) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/method/proj_vptree.h
  function namespace (line 32) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/method/projection_index_incremental.h
  function namespace (line 32) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/method/seqsearch.h
  function namespace (line 26) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/method/small_world_rand.h
  function namespace (line 37) | namespace similarity {
  function MSWNode (line 127) | MSWNode* getMSWNode() const {return element;}
  function operator (line 128) | bool operator< (const EvaluatedMSWNodeReverse &obj1) const {
  function MSWNode (line 150) | MSWNode* getMSWNode() const {return element;}
  function operator (line 151) | bool operator< (const EvaluatedMSWNodeDirect &obj1) const {
  type std (line 175) | typedef std::vector<MSWNode*> ElementList;
  function std (line 177) | const std::string StrDesc() const override;
  type AlgoType (line 217) | enum AlgoType { kOld, kV1Merge }

FILE: algorithms/NMSLIB/code/include/method/small_world_rand_split.h
  function namespace (line 36) | namespace similarity {
  function class (line 143) | class EvaluatedMSWNodeDirect{
  function MSWNode (line 155) | MSWNode* getMSWNode() const {return element;}
  function operator (line 156) | bool operator< (const EvaluatedMSWNodeDirect &obj1) const {
  type std (line 176) | typedef std::vector<MSWNode*> ElementList;
  function std (line 178) | const std::string StrDesc() const override;

FILE: algorithms/NMSLIB/code/include/method/spatial_approx_tree.h
  function namespace (line 27) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/method/vptree.h
  function namespace (line 29) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/method/vptree_utils.h
  function namespace (line 26) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/methodfactory.h
  function namespace (line 26) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/nndes/nndes-common.h
  function namespace (line 35) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/nndes/nndes.h
  function namespace (line 18) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/object.h
  function namespace (line 35) | namespace similarity {
  type std (line 171) | typedef std::vector<const Object*> ObjectVector;
  function DataSpaceUsed (line 173) | inline size_t DataSpaceUsed(const ObjectVector &vect) {
  function ClearBucket (line 211) | inline void ClearBucket(char* CacheOptimizedBucket,

FILE: algorithms/NMSLIB/code/include/params.h
  function namespace (line 32) | namespace similarity {
  function AnyParams (line 167) | const inline AnyParams& getEmptyParams() {
  function class (line 172) | class AnyParamManager {
  function ConvertStrToValue (line 297) | void AnyParamManager::ConvertStrToValue(const string& s, ParamType& Valu...

FILE: algorithms/NMSLIB/code/include/params_cmdline.h
  function namespace (line 33) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/permutation_type.h
  function namespace (line 23) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/permutation_utils.h
  function namespace (line 31) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/ported_boost_progress.h
  function namespace (line 28) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/pow.h
  function namespace (line 30) | namespace similarity {
  function T (line 157) | T EfficientFractPowUtil(T Base, uint64_t Exp, uint64_t MaxK) {
  function T (line 180) | T EfficientFractPow(T Base, T FractExp, unsigned NumDig) {

FILE: algorithms/NMSLIB/code/include/projection.h
  function namespace (line 44) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/query.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/query_creator.h
  function namespace (line 24) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/randproj_util.h
  function namespace (line 24) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/rangequery.h
  function namespace (line 24) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/report.h
  function namespace (line 27) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/report_intr_dim.h
  function namespace (line 22) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/searchoracle.h
  function namespace (line 49) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/simddebug.h
  function namespace (line 33) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/sort_arr_bi.h
  function key (line 39) | Item(const KeyType& k) : key(k) {}
  function operator (line 42) | bool operator < (const Item& i2) const {
  function v_ (line 48) | SortArrBI(size_t max_elem) :  v_(max_elem) {
  function resize (line 55) | void resize(size_t max_elem) {
  function push_unsorted_grow (line 60) | void push_unsorted_grow(const KeyType& key, const DataType& data) {
  function KeyType (line 68) | KeyType top_key() {
  function sort (line 72) | void sort() {
  function swap (line 77) | void swap(size_t x, size_t y) {
  function push_or_replace_non_empty (line 83) | size_t push_or_replace_non_empty(const KeyType& key, const DataType& dat...
  function merge_with_sorted_items (line 106) | size_t merge_with_sorted_items(Item* items, size_t item_qty) {
  function push_or_replace_non_empty_exp (line 140) | size_t push_or_replace_non_empty_exp(const KeyType& key, const DataType&...

FILE: algorithms/NMSLIB/code/include/space.h
  function namespace (line 42) | namespace similarity {
  function virtual (line 116) | virtual ~Space() {}
  function dist_t (line 118) | dist_t IndexTimeDistance(const Object* obj1, const Object* obj2) const {
  function virtual (line 126) | virtual dist_t ProxyDistance(const Object* obj1, const Object* obj2) con...
  function virtual (line 162) | virtual void WriteNextObj(const Object& obj, const string& externId, Dat...

FILE: algorithms/NMSLIB/code/include/space/space_bit_hamming.h
  function namespace (line 33) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/space/space_bregman.h
  function virtual (line 49) | virtual ~BregmanDiv() {}
  function virtual (line 74) | virtual void CreateDenseVectFromObj(const Object* obj, dist_t* pDstVect,
  function BregmanDiv (line 82) | static inline
  function virtual (line 102) | virtual ~KLDivAbstract() {}
  function virtual (line 108) | virtual std::string StrDesc() const = 0;
  function virtual (line 136) | virtual ~KLDivGenFast() {}
  function virtual (line 141) | virtual size_t GetElemQty(const Object* object) const { return object->d...
  function virtual (line 153) | virtual ~ItakuraSaitoFast() {}
  function virtual (line 161) | virtual size_t GetElemQty(const Object* object) const { return object->d...
  function virtual (line 173) | virtual ~KLDivGenFastRightQuery() {}
  function virtual (line 175) | virtual void CreateDenseVectFromObj(const Object* obj, dist_t* pDstVect,
  function virtual (line 183) | virtual size_t GetElemQty(const Object* object) const { return object->d...
  function virtual (line 194) | virtual ~KLDivFast() {}
  function virtual (line 196) | virtual void CreateDenseVectFromObj(const Object* obj, dist_t* pDstVect,
  function virtual (line 204) | virtual size_t GetElemQty(const Object* object) const { return object->d...
  function virtual (line 215) | virtual ~KLDivFastRightQuery() {}
  function virtual (line 217) | virtual void CreateDenseVectFromObj(const Object* obj, dist_t* pDstVect,
  function virtual (line 225) | virtual size_t GetElemQty(const Object* object) const { return object->d...

FILE: algorithms/NMSLIB/code/include/space/space_dummy.h
  function namespace (line 35) | namespace similarity {
  function virtual (line 101) | virtual bool ApproxEqual(const Object& obj1, const Object& obj2) const {
  function virtual (line 110) | virtual void CreateDenseVectFromObj(const Object* obj, dist_t* pVect,
  function virtual (line 114) | virtual size_t GetElemQty(const Object* object) const {return 0;}

FILE: algorithms/NMSLIB/code/include/space/space_js.h
  function namespace (line 39) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/space/space_leven.h
  function namespace (line 29) | namespace similarity {
  function class (line 53) | class SpaceLevenshteinNormalized : public StringSpace<float> {

FILE: algorithms/NMSLIB/code/include/space/space_lp.h
  function namespace (line 38) | namespace similarity {
  function dist_t (line 51) | dist_t operator()(const dist_t* x, const dist_t* y, size_t length) const {
  function virtual (line 82) | virtual ~SpaceLp() {}

FILE: algorithms/NMSLIB/code/include/space/space_rank_correl.h
  function namespace (line 32) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/space/space_scalar.h
  function namespace (line 37) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/space/space_sparse_lp.h
  function namespace (line 37) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/space/space_sparse_scalar.h
  function namespace (line 36) | namespace similarity {
  function virtual (line 70) | virtual ~SpaceSparseCosineSimilarity() {}

FILE: algorithms/NMSLIB/code/include/space/space_sparse_scalar_fast.h
  function namespace (line 37) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/space/space_sparse_vector.h
  function namespace (line 34) | namespace similarity {
  function explicit (line 75) | explicit SpaceSparseVector() {}
  function virtual (line 76) | virtual ~SpaceSparseVector() {}
  function virtual (line 108) | virtual size_t GetElemQty(const Object* object) const {return 0;}
  function virtual (line 122) | virtual ~SpaceSparseVectorSimpleStorage() {}
  function explicit (line 123) | explicit SpaceSparseVectorSimpleStorage() {}
  function virtual (line 125) | virtual void CreateDenseVectFromObj(const Object* obj, dist_t* pVect,
  function Object (line 138) | Object* CreateObjFromVect(IdType id, LabelType label, const vector<ElemT...
  function virtual (line 142) | virtual dist_t ScalarProduct(const Object* obj1, const Object* obj2) con...
  function virtual (line 150) | virtual void CreateVectFromObj(const Object* obj, vector<ElemType>& v) c...
  type SpaceNormScalarProduct (line 159) | struct SpaceNormScalarProduct {

FILE: algorithms/NMSLIB/code/include/space/space_sparse_vector_inter.h
  function namespace (line 35) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/space/space_sqfd.h
  function namespace (line 39) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/space/space_string.h
  function namespace (line 30) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/space/space_vector.h
  function namespace (line 32) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/space/space_vector_gen.h
  function namespace (line 25) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/space/space_word_embed.h
  function namespace (line 37) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/spacefactory.h
  function namespace (line 27) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/tune.h
  function namespace (line 39) | namespace similarity {

FILE: algorithms/NMSLIB/code/include/utils.h
  type SSIZE_T (line 70) | typedef SSIZE_T ssize_t;
  function namespace (line 75) | namespace similarity {
  function mMap (line 283) | mMap(Map) {}
  function mMap (line 292) | mMap(Map) {}

FILE: algorithms/NMSLIB/code/include/ztimer.h
  function class (line 27) | class WallClockTimer {

FILE: algorithms/NMSLIB/code/lshkit/include/lshkit/apost.h
  type Parameter (line 65) | struct Parameter {
  function apply1 (line 115) | float apply1 (Domain obj, unsigned m) const {
  function apply1 (line 125) | void apply1 (Domain obj, std::vector<float> *h) const {
  function apply_const (line 144) | unsigned apply_const (Domain obj) const
  type APostExample (line 171) | struct APostExample {
  type PrH (line 176) | struct PrH {    // Pr[h] of certain compnent
  function operator (line 187) | bool operator < (const PrH &p1, const PrH &p2) {
  function class (line 193) | class APostModel
  type typename (line 236) | typedef typename Super::Parameter Parameter;
  type typename (line 238) | typedef typename Super::Domain Domain;
  type KEY (line 239) | typedef KEY Key;
  function train (line 289) | void train (const std::vector<APostExample> &examples, unsigned Nz, floa...
  function load (line 296) | void load (std::istream &ar)
  function save (line 304) | void save (std::ostream &ar)

FILE: algorithms/NMSLIB/code/lshkit/include/lshkit/archive.h
  function namespace (line 49) | namespace lshkit {

FILE: algorithms/NMSLIB/code/lshkit/include/lshkit/common.h
  function namespace (line 49) | namespace lshkit {

FILE: algorithms/NMSLIB/code/lshkit/include/lshkit/composite.h
  function namespace (line 50) | namespace lshkit {
  type Parameter (line 138) | struct Parameter
  type typename (line 141) | typedef typename Super::Domain Domain;
  function const (line 164) | unsigned operator () (Domain obj) const
  type Parameter (line 195) | struct Parameter
  type typename (line 198) | typedef typename Super::Domain Domain;
  type Parameter (line 223) | struct Parameter
  type typename (line 226) | typedef typename Super::Domain Domain;
  function const (line 236) | unsigned operator () (Domain obj) const
  function const (line 241) | unsigned operator () (Domain obj, float *delta) const
  type Parameter (line 285) | struct Parameter
  type typename (line 292) | typedef typename Super::Domain Domain;
  function const (line 327) | unsigned operator () (Domain obj) const
  type Parameter (line 384) | struct Parameter
  type typename (line 391) | typedef typename LSH::Domain Domain;
  function const (line 422) | unsigned operator () (Domain obj) const
  type Parameter (line 469) | struct Parameter
  type typename (line 475) | typedef typename Super::Domain Domain;
  function const (line 503) | unsigned operator () (Domain obj) const
  type Parameter (line 535) | struct Parameter
  type typename (line 538) | typedef typename Super::Domain Domain;
  function const (line 549) | unsigned operator () (Domain obj) const {
  function const (line 553) | unsigned operator () (Domain obj, float *delta) const

FILE: algorithms/NMSLIB/code/lshkit/include/lshkit/concept.h
  function namespace (line 82) | namespace lshkit {

FILE: algorithms/NMSLIB/code/lshkit/include/lshkit/eval.h
  function namespace (line 38) | namespace lshkit {
  function load (line 118) | void load (std::istream &is)
  function save (line 139) | void save (std::ostream &os) const
  function load (line 151) | void load (const std::string &path)
  function save (line 158) | void save (const std::string &path) const
  function getQuery (line 168) | unsigned getQuery (unsigned n) const {  return queries_[n]; }
  function Topk (line 171) | const Topk<KEY> &getAnswer (unsigned n) const { return topks_[n]; }
  function class (line 201) | class Stat
  function merge (line 244) | void merge (const Stat &stat)

FILE: algorithms/NMSLIB/code/lshkit/include/lshkit/forest.h
  function namespace (line 59) | namespace lshkit {
  function lookup (line 172) | void lookup (Domain val, std::vector<const Node *> *nodes) const {

FILE: algorithms/NMSLIB/code/lshkit/include/lshkit/histogram.h
  function namespace (line 83) | namespace lshkit {

FILE: algorithms/NMSLIB/code/lshkit/include/lshkit/kernel.h
  function namespace (line 32) | namespace lshkit { namespace kernel {

FILE: algorithms/NMSLIB/code/lshkit/include/lshkit/lsh-index.h
  function namespace (line 35) | namespace lshkit {

FILE: algorithms/NMSLIB/code/lshkit/include/lshkit/lsh.h
  function namespace (line 34) | namespace lshkit {
  type StableDistLsh (line 201) | typedef StableDistLsh<Cauchy> CauchyLsh;
  type StableDistLsh (line 203) | typedef StableDistLsh<Gaussian> GaussianLsh;
  function class (line 231) | class HyperPlaneLsh
  function const (line 271) | unsigned operator () (Domain obj) const
  function const (line 281) | unsigned operator () (Domain obj, float *delta) const
  function class (line 342) | class ThresholdingLsh
  function const (line 385) | unsigned operator () (Domain obj) const
  function const (line 390) | unsigned operator () (Domain obj, float *delta) const

FILE: algorithms/NMSLIB/code/lshkit/include/lshkit/matrix-io.h
  function namespace (line 41) | namespace lshkit{

FILE: algorithms/NMSLIB/code/lshkit/include/lshkit/matrix.h
  function namespace (line 46) | namespace lshkit {
  function class (line 135) | class Accessor
  type Matrix (line 186) | typedef Matrix<float> FloatMatrix;

FILE: algorithms/NMSLIB/code/lshkit/include/lshkit/metric.h
  function namespace (line 33) | namespace lshkit { namespace metric {
  function const (line 91) | float operator () (const T *first1, const T *first2) const
  function const (line 109) | float operator () (const T *first1, const T *first2) const
  type basic_hamming (line 124) | struct basic_hamming
  function __hamming (line 141) | unsigned __hamming (unsigned char c1, unsigned char c2) const
  function const (line 162) | float operator () (const T *first1, const T *first2) const

FILE: algorithms/NMSLIB/code/lshkit/include/lshkit/mplsh-model.h
  function namespace (line 41) | namespace lshkit {

FILE: algorithms/NMSLIB/code/lshkit/include/lshkit/mplsh.h
  function namespace (line 138) | namespace lshkit
  type std (line 170) | typedef std::vector<Probe> ProbeSequence;
  function class (line 176) | class ProbeSequenceTemplates: public std::vector<ProbeSequence>
  function class (line 192) | class MultiProbeLsh: public RepeatHash<GaussianLsh>
  function const (line 244) | unsigned operator () (Domain obj) const
  type typename (line 269) | typedef typename Super::Parameter Parameter;
  type KEY (line 278) | typedef KEY Key;
  function load (line 302) | void load (std::istream &ar)
  function save (line 311) | void save (std::ostream &ar)

FILE: algorithms/NMSLIB/code/lshkit/include/lshkit/multiprobelsh-fitdata.h
  function namespace (line 57) | namespace lshkit {

FILE: algorithms/NMSLIB/code/lshkit/include/lshkit/multiprobelsh-tune.h
  function namespace (line 147) | namespace lshkit {

FILE: algorithms/NMSLIB/code/lshkit/include/lshkit/sketch.h
  function namespace (line 107) | namespace lshkit {
  function load (line 196) | void load (std::istream &is) {
  function save (line 201) | void save (std::ostream &os) {
  function update (line 247) | void update (const CHUNK *in, const float *asym)
  function distTo (line 270) | float distTo (const CHUNK *in)

FILE: algorithms/NMSLIB/code/lshkit/include/lshkit/spectral-hash.h
  function namespace (line 35) | namespace lshkit {

FILE: algorithms/NMSLIB/code/lshkit/include/lshkit/topk.h
  function namespace (line 59) | namespace lshkit {
  type typename (line 111) | typedef typename std::vector<TopkEntry<KEY> > Base;
  function reset (line 138) | void reset (float r) {
  function recall (line 193) | float recall (const Topk<KEY> &topk /* to be evaluated */) const
  type typename (line 226) | typedef typename ACCESSOR::Value Value;
  function reset (line 252) | void reset (Value query) {
  function reset (line 311) | void reset (const float *query) {

FILE: algorithms/NMSLIB/code/lshkit/include/lshkit/tune.h
  function namespace (line 31) | namespace lshkit { namespace tune {

FILE: algorithms/NMSLIB/code/lshkit/include/lshkit/vq.h
  function namespace (line 26) | namespace lshkit {

FILE: algorithms/NMSLIB/code/lshkit/src/apost.cpp
  type lshkit (line 28) | namespace lshkit
    type ExampleModel (line 33) | struct ExampleModel {
      method estimate (line 38) | void estimate (const APostLsh &lsh, const APostExample &example)
    class GaussianHashModel (line 136) | class GaussianHashModel
      method GaussianHashModel (line 141) | GaussianHashModel (const APostLsh &lsh, const std::vector<APostExamp...
      method estimate (line 158) | void estimate (unsigned m, float h, float *mean, float *std) { // mt...
    function GaussianInterval (line 173) | static inline float GaussianInterval (float mean, float std, float l, ...
    type PrC (line 254) | struct PrC {
    type Probe (line 264) | struct Probe {
      method Probe (line 270) | Probe () {
      method Probe (line 274) | Probe (const std::vector<unsigned> *range_):
      method canShift (line 282) | bool canShift () const {
      method shift (line 289) | void shift () {
      method canExpand (line 295) | bool canExpand () const {
      method expand (line 301) | void expand () {
      method canExtend (line 306) | bool canExtend () const {
      method extend (line 311) | void extend () {
      method setPr (line 319) | void setPr (const std::vector<PrC> &pl) {
      method hash (line 327) | unsigned hash (const APostLsh &lsh,
      method print (line 337) | unsigned print (const std::vector<PrC> &pl) {
    function BOOST_FOREACH (line 389) | BOOST_FOREACH(const PrC &prc, pl) {

FILE: algorithms/NMSLIB/code/lshkit/src/kdtree.cpp
  function sqr (line 17) | static inline float sqr (float x) {
  function l2sqr (line 21) | static inline float l2sqr (const float *p1, const float *p2, unsigned D) {
  type kd_node (line 36) | struct kd_node
  function kd_is_leaf (line 48) | static inline int kd_is_leaf (union kd_leaf_or_node u, unsigned K) {
  type kd_node (line 57) | struct kd_node {
  type kd_tree (line 70) | struct kd_tree {
  function kd_node_t (line 79) | static inline kd_node_t *kd_alloc_node (kd_tree_t *tree) {
  function kd_tree_t (line 84) | kd_tree_t *kd_tree_alloc (unsigned K, unsigned dim) {
  function kd_tree_free (line 99) | void kd_tree_free (kd_tree_t *tree) {
  function bisec (line 108) | static inline void bisec (
  function kd_node_t (line 200) | static const kd_node_t *kd_index_hlp (kd_tree_t *tree, unsigned *idx, un...
  function kd_tree_index (line 244) | void kd_tree_index (kd_tree_t *tree, const float *means) {
  type kd_search_stat (line 285) | struct kd_search_stat {
  type kd_search_stat (line 295) | struct kd_search_stat
  function kd_search_leaf_or_node (line 297) | static inline void kd_search_leaf_or_node (union kd_leaf_or_node lon,
  function kd_search_node (line 314) | static void kd_search_node (const kd_node_t *node, struct kd_search_stat...
  function kd_tree_search (line 352) | unsigned kd_tree_search (kd_tree_t *tree, const float *pt, unsigned *cnt) {
  function kd_tree_ln_search (line 388) | unsigned kd_tree_ln_search (kd_tree_t *tree, const float *pt, unsigned *...

FILE: algorithms/NMSLIB/code/lshkit/src/kdtree.h
  type kd_tree_t (line 4) | typedef struct kd_tree kd_tree_t;

FILE: algorithms/NMSLIB/code/lshkit/src/mplsh-model.cpp
  type lshkit (line 36) | namespace lshkit {
    class GammaDoubleMleHelper (line 41) | class GammaDoubleMleHelper
      method GammaDoubleMleHelper (line 45) | GammaDoubleMleHelper(double rate): rate_(rate) {}
    function GammaDoubleMleTol (line 53) | bool GammaDoubleMleTol (double first, double second)
    function GammaDouble (line 58) | GammaDouble GammaDoubleMLE (double M, double G)
    function col_helper (line 68) | static inline double col_helper (double x)
    function p_col_helper (line 76) | static inline double p_col_helper (double x, double k)
    type __MpLshMdlHlpr (line 117) | struct __MpLshMdlHlpr
    function recall_helper (line 123) | static double recall_helper (double xsqr, void *_param)
    function recall (line 130) | static double recall (__MpLshMdlHlpr *param)

FILE: algorithms/NMSLIB/code/lshkit/src/mplsh.cpp
  type lshkit (line 24) | namespace lshkit
    function GenExpectScores (line 28) | void GenExpectScores (ProbeSequence &seq, unsigned M)
    class ProbeGT (line 44) | class ProbeGT
    function GenProbeSequenceTemplate (line 53) | void GenProbeSequenceTemplate (ProbeSequence &seq, unsigned M, unsigne...

FILE: algorithms/NMSLIB/code/lshkit/src/vq.cpp
  type lshkit (line 26) | namespace lshkit

FILE: algorithms/NMSLIB/code/lshkit/tools/apost-run.cpp
  function main (line 82) | int main (int argc, char *argv[])

FILE: algorithms/NMSLIB/code/lshkit/tools/dump-query.cpp
  function main (line 119) | int main (int argc, char *argv[])

FILE: algorithms/NMSLIB/code/lshkit/tools/embed.cpp
  class Embedder (line 89) | class Embedder {
    method add (line 96) | void add (float *out, const float *in) const {
    method zero (line 100) | void zero (float *out) const {
    method scale (line 104) | void scale (float *out, float s) const
    method norm (line 109) | void norm (float *out) const
  class StripeEmbedder (line 123) | class StripeEmbedder: public Embedder, public StripeEmbedderBase {
    type Parameter (line 126) | struct Parameter: public Base::Parameter {
    method StripeEmbedder (line 137) | StripeEmbedder (const Parameter &param, lshkit::DefaultRng &rng)
    method dim (line 141) | virtual unsigned dim () const {
    method add (line 145) | virtual void add (float *out, const float *in, float weight) const {
  class HyperPlaneEmbedder (line 155) | class HyperPlaneEmbedder: public Embedder, public HyperPlaneEmbedderBase {
    type Parameter (line 158) | struct Parameter: public Base::Parameter {
    method HyperPlaneEmbedder (line 167) | HyperPlaneEmbedder (const Parameter &param, lshkit::DefaultRng &rng)
    method dim (line 171) | virtual unsigned dim () const {
    method add (line 175) | virtual void add (float *out, const float *in, float weight) const {
  function main (line 187) | int main (int argc, char *argv[])

FILE: algorithms/NMSLIB/code/lshkit/tools/fitdata.cpp
  function main (line 67) | int main (int argc, char *argv[])

FILE: algorithms/NMSLIB/code/lshkit/tools/forest-run.cpp
  function main (line 56) | int main (int argc, char *argv[])

FILE: algorithms/NMSLIB/code/lshkit/tools/lsh-run.cpp
  function main (line 62) | int main (int argc, char *argv[])

FILE: algorithms/NMSLIB/code/lshkit/tools/mplsh-predict.cpp
  function main (line 50) | int main (int argc, char *argv[])

FILE: algorithms/NMSLIB/code/lshkit/tools/mplsh-run.cpp
  function main (line 119) | int main (int argc, char *argv[])

FILE: algorithms/NMSLIB/code/lshkit/tools/mplsh-tune.cpp
  function main (line 205) | int main (int argc, char *argv[])

FILE: algorithms/NMSLIB/code/lshkit/tools/run-spectral.cpp
  function main (line 6) | int main (int argc, char *argv[])

FILE: algorithms/NMSLIB/code/lshkit/tools/scan.cpp
  function main (line 58) | int main (int argc, char *argv[])

FILE: algorithms/NMSLIB/code/lshkit/tools/sketch-run.cpp
  function main (line 64) | int main (int argc, char *argv[])

FILE: algorithms/NMSLIB/code/lshkit/tools/txt2bin.cpp
  function main (line 48) | int main (int argc, char *argv[])

FILE: algorithms/NMSLIB/code/src/cluster_util.cc
  type similarity (line 28) | namespace similarity {
    type DataWrapper (line 33) | struct DataWrapper {
      method DataWrapper (line 34) | DataWrapper(IdTypeUnsign dataId, IdType centerIndex, const Object* p...
      method DataWrapper (line 36) | DataWrapper(){}
    class ClusterUtils<float> (line 851) | class ClusterUtils<float>
    class ClusterUtils<double> (line 852) | class ClusterUtils<double>
    class ClusterUtils<int> (line 853) | class ClusterUtils<int>

FILE: algorithms/NMSLIB/code/src/distcomp_bregman.cc
  type similarity (line 29) | namespace similarity {
    function T (line 39) | T ItakuraSaito(const T* pVect1, const T* pVect2, size_t qty) {
    function T (line 53) | T ItakuraSaitoPrecomp(const T* pVect1, const T* pVect2, size_t qty) {
    function ItakuraSaitoPrecompSIMD (line 86) | float ItakuraSaitoPrecompSIMD(const float* pVect1, const float* pVect2...
    function ItakuraSaitoPrecompSIMD (line 155) | double ItakuraSaitoPrecompSIMD(const double* pVect1, const double* pVe...
    function T (line 208) | T KLStandard(const T *pVect1, const T *pVect2, size_t qty)
    function T (line 222) | T KLStandardLogDiff(const T *p1, const T *p2, size_t qty)
    function T (line 238) | T KLPrecomp(const T* pVect1, const T* pVect2, size_t qty) {
    function KLPrecompSIMD (line 270) | float KLPrecompSIMD(const float* pVect1, const float* pVect2, size_t qty)
    function KLPrecompSIMD (line 332) | double KLPrecompSIMD(const double* pVect1, const double* pVect2, size_...
    function T (line 377) | T KLGeneralStandard(const T *pVect1, const T *pVect2, size_t qty)
    function T (line 396) | T KLGeneralPrecomp(const T* pVect1, const T* pVect2, size_t qty) {
    function KLGeneralPrecompSIMD (line 428) | float KLGeneralPrecompSIMD(const float* pVect1, const float* pVect2, s...
    function KLGeneralPrecompSIMD (line 498) | double KLGeneralPrecompSIMD(const double* pVect1, const double* pVect2...

FILE: algorithms/NMSLIB/code/src/distcomp_edist.cc
  type similarity (line 25) | namespace similarity {
    function levenshtein (line 29) | int levenshtein(const T* p1, size_t len1, const T* p2, size_t len2) {

FILE: algorithms/NMSLIB/code/src/distcomp_js.cc
  type similarity (line 30) | namespace similarity {
    function T (line 50) | T JSStandard(const T *pVect1, const T *pVect2, size_t qty)
    function T (line 72) | T JSPrecomp(const T* pVect1, const T* pVect2, size_t qty) {
    function lapprox (line 99) | inline unsigned lapprox(T f) {
    class ApproxLogs (line 104) | class ApproxLogs {
      method ApproxLogs (line 106) | ApproxLogs() {
    function T (line 116) | T
    function JSPrecompSIMDApproxLog (line 153) | float JSPrecompSIMDApproxLog(const float* pVect1, const float* pVect2,...
    function JSPrecompSIMDApproxLog (line 238) | double JSPrecompSIMDApproxLog(const double* pVect1, const double* pVec...

FILE: algorithms/NMSLIB/code/src/distcomp_lp.cc
  type similarity (line 33) | namespace similarity {
    function T (line 42) | T LInfNormStandard(const T *p1, const T *p2, size_t qty)
    function T (line 58) | T LInfNorm(const T* pVect1, const T* pVect2, size_t qty) {
    function LInfNormSIMD (line 87) | float LInfNormSIMD(const float* pVect1, const float* pVect2, size_t qt...
    function LInfNormSIMD (line 151) | double LInfNormSIMD(const double* pVect1, const double* pVect2, size_t...
    function T (line 200) | T L1NormStandard(const T *p1, const T *p2, size_t qty)
    function T (line 216) | T L1Norm(const T* pVect1, const T* pVect2, size_t qty) {
    function L1NormSIMD (line 245) | float L1NormSIMD(const float* pVect1, const float* pVect2, size_t qty) {
    function L1NormSIMD (line 308) | double L1NormSIMD(const double* pVect1, const double* pVect2, size_t q...
    function T (line 358) | T L2NormStandard(const T *p1, const T *p2, size_t qty)
    function T (line 373) | T L2Norm(const T* pVect1, const T* pVect2, size_t qty) {
    function L2SqrSIMD (line 410) | float L2SqrSIMD(const float* pVect1, const float* pVect2, size_t qty) {
    function L2NormSIMD (line 474) | float L2NormSIMD(const float* pVect1, const float* pVect2, size_t qty) {
    function L2NormSIMD (line 480) | double L2NormSIMD(const double* pVect1, const double* pVect2, size_t q...
    function T (line 527) | T LPGenericDistance(const T* x, const T* y, const int length, const T ...
    function T (line 551) | T LPGenericDistanceOptim(const T* x, const T* y, const int length, con...

FILE: algorithms/NMSLIB/code/src/distcomp_rankcorr.cc
  type similarity (line 23) | namespace similarity {
    function SpearmanFootrule (line 33) | int SpearmanFootrule(const PivotIdType* x, const PivotIdType* y, size_...
    function SpearmanFootruleSIMD (line 45) | int SpearmanFootruleSIMD(const int32_t* pVect1, const int32_t* pVect2,...
    function SpearmanRho (line 105) | int SpearmanRho(const PivotIdType* x, const PivotIdType* y, size_t qty) {
    function SpearmanRhoSIMD (line 117) | int SpearmanRhoSIMD(const PivotIdType* pVect1, const PivotIdType* pVec...

FILE: algorithms/NMSLIB/code/src/distcomp_scalar.cc
  type similarity (line 24) | namespace similarity {
    function T (line 34) | T NormScalarProduct(const T *p1, const T *p2, size_t qty)
    function NormScalarProductSIMD (line 66) | float NormScalarProductSIMD(const float* pVect1, const float* pVect2, ...
    function NormScalarProductSIMD (line 154) | double NormScalarProductSIMD(const double* pVect1, const double* pVect...
    function T (line 253) | T ScalarProduct(const T *p1, const T *p2, size_t qty) {
    function ScalarProductSIMD (line 271) | float ScalarProductSIMD(const float* pVect1, const float* pVect2, size...
    function ScalarProductSIMD (line 325) | double ScalarProductSIMD(const double* pVect1, const double* pVect2, s...
    function T (line 387) | T AngularDistance(const T *p1, const T *p2, size_t qty)
    function T (line 401) | T CosineSimilarity(const T *p1, const T *p2, size_t qty)

FILE: algorithms/NMSLIB/code/src/distcomp_sparse_scalar_fast.cc
  type similarity (line 25) | namespace similarity {
    function ScalarProductFast (line 85) | float ScalarProductFast(const char* pData1, size_t len1,

FILE: algorithms/NMSLIB/code/src/dummy_app.cc
  function main (line 4) | int main(void) {

FILE: algorithms/NMSLIB/code/src/experimentconf.cc
  type similarity (line 45) | namespace similarity {
    class ExperimentConfig<float> (line 430) | class ExperimentConfig<float>
    class ExperimentConfig<double> (line 431) | class ExperimentConfig<double>
    class ExperimentConfig<int> (line 432) | class ExperimentConfig<int>

FILE: algorithms/NMSLIB/code/src/global.cc
  type similarity (line 19) | namespace similarity {

FILE: algorithms/NMSLIB/code/src/init.cc
  type similarity (line 31) | namespace similarity {
    function initLibrary (line 33) | void initLibrary(LogChoice choice, const char* pLogFile) {

FILE: algorithms/NMSLIB/code/src/knnquery.cc
  type similarity (line 29) | namespace similarity {
    function dist_t (line 57) | dist_t KNNQuery<dist_t>::Radius() const {
    class KNNQuery<float> (line 136) | class KNNQuery<float>
    class KNNQuery<double> (line 137) | class KNNQuery<double>
    class KNNQuery<int> (line 138) | class KNNQuery<int>
    class KNNQuery<short int> (line 139) | class KNNQuery<short int>

FILE: algorithms/NMSLIB/code/src/logging.cc
  type voidstream (line 38) | struct voidstream : public ostream {
    method ostream (line 39) | ostream& operator<< (T) { return *this; }
    method ostream (line 40) | ostream& operator<< (T*) { return *this; }
    method ostream (line 41) | ostream& operator<< (T&) { return *this; }
    method voidstream (line 42) | voidstream() : ostream(0) {}
  function LibGetCurrentTime (line 45) | std::string LibGetCurrentTime() {
  function InitializeLogger (line 79) | void InitializeLogger(LogChoice choice, const char* logfile) {

FILE: algorithms/NMSLIB/code/src/main.cc
  function OutData (line 53) | void OutData(bool DoAppend, const string& FilePrefix,
  function ProcessResults (line 88) | void ProcessResults(const ExperimentConfig<dist_t>& config,
  function RunExper (line 130) | void RunExper(bool                                bPrintProgress,
  function main (line 510) | int main(int ac, char* av[]) {

FILE: algorithms/NMSLIB/code/src/memory.cc
  type similarity (line 37) | namespace similarity {

FILE: algorithms/NMSLIB/code/src/method/bbtree.cc
  type similarity (line 39) | namespace similarity {
    class BBTree<double> (line 331) | class BBTree<double>
    class BBTree<float> (line 332) | class BBTree<float>

FILE: algorithms/NMSLIB/code/src/method/dummy.cc
  type similarity (line 22) | namespace similarity {
    class DummyMethod<float> (line 59) | class DummyMethod<float>
    class DummyMethod<double> (line 60) | class DummyMethod<double>
    class DummyMethod<int> (line 61) | class DummyMethod<int>

FILE: algorithms/NMSLIB/code/src/method/ghtree.cc
  type similarity (line 25) | namespace similarity {
    class GHTree<double> (line 208) | class GHTree<double>
    class GHTree<float> (line 209) | class GHTree<float>
    class GHTree<int> (line 210) | class GHTree<int>

FILE: algorithms/NMSLIB/code/src/method/hnsw.cc
  type similarity (line 60) | namespace similarity {
    class Hnsw<float> (line 880) | class Hnsw<float>
    class Hnsw<double> (line 881) | class Hnsw<double>
    class Hnsw<int> (line 882) | class Hnsw<int>

FILE: algorithms/NMSLIB/code/src/method/hnsw_distfunc_opt.cc
  type similarity (line 42) | namespace similarity {
    function L2SqrSIMD16Ext (line 43) | float L2SqrSIMD16Ext(const float* pVect1, const float* pVect2, size_t ...
    function L2SqrSIMDExt (line 97) | float L2SqrSIMDExt(const float* pVect1, const float* pVect2, size_t &q...
    function ScalarProductSIMD (line 151) | float ScalarProductSIMD(const float* __restrict pVect1, const float*  ...
    function NormScalarProductSIMD (line 208) | float NormScalarProductSIMD(const float* pVect1, const float* pVect2, ...
    class Hnsw<float> (line 524) | class Hnsw<float>
    class Hnsw<double> (line 525) | class Hnsw<double>
    class Hnsw<int> (line 526) | class Hnsw<int>

FILE: algorithms/NMSLIB/code/src/method/list_clusters.cc
  type similarity (line 27) | namespace similarity {
    type DistDistObjectTupleAscComparator (line 37) | struct DistDistObjectTupleAscComparator {
    type Elem (line 219) | struct Elem {
      method Elem (line 223) | Elem(Cluster* c, dist_t d) : cluster(c), dist_qc(d) {}
    function Object (line 260) | const Object* ListClusters<dist_t>::SelectNextCenter(
    function Object (line 329) | const Object* ListClusters<dist_t>::Cluster::GetCenter() {
    function dist_t (line 334) | const dist_t ListClusters<dist_t>::Cluster::GetCoveringRadius() {
    function ObjectVector (line 339) | const ObjectVector& ListClusters<dist_t>::Cluster::GetBucket() {
    class ListClusters<double> (line 351) | class ListClusters<double>
    class ListClusters<float> (line 352) | class ListClusters<float>
    class ListClusters<int> (line 353) | class ListClusters<int>

FILE: algorithms/NMSLIB/code/src/method/lsh.cc
  type similarity (line 25) | namespace similarity {
    class LSH<float, lshkit::ThresholdingLsh, ParameterCreator<TailRepeatHashThreshold>> (line 123) | class LSH<float, lshkit::ThresholdingLsh, ParameterCreator<TailRepeatH...
    class LSH<float, lshkit::CauchyLsh, ParameterCreator<TailRepeatHashCauchy>> (line 124) | class LSH<float, lshkit::CauchyLsh, ParameterCreator<TailRepeatHashCau...
    class LSH<float, lshkit::GaussianLsh, ParameterCreator<TailRepeatHashGaussian>> (line 125) | class LSH<float, lshkit::GaussianLsh, ParameterCreator<TailRepeatHashG...

FILE: algorithms/NMSLIB/code/src/method/lsh_multiprobe.cc
  type similarity (line 25) | namespace similarity {
    class MultiProbeLSH<float> (line 196) | class MultiProbeLSH<float>

FILE: algorithms/NMSLIB/code/src/method/lsh_space.cc
  type similarity (line 20) | namespace similarity {
    function LSHLp (line 29) | float LSHLp(const float* x, const float* y, const int dim, const int p) {
    function LSHMultiProbeLp (line 41) | float LSHMultiProbeLp(const float* x, const float* y, const int dim) {

FILE: algorithms/NMSLIB/code/src/method/multi_index.cc
  type similarity (line 30) | namespace similarity {
    class MultiIndex<float> (line 143) | class MultiIndex<float>
    class MultiIndex<double> (line 144) | class MultiIndex<double>
    class MultiIndex<int> (line 145) | class MultiIndex<int>

FILE: algorithms/NMSLIB/code/src/method/multi_vantage_point_tree.cc
  type similarity (line 26) | namespace similarity {
    class MultiVantagePointTree<float> (line 245) | class MultiVantagePointTree<float>
    class MultiVantagePointTree<double> (line 246) | class MultiVantagePointTree<double>
    class MultiVantagePointTree<int> (line 247) | class MultiVantagePointTree<int>

FILE: algorithms/NMSLIB/code/src/method/nndes.cc
  type similarity (line 63) | namespace similarity {
    class NNDescentMethod<float> (line 260) | class NNDescentMethod<float>
    class NNDescentMethod<double> (line 261) | class NNDescentMethod<double>
    class NNDescentMethod<int> (line 262) | class NNDescentMethod<int>

FILE: algorithms/NMSLIB/code/src/method/nonmetr_list_clust.cc
  type similarity (line 26) | namespace similarity {
    class NonMetrListClust<float> (line 148) | class NonMetrListClust<float>
    class NonMetrListClust<double> (line 149) | class NonMetrListClust<double>
    class NonMetrListClust<int> (line 150) | class NonMetrListClust<int>

FILE: algorithms/NMSLIB/code/src/method/omedrank.cc
  type similarity (line 32) | namespace similarity {
    class OMedRank<float> (line 294) | class OMedRank<float>
    class OMedRank<double> (line 295) | class OMedRank<double>
    class OMedRank<int> (line 296) | class OMedRank<int>

FILE: algorithms/NMSLIB/code/src/method/perm_bin_vptree.cc
  type similarity (line 32) | namespace similarity {
    class PermBinVPTree<float, SpearmanRho> (line 178) | class PermBinVPTree<float, SpearmanRho>
    class PermBinVPTree<float, SpearmanRhoSIMD> (line 179) | class PermBinVPTree<float, SpearmanRhoSIMD>
    class PermBinVPTree<float, SpearmanFootrule> (line 180) | class PermBinVPTree<float, SpearmanFootrule>
    class PermBinVPTree<double, SpearmanRho> (line 181) | class PermBinVPTree<double, SpearmanRho>
    class PermBinVPTree<double, SpearmanRhoSIMD> (line 182) | class PermBinVPTree<double, SpearmanRhoSIMD>
    class PermBinVPTree<double, SpearmanFootrule> (line 183) | class PermBinVPTree<double, SpearmanFootrule>
    class PermBinVPTree<int, SpearmanRho> (line 184) | class PermBinVPTree<int, SpearmanRho>
    class PermBinVPTree<int, SpearmanRhoSIMD> (line 185) | class PermBinVPTree<int, SpearmanRhoSIMD>
    class PermBinVPTree<int, SpearmanFootrule> (line 186) | class PermBinVPTree<int, SpearmanFootrule>

FILE: algorithms/NMSLIB/code/src/method/perm_index_incr_bin.cc
  type similarity (line 29) | namespace similarity {
    class PermutationIndexIncrementalBin<float,SpearmanRho> (line 169) | class PermutationIndexIncrementalBin<float,SpearmanRho>
    class PermutationIndexIncrementalBin<double,SpearmanRho> (line 170) | class PermutationIndexIncrementalBin<double,SpearmanRho>
    class PermutationIndexIncrementalBin<int,SpearmanRho> (line 171) | class PermutationIndexIncrementalBin<int,SpearmanRho>
    class PermutationIndexIncrementalBin<float,SpearmanFootrule> (line 172) | class PermutationIndexIncrementalBin<float,SpearmanFootrule>
    class PermutationIndexIncrementalBin<double,SpearmanFootrule> (line 173) | class PermutationIndexIncrementalBin<double,SpearmanFootrule>
    class PermutationIndexIncrementalBin<int,SpearmanFootrule> (line 174) | class PermutationIndexIncrementalBin<int,SpearmanFootrule>
    class PermutationIndexIncrementalBin<float,SpearmanRhoSIMD> (line 175) | class PermutationIndexIncrementalBin<float,SpearmanRhoSIMD>
    class PermutationIndexIncrementalBin<double,SpearmanRhoSIMD> (line 176) | class PermutationIndexIncrementalBin<double,SpearmanRhoSIMD>
    class PermutationIndexIncrementalBin<int,SpearmanRhoSIMD> (line 177) | class PermutationIndexIncrementalBin<int,SpearmanRhoSIMD>
    class PermutationIndexIncrementalBin<float,SpearmanFootruleSIMD> (line 178) | class PermutationIndexIncrementalBin<float,SpearmanFootruleSIMD>
    class PermutationIndexIncrementalBin<double,SpearmanFootruleSIMD> (line 179) | class PermutationIndexIncrementalBin<double,SpearmanFootruleSIMD>
    class PermutationIndexIncrementalBin<int,SpearmanFootruleSIMD> (line 180) | class PermutationIndexIncrementalBin<int,SpearmanFootruleSIMD>

FILE: algorithms/NMSLIB/code/src/method/perm_lsh_bin.cc
  type similarity (line 28) | namespace similarity {
    class PermutationIndexLSHBin<float> (line 162) | class PermutationIndexLSHBin<float>
    class PermutationIndexLSHBin<double> (line 163) | class PermutationIndexLSHBin<double>
    class PermutationIndexLSHBin<int> (line 164) | class PermutationIndexLSHBin<int>

FILE: algorithms/NMSLIB/code/src/method/permutation_inverted_index.cc
  type similarity (line 29) | namespace similarity {
    function string (line 132) | const string PermutationInvertedIndex<dist_t>::StrDesc() const {
    class PermutationInvertedIndex<float> (line 272) | class PermutationInvertedIndex<float>
    class PermutationInvertedIndex<double> (line 273) | class PermutationInvertedIndex<double>
    class PermutationInvertedIndex<int> (line 274) | class PermutationInvertedIndex<int>

FILE: algorithms/NMSLIB/code/src/method/permutation_prefix_index.cc
  type similarity (line 28) | namespace similarity {
    class PrefixNode (line 30) | class PrefixNode
    class PrefixNodeInternal (line 31) | class PrefixNodeInternal
      method PrefixNodeInternal (line 99) | PrefixNodeInternal() : num_objects_(0) {}
      method IsLeaf (line 107) | bool IsLeaf() const { return false; }
      method ChunkBuckets (line 109) | virtual void ChunkBuckets() {
      method Insert (line 113) | void Insert(const Permutation& perm,
      method GetNumberObjects (line 134) | size_t GetNumberObjects() const { return num_objects_; }
      method GetAllObjectsInThisSubTree (line 136) | void GetAllObjectsInThisSubTree(
      method PrefixNode (line 147) | const PrefixNode* SearchPath(const Permutation& perm,
    class PrefixNodeLeaf (line 32) | class PrefixNodeLeaf
      method PrefixNodeLeaf (line 54) | PrefixNodeLeaf() : bucket_(new ObjectVector()), CacheOptimizedBucket...
      method ChunkBuckets (line 57) | virtual void ChunkBuckets() {
      method IsLeaf (line 65) | bool IsLeaf() const { return true; }
      method Insert (line 67) | void Insert(const Permutation& perm,
      method GetNumberObjects (line 75) | size_t GetNumberObjects() const { return bucket_->size(); }
      method GetAllObjectsInThisSubTree (line 77) | void GetAllObjectsInThisSubTree(
      method PrefixNode (line 86) | const PrefixNode* SearchPath(const Permutation& perm,
    class PrefixNode (line 34) | class PrefixNode {
    class PrefixNodeLeaf (line 52) | class PrefixNodeLeaf : public PrefixNode {
      method PrefixNodeLeaf (line 54) | PrefixNodeLeaf() : bucket_(new ObjectVector()), CacheOptimizedBucket...
      method ChunkBuckets (line 57) | virtual void ChunkBuckets() {
      method IsLeaf (line 65) | bool IsLeaf() const { return true; }
      method Insert (line 67) | void Insert(const Permutation& perm,
      method GetNumberObjects (line 75) | size_t GetNumberObjects() const { return bucket_->size(); }
      method GetAllObjectsInThisSubTree (line 77) | void GetAllObjectsInThisSubTree(
      method PrefixNode (line 86) | const PrefixNode* SearchPath(const Permutation& perm,
    class PrefixNodeInternal (line 97) | class PrefixNodeInternal : public PrefixNode {
      method PrefixNodeInternal (line 99) | PrefixNodeInternal() : num_objects_(0) {}
      method IsLeaf (line 107) | bool IsLeaf() const { return false; }
      method ChunkBuckets (line 109) | virtual void ChunkBuckets() {
      method Insert (line 113) | void Insert(const Permutation& perm,
      method GetNumberObjects (line 134) | size_t GetNumberObjects() const { return num_objects_; }
      method GetAllObjectsInThisSubTree (line 136) | void GetAllObjectsInThisSubTree(
      method PrefixNode (line 147) | const PrefixNode* SearchPath(const Permutation& perm,
    class PrefixTree (line 167) | class PrefixTree {
      method PrefixTree (line 169) | PrefixTree() : root_(new PrefixNodeInternal) {}
      method ChunkBuckets (line 170) | void ChunkBuckets() { root_->ChunkBuckets(); }
      method Insert (line 174) | void Insert(const Permutation& perm,
      method FindCandidates (line 180) | void FindCandidates(const Permutation& perm_q,
    class PermutationPrefixIndex<float> (line 310) | class PermutationPrefixIndex<float>
    class PermutationPrefixIndex<double> (line 311) | class PermutationPrefixIndex<double>
    class PermutationPrefixIndex<int> (line 312) | class PermutationPrefixIndex<int>

FILE: algorithms/NMSLIB/code/src/method/pivot_neighb_invindx.cc
  type similarity (line 32) | namespace similarity {
    type IndexThreadParamsPNII (line 39) | struct IndexThreadParamsPNII {
      method IndexThreadParamsPNII (line 47) | IndexThreadParamsPNII(
    type IndexThreadPNII (line 65) | struct IndexThreadPNII {
    function string (line 292) | const string PivotNeighbInvertedIndex<dist_t>::StrDesc() const {
    class PivotNeighbInvertedIndex<float> (line 597) | class PivotNeighbInvertedIndex<float>
    class PivotNeighbInvertedIndex<double> (line 598) | class PivotNeighbInvertedIndex<double>
    class PivotNeighbInvertedIndex<int> (line 599) | class PivotNeighbInvertedIndex<int>

FILE: algorithms/NMSLIB/code/src/method/proj_vptree.cc
  type similarity (line 32) | namespace similarity {
    function Object (line 37) | Object* ProjectionVPTree<dist_t>::ProjectOneVect(size_t targSpaceId,
    class ProjectionVPTree<float> (line 247) | class ProjectionVPTree<float>
    class ProjectionVPTree<double> (line 248) | class ProjectionVPTree<double>
    class ProjectionVPTree<int> (line 249) | class ProjectionVPTree<int>

FILE: algorithms/NMSLIB/code/src/method/projection_index_incremental.cc
  class ProjectionIndexIncremental<float> (line 245) | class ProjectionIndexIncremental<float>
  class ProjectionIndexIncremental<double> (line 246) | class ProjectionIndexIncremental<double>
  class ProjectionIndexIncremental<int> (line 247) | class ProjectionIndexIncremental<int>

FILE: algorithms/NMSLIB/code/src/method/seqsearch.cc
  type similarity (line 25) | namespace similarity {
    type SearchThreadParamSeqSearch (line 28) | struct SearchThreadParamSeqSearch {
      method SearchThreadParamSeqSearch (line 34) | SearchThreadParamSeqSearch(
    type SearchThreadSeqSearch (line 47) | struct SearchThreadSeqSearch {
    class SeqSearch<float> (line 181) | class SeqSearch<float>
    class SeqSearch<double> (line 182) | class SeqSearch<double>
    class SeqSearch<int> (line 183) | class SeqSearch<int>

FILE: algorithms/NMSLIB/code/src/method/small_world_rand.cc
  type similarity (line 40) | namespace similarity {
    type IndexThreadParamsSW (line 45) | struct IndexThreadParamsSW {
      method IndexThreadParamsSW (line 55) | IndexThreadParamsSW(
    type IndexThreadSW (line 77) | struct IndexThreadSW {
    function MSWNode (line 203) | MSWNode* SmallWorldRand<dist_t>::getRandomEntryPointLocked() const
    function MSWNode (line 219) | MSWNode* SmallWorldRand<dist_t>::getRandomEntryPoint() const {
    class SmallWorldRand<float> (line 743) | class SmallWorldRand<float>
    class SmallWorldRand<double> (line 744) | class SmallWorldRand<double>
    class SmallWorldRand<int> (line 745) | class SmallWorldRand<int>

FILE: algorithms/NMSLIB/code/src/method/small_world_rand_split.cc
  type similarity (line 37) | namespace similarity {
    type IndexThreadParamsSplitSW (line 42) | struct IndexThreadParamsSplitSW {
      method IndexThreadParamsSplitSW (line 55) | IndexThreadParamsSplitSW(
    type IndexThreadSplitSW (line 82) | struct IndexThreadSplitSW {
    class SmallWorldRandSplit<float> (line 635) | class SmallWorldRandSplit<float>
    class SmallWorldRandSplit<double> (line 636) | class SmallWorldRandSplit<double>
    class SmallWorldRandSplit<int> (line 637) | class SmallWorldRandSplit<int>

FILE: algorithms/NMSLIB/code/src/method/spatial_approx_tree.cc
  type similarity (line 28) | namespace similarity {
    type SpatialApproxTree<dist_t>::SATKnn (line 31) | struct SpatialApproxTree<dist_t>::SATKnn {
      method SATKnn (line 37) | SATKnn() : lbound(0), mind(0), dist_qp(0), node(NULL) {}
      method SATKnn (line 38) | SATKnn(dist_t lbound, dist_t mind, dist_t dist_qp, SATNode* node)
    class SpatialApproxTree<dist_t>::SATNode (line 47) | class SpatialApproxTree<dist_t>::SATNode {
    function string (line 187) | const string SpatialApproxTree<dist_t>::StrDesc() const {
    class SpatialApproxTree<double> (line 248) | class SpatialApproxTree<double>
    class SpatialApproxTree<float> (line 249) | class SpatialApproxTree<float>
    class SpatialApproxTree<int> (line 250) | class SpatialApproxTree<int>

FILE: algorithms/NMSLIB/code/src/method/vptree.cc
  type similarity (line 31) | namespace similarity {
    class VPTree<float, PolynomialPruner<float> > (line 256) | class VPTree<float, PolynomialPruner<float> >
    class VPTree<double, PolynomialPruner<double> > (line 257) | class VPTree<double, PolynomialPruner<double> >
    class VPTree<int, PolynomialPruner<int> > (line 258) | class VPTree<int, PolynomialPruner<int> >

FILE: algorithms/NMSLIB/code/src/params.cc
  type similarity (line 31) | namespace similarity {
    function ParseSpaceArg (line 36) | void ParseSpaceArg(const string& descStr, string& SpaceType, vector<st...
    function ParseArg (line 52) | void ParseArg(const string& descStr, vector<string>& vDesc) {

FILE: algorithms/NMSLIB/code/src/params_cmdline.cc
  type similarity (line 33) | namespace similarity {
    function Usage (line 40) | static void Usage(const char *prog,
    function ParseCommandLine (line 46) | void ParseCommandLine(int argc, char* argv[], bool& bPrintProgress,

FILE: algorithms/NMSLIB/code/src/projection.cc
  type similarity (line 30) | namespace similarity {
    class ProjectionVectDense (line 40) | class ProjectionVectDense : public Projection<dist_t> {
      method compProj (line 42) | virtual void compProj(const Query<dist_t>* pQuery,
      method ProjectionVectDense (line 57) | ProjectionVectDense(const Space<dist_t>& space, size_t nDstDim) :
    class ProjectionRand (line 72) | class ProjectionRand : public Projection<dist_t> {
      method compProj (line 74) | virtual void compProj(const Query<dist_t>* pQuery,
      method ProjectionRand (line 103) | ProjectionRand(const Space<dist_t>& space, const ObjectVector& data,
    class ProjectionRandRefPoint (line 135) | class ProjectionRandRefPoint : public Projection<dist_t> {
      method compProj (line 137) | virtual void compProj(const Query<dist_t>* pQuery,
      method ProjectionRandRefPoint (line 149) | ProjectionRandRefPoint(const Space<dist_t>& space,
    class ProjectionPermutation (line 176) | class ProjectionPermutation : public Projection<dist_t> {
      method compProj (line 178) | virtual void compProj(const Query<dist_t>* pQuery,
      method ProjectionPermutation (line 198) | ProjectionPermutation(const Space<dist_t>& space,
    class ProjectionPermutationTrunc (line 211) | class ProjectionPermutationTrunc : public Projection<dist_t> {
      method compProj (line 213) | virtual void compProj(const Query<dist_t>* pQuery,
      method ProjectionPermutationTrunc (line 233) | ProjectionPermutationTrunc(const Space<dist_t>& space,
    class ProjectionPermutationBin (line 250) | class ProjectionPermutationBin : public Projection<dist_t> {
      method compProj (line 252) | virtual void compProj(const Query<dist_t>* pQuery,
      method ProjectionPermutationBin (line 273) | ProjectionPermutationBin(const Space<dist_t>& space,
    class ProjectionFastMap (line 298) | class ProjectionFastMap : public Projection<dist_t> {
      method compProj (line 300) | virtual void compProj(const Query<dist_t>* pQuery,
      method ProjectionFastMap (line 323) | ProjectionFastMap(const Space<dist_t>& space,
    class ProjectionNone (line 362) | class ProjectionNone : public Projection<dist_t> {
      method compProj (line 364) | virtual void compProj(const Query<dist_t>* pQuery,
      method ProjectionNone (line 390) | ProjectionNone(const Space<dist_t>& space, const ObjectVector& data,
    class Projection<float> (line 457) | class Projection<float>
    class Projection<double> (line 458) | class Projection<double>
    class Projection<int> (line 459) | class Projection<int>
    class ProjectionRand<float> (line 461) | class ProjectionRand<float>
    class ProjectionRand<double> (line 462) | class ProjectionRand<double>
    class ProjectionRand<int> (line 463) | class ProjectionRand<int>
    class ProjectionRandRefPoint<float> (line 465) | class ProjectionRandRefPoint<float>
    class ProjectionRandRefPoint<double> (line 466) | class ProjectionRandRefPoint<double>
    class ProjectionRandRefPoint<int> (line 467) | class ProjectionRandRefPoint<int>
    class ProjectionPermutation<float> (line 469) | class ProjectionPermutation<float>
    class ProjectionPermutation<double> (line 470) | class ProjectionPermutation<double>
    class ProjectionPermutation<int> (line 471) | class ProjectionPermutation<int>
    class ProjectionFastMap<float> (line 473) | class ProjectionFastMap<float>
    class ProjectionFastMap<double> (line 474) | class ProjectionFastMap<double>
    class ProjectionFastMap<int> (line 475) | class ProjectionFastMap<int>
    class ProjectionNone<float> (line 477) | class ProjectionNone<float>
    class ProjectionNone<double> (line 478) | class ProjectionNone<double>
    class ProjectionNone<int> (line 479) | class ProjectionNone<int>

FILE: algorithms/NMSLIB/code/src/query.cc
  type similarity (line 25) | namespace similarity {
    function Object (line 39) | const Object* Query<dist_t>::QueryObject() const {
    function dist_t (line 54) | dist_t Query<dist_t>::Distance(
    function dist_t (line 62) | dist_t Query<dist_t>::DistanceObjLeft(const Object* object) const {
    function dist_t (line 67) | dist_t Query<dist_t>::DistanceObjRight(const Object* object) const {
    class Query<float> (line 71) | class Query<float>
    class Query<double> (line 72) | class Query<double>
    class Query<int> (line 73) | class Query<int>
    class Query<short int> (line 74) | class Query<short int>

FILE: algorithms/NMSLIB/code/src/randproj_util.cc
  type similarity (line 27) | namespace similarity {
    function initRandProj (line 31) | void initRandProj(size_t nSrcDim, size_t nDstDim,
    function compRandProj (line 86) | void compRandProj(const vector<vector<dist_t>>& projMatr,

FILE: algorithms/NMSLIB/code/src/rangequery.cc
  type similarity (line 27) | namespace similarity {
    function ObjectVector (line 40) | const ObjectVector* RangeQuery<dist_t>::Result() const {
    function dist_t (line 54) | dist_t RangeQuery<dist_t>::Radius() const {
    class RangeQuery<float> (line 117) | class RangeQuery<float>
    class RangeQuery<double> (line 118) | class RangeQuery<double>
    class RangeQuery<int> (line 119) | class RangeQuery<int>
    class RangeQuery<short int> (line 120) | class RangeQuery<short int>

FILE: algorithms/NMSLIB/code/src/searchoracle.cc
  type similarity (line 27) | namespace similarity {
    class PolynomialPruner<int> (line 294) | class PolynomialPruner<int>
    class PolynomialPruner<float> (line 295) | class PolynomialPruner<float>
    class PolynomialPruner<double> (line 296) | class PolynomialPruner<double>

FILE: algorithms/NMSLIB/code/src/space.cc
  type similarity (line 19) | namespace similarity {
    class Space<int> (line 60) | class Space<int>
    class Space<float> (line 61) | class Space<float>
    class Space<double> (line 62) | class Space<double>

FILE: algorithms/NMSLIB/code/src/space/space_bit_hamming.cc
  type similarity (line 29) | namespace similarity {
    function Object (line 77) | Object* SpaceBitHamming::CreateObjFromBitMaskVect(IdType id, LabelType...
    function Object (line 117) | Object* SpaceBitHamming::CreateObjFromVectInternal(IdType id, LabelTyp...
    function string (line 142) | string SpaceBitHamming::CreateStrFromObj(const Object* pObj, const str...

FILE: algorithms/NMSLIB/code/src/space/space_bregman.cc
  type similarity (line 27) | namespace similarity {
    function Object (line 30) | Object* BregmanDiv<dist_t>::Mean(const ObjectVector& data) const {
    function dist_t (line 63) | dist_t KLDivAbstract<dist_t>::Function(const Object* object) const {
    function Object (line 76) | Object* KLDivAbstract<dist_t>::GradientFunction(const Object* object) ...
    function Object (line 91) | Object* KLDivAbstract<dist_t>::InverseGradientFunction(const Object* o...
    function Object (line 108) | Object* KLDivGenFast<dist_t>::Mean(const ObjectVector& data) const {
    function Object (line 123) | Object* KLDivGenFast<dist_t>::InverseGradientFunction(const Object* ob...
    function dist_t (line 134) | dist_t KLDivGenFast<dist_t>::HiddenDistance(const Object* obj1, const ...
    function Object (line 146) | Object* KLDivGenFast<dist_t>::CreateObjFromVect(IdType id, LabelType l...
    function Object (line 160) | Object* ItakuraSaitoFast<dist_t>::Mean(const ObjectVector& data) const {
    function dist_t (line 175) | dist_t ItakuraSaitoFast<dist_t>::Function(const Object* object) const {
    function Object (line 188) | Object* ItakuraSaitoFast<dist_t>::GradientFunction(const Object* objec...
    function Object (line 203) | Object* ItakuraSaitoFast<dist_t>::InverseGradientFunction(const Object...
    function dist_t (line 218) | dist_t ItakuraSaitoFast<dist_t>::HiddenDistance(const Object* obj1, co...
    function Object (line 230) | Object* ItakuraSaitoFast<dist_t>::CreateObjFromVect(IdType id, LabelTy...
    function dist_t (line 243) | dist_t KLDivGenSlow<dist_t>::HiddenDistance(const Object* obj1, const ...
    function Object (line 255) | Object* KLDivGenSlow<dist_t>::CreateObjFromVect(IdType id, LabelType l...
    function dist_t (line 260) | dist_t KLDivGenFastRightQuery<dist_t>::HiddenDistance(const Object* ob...
    function Object (line 272) | Object* KLDivGenFastRightQuery<dist_t>::CreateObjFromVect(IdType id, L...
    function dist_t (line 285) | dist_t KLDivFast<dist_t>::HiddenDistance(const Object* obj1, const Obj...
    function Object (line 297) | Object* KLDivFast<dist_t>::CreateObjFromVect(IdType id, LabelType labe...
    function dist_t (line 310) | dist_t KLDivFastRightQuery<dist_t>::HiddenDistance(const Object* obj1,...
    function Object (line 322) | Object* KLDivFastRightQuery<dist_t>::CreateObjFromVect(IdType id, Labe...
    class BregmanDiv<float> (line 332) | class BregmanDiv<float>
    class BregmanDiv<double> (line 333) | class BregmanDiv<double>
    class KLDivAbstract<float> (line 334) | class KLDivAbstract<float>
    class KLDivAbstract<double> (line 335) | class KLDivAbstract<double>
    class KLDivGenSlow<float> (line 336) | class KLDivGenSlow<float>
    class KLDivGenSlow<double> (line 337) | class KLDivGenSlow<double>
    class KLDivGenFast<float> (line 338) | class KLDivGenFast<float>
    class KLDivGenFast<double> (line 339) | class KLDivGenFast<double>
    class ItakuraSaitoFast<float> (line 340) | class ItakuraSaitoFast<float>
    class ItakuraSaitoFast<double> (line 341) | class ItakuraSaitoFast<double>
    class KLDivGenFastRightQuery<float> (line 342) | class KLDivGenFastRightQuery<float>
    class KLDivGenFastRightQuery<double> (line 343) | class KLDivGenFastRightQuery<double>
    class KLDivFast<float> (line 344) | class KLDivFast<float>
    class KLDivFast<double> (line 345) | class KLDivFast<double>
    class KLDivFastRightQuery<float> (line 346) | class KLDivFastRightQuery<float>
    class KLDivFastRightQuery<double> (line 347) | class KLDivFastRightQuery<double>

FILE: algorithms/NMSLIB/code/src/space/space_dummy.cc
  type similarity (line 25) | namespace similarity {
    function dist_t (line 28) | dist_t SpaceDummy<dist_t>::HiddenDistance(const Object* obj1, const Ob...
    function string (line 65) | string SpaceDummy<dist_t>::CreateStrFromObj(const Object* pObj, const ...
    class SpaceDummy<int> (line 92) | class SpaceDummy<int>
    class SpaceDummy<float> (line 93) | class SpaceDummy<float>
    class SpaceDummy<double> (line 94) | class SpaceDummy<double>

FILE: algorithms/NMSLIB/code/src/space/space_js.cc
  type similarity (line 27) | namespace similarity {
    function Object (line 30) | Object* SpaceJSBase<dist_t>::CreateObjFromVect(IdType id, LabelType la...
    function dist_t (line 45) | dist_t SpaceJSBase<dist_t>::JensenShannonFunc(const Object* obj1, cons...
    class SpaceJSBase<float> (line 70) | class SpaceJSBase<float>
    class SpaceJSBase<double> (line 71) | class SpaceJSBase<double>
    class SpaceJSDiv<float> (line 73) | class SpaceJSDiv<float>
    class SpaceJSDiv<double> (line 74) | class SpaceJSDiv<double>
    class SpaceJSMetric<float> (line 76) | class SpaceJSMetric<float>
    class SpaceJSMetric<double> (line 77) | class SpaceJSMetric<double>

FILE: algorithms/NMSLIB/code/src/space/space_lp.cc
  type similarity (line 26) | namespace similarity {
    function dist_t (line 29) | dist_t SpaceLp<dist_t>::HiddenDistance(const Object* obj1, const Objec...
    class SpaceLp<float> (line 46) | class SpaceLp<float>
    class SpaceLp<double> (line 47) | class SpaceLp<double>

FILE: algorithms/NMSLIB/code/src/space/space_scalar.cc
  type similarity (line 26) | namespace similarity {
    function dist_t (line 29) | dist_t SpaceCosineSimilarity<dist_t>::HiddenDistance(const Object* obj...
    class SpaceCosineSimilarity<float> (line 42) | class SpaceCosineSimilarity<float>
    class SpaceCosineSimilarity<double> (line 43) | class SpaceCosineSimilarity<double>
    function dist_t (line 46) | dist_t SpaceAngularDistance<dist_t>::HiddenDistance(const Object* obj1...
    class SpaceAngularDistance<float> (line 59) | class SpaceAngularDistance<float>
    class SpaceAngularDistance<double> (line 60) | class SpaceAngularDistance<double>

FILE: algorithms/NMSLIB/code/src/space/space_sparse_lp.cc
  type similarity (line 28) | namespace similarity {
    function dist_t (line 31) | dist_t SpaceSparseLp<dist_t>::HiddenDistance(const Object* obj1, const...
    class SpaceSparseLp<float> (line 42) | class SpaceSparseLp<float>
    class SpaceSparseLp<double> (line 43) | class SpaceSparseLp<double>

FILE: algorithms/NMSLIB/code/src/space/space_sparse_scalar_fast.cc
  type similarity (line 30) | namespace similarity {

FILE: algorithms/NMSLIB/code/src/space/space_sparse_vector.cc
  type similarity (line 31) | namespace similarity {
    function string (line 121) | string SpaceSparseVector<dist_t>::CreateStrFromObj(const Object* pObj,...
    class SpaceSparseVector<float> (line 158) | class SpaceSparseVector<float>
    class SpaceSparseVector<double> (line 159) | class SpaceSparseVector<double>
    class SpaceSparseVectorSimpleStorage<float> (line 161) | class SpaceSparseVectorSimpleStorage<float>
    class SpaceSparseVectorSimpleStorage<double> (line 162) | class SpaceSparseVectorSimpleStorage<double>

FILE: algorithms/NMSLIB/code/src/space/space_sparse_vector_inter.cc
  type similarity (line 28) | namespace similarity {
    function Object (line 54) | Object* SpaceSparseVectorInter<dist_t>::CreateObjFromVect(IdType id, L...
    class SpaceSparseVectorInter<float> (line 67) | class SpaceSparseVectorInter<float>
    class SpaceSparseVectorInter<double> (line 68) | class SpaceSparseVectorInter<double>

FILE: algorithms/NMSLIB/code/src/space/space_sqfd.cc
  type similarity (line 34) | namespace similarity {
    type DataFileInputStateSQFD (line 51) | struct DataFileInputStateSQFD : public DataFileInputStateOneFile {
      method DataFileInputStateSQFD (line 52) | DataFileInputStateSQFD(const string& inpFileName) :
    function string (line 133) | string SpaceSqfd<dist_t>::CreateStrFromObj(const Object* pObj, const s...
    function dist_t (line 283) | dist_t SpaceSqfd<dist_t>::HiddenDistance(
    function string (line 335) | string SpaceSqfd<dist_t>::StrDesc() const {
    class SpaceSqfd<float> (line 341) | class SpaceSqfd<float>
    class SpaceSqfd<double> (line 342) | class SpaceSqfd<double>

FILE: algorithms/NMSLIB/code/src/space/space_string.cc
  type similarity (line 28) | namespace similarity {
    function string (line 65) | string StringSpace<dist_t>::CreateStrFromObj(const Object* pObj, const...
    class StringSpace<int> (line 94) | class StringSpace<int>
    class StringSpace<float> (line 96) | class StringSpace<float>
    class StringSpace<double> (line 97) | class StringSpace<double>

FILE: algorithms/NMSLIB/code/src/space/space_vector.cc
  type similarity (line 33) | namespace similarity {
    function string (line 95) | string VectorSpace<dist_t>::CreateStrFromObj(const Object* pObj, const...
    function Object (line 148) | Object* VectorSpace<dist_t>::CreateObjFromVect(IdType id, LabelType la...
    class VectorSpace<PivotIdType> (line 156) | class VectorSpace<PivotIdType>
    class VectorSpace<float> (line 157) | class VectorSpace<float>
    class VectorSpace<double> (line 158) | class VectorSpace<double>

FILE: algorithms/NMSLIB/code/src/space/space_word_embed.cc
  type similarity (line 34) | namespace similarity {
    function string (line 41) | string WordEmbedSpace<dist_t>::CreateStrFromObj(const Object* pObj, co...
    function string (line 76) | string WordEmbedSpace<dist_t>::StrDesc() const {
    function dist_t (line 90) | dist_t WordEmbedSpace<dist_t>::HiddenDistance(const Object* obj1, cons...
    class WordEmbedSpace<float> (line 108) | class WordEmbedSpace<float>
    class WordEmbedSpace<double> (line 109) | class WordEmbedSpace<double>

FILE: algorithms/NMSLIB/code/src/tune_vptree.cc
  function Usage (line 66) | static void Usage(const char *prog,
  function RunExper (line 73) | void RunExper(unsigned AddRestartQty,
  function ParseCommandLineForTuning (line 272) | void ParseCommandLineForTuning(int argc, char*argv[],
  function main (line 417) | int main(int ac, char* av[]) {

FILE: algorithms/NMSLIB/code/src/utils.cc
  type similarity (line 41) | namespace similarity {
    function DoesFileExist (line 53) | bool DoesFileExist(const char *filename) {
    function RStrip (line 61) | void RStrip(char* str) {
    function Mean (line 68) | double Mean(const double* array, const unsigned size) {
    function Variance (line 75) | double Variance(const double* array, const unsigned size, const double...
    function Variance (line 85) | double Variance(const double* array, const unsigned size) {
    function StdDev (line 89) | double StdDev(const double* array, const unsigned size) {
    function ApproxEqualOther (line 137) | inline bool ApproxEqualOther(const T& x, const T& y, unsigned maxUlps) {

FILE: algorithms/NMSLIB/code/test/bench_distfunc.cc
  type similarity (line 44) | namespace similarity {
    function Normalize (line 51) | inline void Normalize(T* pVect, size_t qty) {
    function GenRandVect (line 65) | inline void GenRandVect(T* pVect, size_t qty, T MinElem = T(0), T MaxE...
    function GenRandIntVect (line 78) | inline void GenRandIntVect(int* pVect, size_t qty) {
    function SetRandZeros (line 85) | inline void SetRandZeros(T* pVect, size_t qty, double pZero) {
    function GenSparseVectZipf (line 111) | void GenSparseVectZipf(size_t maxSize, vector<SparseVectElem<dist_t>>&...
    function TestLInfNormStandard (line 125) | void TestLInfNormStandard(size_t N, size_t dim, size_t Rep) {
    function TestLInfNorm (line 162) | void TestLInfNorm(size_t N, size_t dim, size_t Rep) {
    function TestLInfNormSIMD (line 199) | void TestLInfNormSIMD(size_t N, size_t dim, size_t Rep) {
    function TestL1NormStandard (line 237) | void TestL1NormStandard(size_t N, size_t dim, size_t Rep) {
    function TestL1Norm (line 274) | void TestL1Norm(size_t N, size_t dim, size_t Rep) {
    function TestL1NormSIMD (line 311) | void TestL1NormSIMD(size_t N, size_t dim, size_t Rep) {
    function TestL2NormStandard (line 348) | void TestL2NormStandard(size_t N, size_t dim, size_t Rep) {
    function TestL2Norm (line 385) | void TestL2Norm(size_t N, size_t dim, size_t Rep) {
    function TestL2NormSIMD (line 422) | void TestL2NormSIMD(size_t N, size_t dim, size_t Rep) {
    function TestLPGeneric (line 460) | void TestLPGeneric(size_t N, size_t dim, size_t Rep, T power) {
    function TestLPGenericOptim (line 498) | void TestLPGenericOptim(size_t N, size_t dim, size_t Rep, T power) {
    function TestItakuraSaitoPrecomp (line 536) | void TestItakuraSaitoPrecomp(size_t N, size_t dim, size_t Rep) {
    function TestItakuraSaitoPrecompSIMD (line 575) | void TestItakuraSaitoPrecompSIMD(size_t N, size_t dim, size_t Rep) {
    function TestItakuraSaitoStandard (line 614) | void TestItakuraSaitoStandard(size_t N, size_t dim, size_t Rep) {
    function TestKLPrecomp (line 653) | void TestKLPrecomp(size_t N, size_t dim, size_t Rep) {
    function TestKLPrecompSIMD (line 692) | void TestKLPrecompSIMD(size_t N, size_t dim, size_t Rep) {
    function TestKLStandard (line 731) | void TestKLStandard(size_t N, size_t dim, size_t Rep) {
    function TestKLGeneralPrecomp (line 770) | void TestKLGeneralPrecomp(size_t N, size_t dim, size_t Rep) {
    function TestKLGeneralPrecompSIMD (line 809) | void TestKLGeneralPrecompSIMD(size_t N, size_t dim, size_t Rep) {
    function TestKLGeneralStandard (line 848) | void TestKLGeneralStandard(size_t N, size_t dim, size_t Rep) {
    function TestJSStandard (line 886) | void TestJSStandard(size_t N, size_t dim, size_t Rep, float pZero) {
    function TestJSPrecomp (line 926) | void TestJSPrecomp(size_t N, size_t dim, size_t Rep, float pZero) {
    function TestJSPrecompApproxLog (line 966) | void TestJSPrecompApproxLog(size_t N, size_t dim, size_t Rep, float pZ...
    function TestJSPrecompSIMDApproxLog (line 1006) | void TestJSPrecompSIMDApproxLog(size_t N, size_t dim, size_t Rep, floa...
    function TestSpearmanRho (line 1045) | void TestSpearmanRho(size_t N, size_t dim, size_t Rep) {
    function TestSpearmanRhoSIMD (line 1082) | void TestSpearmanRhoSIMD(size_t N, size_t dim, size_t Rep) {
    function TestSpearmanFootrule (line 1119) | void TestSpearmanFootrule(size_t N, size_t dim, size_t Rep) {
    function TestSpearmanFootruleSIMD (line 1156) | void TestSpearmanFootruleSIMD(size_t N, size_t dim, size_t Rep) {
    function TestSQFDGeneric (line 1196) | void TestSQFDGeneric(size_t N, size_t Rep, SqfdFunction<T>& func) {
    function TestSQFDMinus (line 1237) | void TestSQFDMinus(size_t N, size_t Rep) {
    function TestSQFDHeuristic (line 1243) | void TestSQFDHeuristic(size_t N, size_t Rep) {
    function TestSQFDGaussian (line 1249) | void TestSQFDGaussian(size_t N, size_t Rep) {
    function TestLevenshtein (line 1256) | void TestLevenshtein(size_t N, size_t Rep) {
    function TestSparseLp (line 1295) | void TestSparseLp(size_t N, size_t Rep, T power) {
    function TestSparseAngularDistance (line 1334) | void TestSparseAngularDistance(const string& dataFile, size_t N, size_...
    function TestSparseCosineSimilarityFast (line 1373) | void TestSparseCosineSimilarityFast(const string& dataFile, size_t N, ...
    function TestSparseAngularDistanceFast (line 1414) | void TestSparseAngularDistanceFast(const string& dataFile, size_t N, s...
    function TestSparseCosineSimilarity (line 1457) | void TestSparseCosineSimilarity(const string& dataFile, size_t N, size...
    function TestScalarProduct (line 1497) | void TestScalarProduct(size_t N, size_t dim, size_t Rep) {
    function TestScalarProductSIMD (line 1534) | void TestScalarProductSIMD(size_t N, size_t dim, size_t Rep) {
    function TestNormScalarProduct (line 1571) | void TestNormScalarProduct(size_t N, size_t dim, size_t Rep) {
    function TestNormScalarProductSIMD (line 1608) | void TestNormScalarProductSIMD(size_t N, size_t dim, size_t Rep) {
    function TestCosineSimilarity (line 1645) | void TestCosineSimilarity(size_t N, size_t dim, size_t Rep) {
    function TestAngularDistance (line 1682) | void TestAngularDistance(size_t N, size_t dim, size_t Rep) {
    function TestBitHamming (line 1718) | void TestBitHamming(size_t N, size_t dim, size_t Rep) {
  function main (line 1767) | int main(int argc, char* argv[]) {

FILE: algorithms/NMSLIB/code/test/bench_projection.cc
  function Usage (line 34) | static void Usage(const char *prog,
  function benchProjection (line 41) | void benchProjection(size_t repeatQty,
  function main (line 194) | int main(int argc, char *argv[]) {

FILE: algorithms/NMSLIB/code/test/bunit.cc
  type similarity (line 24) | namespace similarity {
    function TestRunner (line 26) | TestRunner& TestRunner::Instance() {
  function main (line 92) | int main(int argc, char *argv[]) {

FILE: algorithms/NMSLIB/code/test/bunit.h
  function namespace (line 34) | namespace similarity {

FILE: algorithms/NMSLIB/code/test/genrand_vect.h
  function namespace (line 21) | namespace similarity {
  function GenRandIntVect (line 51) | inline void GenRandIntVect(int* pVect, size_t qty) {
  function SetRandZeros (line 58) | void SetRandZeros(T* pVect, size_t qty, double pZero) {

FILE: algorithms/NMSLIB/code/test/report_intr_dim.cc
  function Usage (line 35) | static void Usage(const char *prog,
  function ComputeMuDeffect (line 42) | void ComputeMuDeffect(const Space<dist_t>& space,
  function TestSpace (line 83) | void TestSpace(
  function main (line 118) | int main(int argc, char* argv[]) {

FILE: algorithms/NMSLIB/code/test/test_clust.cc
  function Usage (line 88) | static void Usage(const char *prog,
  function RunExper (line 95) | void RunExper(
  function ParseCommandLineForClustering (line 152) | void ParseCommandLineForClustering(int argc, char*argv[],
  function main (line 238) | int main(int argc, char* argv[]) {

FILE: algorithms/NMSLIB/code/test/test_distfunc.cc
  function TEST (line 65) | TEST(Platform64) {
  function checkElemVectEq (line 70) | bool checkElemVectEq(const vector<SparseVectElem<dist_t>>& source,
  function TestSparsePackUnpack (line 81) | void TestSparsePackUnpack() {
  function TEST (line 116) | TEST(BlockZeros) {
  function TEST (line 128) | TEST(SparsePackUnpack) {
  function TEST (line 134) | TEST(TestEfficientPower) {
  function TEST (line 145) | TEST(TestEfficientFract) {
  function TestScalarProductAgree (line 164) | bool TestScalarProductAgree(size_t N, size_t dim, size_t Rep) {
  function TestNormScalarProductAgree (line 196) | bool TestNormScalarProductAgree(size_t N, size_t dim, size_t Rep) {
  function TestLInfAgree (line 229) | bool TestLInfAgree(size_t N, size_t dim, size_t Rep) {
  function TestL1Agree (line 262) | bool TestL1Agree(size_t N, size_t dim, size_t Rep) {
  function TestL2Agree (line 294) | bool TestL2Agree(size_t N, size_t dim, size_t Rep) {
  function TestItakuraSaitoAgree (line 327) | bool TestItakuraSaitoAgree(size_t N, size_t dim, size_t Rep) {
  function TestKLAgree (line 376) | bool TestKLAgree(size_t N, size_t dim, size_t Rep) {
  function TestKLGeneralAgree (line 438) | bool TestKLGeneralAgree(size_t N, size_t dim, size_t Rep) {
  function TestJSAgree (line 484) | bool TestJSAgree(size_t N, size_t dim, size_t Rep, double pZero) {
  function TestSpearmanFootruleAgree (line 558) | bool TestSpearmanFootruleAgree(size_t N, size_t dim, size_t Rep) {
  function TestSpearmanRhoAgree (line 587) | bool TestSpearmanRhoAgree(size_t N, size_t dim, size_t Rep) {
  function TestLPGenericAgree (line 617) | bool TestLPGenericAgree(size_t N, size_t dim, size_t Rep, T power) {
  function TestBitHammingAgree (line 673) | bool TestBitHammingAgree(size_t N, size_t dim, size_t Rep) {
  function TestSparseAngularDistanceAgree (line 718) | bool TestSparseAngularDistanceAgree(const string& dataFile, size_t N, si...
  function TestSparseCosineSimilarityAgree (line 767) | bool TestSparseCosineSimilarityAgree(const string& dataFile, size_t N, s...
  function TEST (line 815) | TEST(DISABLE_TestAgree) {

FILE: algorithms/NMSLIB/code/test/test_editdist.cc
  type similarity (line 24) | namespace similarity {
    class ShortStringDataSet (line 37) | class ShortStringDataSet : public TestDataset {
      method ShortStringDataSet (line 39) | ShortStringDataSet(SpaceLevenshtein& space) {
    function TEST (line 48) | TEST(EditDistanceShort) {
    class LongStringDataSet (line 93) | class LongStringDataSet : public TestDataset {
      method LongStringDataSet (line 95) | LongStringDataSet(SpaceLevenshtein& space) {
    function TEST (line 106) | TEST(EditDistanceLong) {

FILE: algorithms/NMSLIB/code/test/test_eval.cc
  type similarity (line 28) | namespace similarity {
    function testMetric (line 31) | void testMetric(
    function TEST (line 67) | TEST(TestRecallDouble) {
    function TEST (line 101) | TEST(TestRecallFloat) {
    function TEST (line 134) | TEST(TestRecallInt) {
    function TEST (line 167) | TEST(TestNumCloserDouble) {
    function TEST (line 200) | TEST(TestNumCloserFloat) {
    function TEST (line 233) | TEST(TestNumCloserInt) {
    function TEST (line 266) | TEST(TestRelPosErrorDouble) {
    function TEST (line 302) | TEST(TestRelPosErrorFloat) {
    function TEST (line 338) | TEST(TestRelPosErrorInt) {
    function TEST (line 371) | TEST(TestPrecisionOfApproxDouble) {
    function TEST (line 404) | TEST(TestPrecisionOfApproxFloat) {
    function TEST (line 437) | TEST(TestPrecisionOfApproxInt) {
    function testResultEntryIO (line 468) | void testResultEntryIO(string fileName, const vector<ResultEntry<dist_...
    function TEST (line 492) | TEST(TestResultEntryIntIO) {
    function TEST (line 503) | TEST(TestResultEntryFloatIO) {
    function TEST (line 513) | TEST(TestResultEntryDoubleIO) {

FILE: algorithms/NMSLIB/code/test/test_fp.cc
  type similarity (line 25) | namespace similarity {
    function testEqualInt (line 28) | void testEqualInt(dist_t num1, dist_t num2) {
    function testNotEqualInt (line 33) | void testNotEqualInt(dist_t num1, dist_t num2) {
    function testEqualFP (line 38) | void testEqualFP(dist_t baseNum, float epsFact) {
    function testNotEqualFP (line 44) | void testNotEqualFP(dist_t baseNum, float epsFact) {
    function TEST (line 49) | TEST(FP_Char1) {
    function TEST (line 53) | TEST(FP_Char2) {
    function TEST (line 57) | TEST(FP_Char3) {
    function TEST (line 61) | TEST(FP_Char4) {
    function TEST (line 65) | TEST(FP_Short1) {
    function TEST (line 69) | TEST(FP_Short2) {
    function TEST (line 73) | TEST(FP_Short3) {
    function TEST (line 77) | TEST(FP_Short4) {
    function TEST (line 81) | TEST(FP_Int1) {
    function TEST (line 85) | TEST(FP_Int2) {
    function TEST (line 89) | TEST(FP_Int3) {
    function TEST (line 93) | TEST(FP_Int4) {
    function TEST (line 97) | TEST(FP_Unsigned1) {
    function TEST (line 101) | TEST(FP_Unsigned2) {
    function TEST (line 105) | TEST(FP_Unsigned3) {
    function TEST (line 109) | TEST(FP_Float1) {
    function TEST (line 116) | TEST(FP_Float2) {
    function TEST (line 122) | TEST(FP_Float3) {
    function TEST (line 128) | TEST(FP_Float4) {
    function TEST (line 132) | TEST(FP_Float5) {
    function TEST (line 136) | TEST(FP_Double1) {
    function TEST (line 143) | TEST(FP_Double2) {
    function TEST (line 149) | TEST(FP_Double3) {
    function TEST (line 155) | TEST(FP_Double4) {
    function TEST (line 159) | TEST(FP_Double5) {
    function TEST (line 163) | TEST(FP_LongDouble1) {
    function TEST (line 169) | TEST(FP_LongDouble2) {
    function TEST (line 175) | TEST(FP_LongDouble3) {
    function TEST (line 181) | TEST(FP_LongDouble4) {
    function TEST (line 187) | TEST(FP_NANFloat) {
    function TEST (line 193) | TEST(FP_NANDouble) {
    function TEST (line 199) | TEST(FP_NANLongDouble) {
    function TEST (line 205) | TEST(FP_ZEROFloat) {
    function TEST (line 215) | TEST(FP_ZERODouble) {
    function TEST (line 225) | TEST(FP_ZEROLongDouble) {

FILE: algorithms/NMSLIB/code/test/test_integr.cc
  function main (line 293) | int main(int ac, char* av[]) {

FILE: algorithms/NMSLIB/code/test/test_integr_util.h
  type MethodTestCase (line 47) | struct MethodTestCase {
  function string (line 191) | inline string getFirstParam(const string& paramDef) {
  function string (line 205) | inline string quoteEmpty(const string& str) {
  function string (line 209) | string CreateCmdStr(
  function RunOneTest (line 503) | inline bool RunOneTest(const vector<MethodTestCase>& vTestCases,

FILE: algorithms/NMSLIB/code/test/test_lpnorm.cc
  type similarity (line 23) | namespace similarity {
    class VectorDataset1 (line 27) | class VectorDataset1 : public TestDataset {
      method VectorDataset1 (line 29) | VectorDataset1() {
    function TEST (line 48) | TEST(EuclideanDistance) {
    function TEST (line 72) | TEST(ManhattanDistance) {
    function TEST (line 96) | TEST(ChebyshevDistance) {

FILE: algorithms/NMSLIB/code/test/test_object.cc
  type similarity (line 25) | namespace similarity {
    function TEST (line 27) | TEST(Object) {
    function TEST (line 49) | TEST(ExtractLabel) {
    function TEST (line 74) | TEST(AddLabel) {

FILE: algorithms/NMSLIB/code/test/test_proj.cc
  type similarity (line 22) | namespace similarity {
    function TestRandProj (line 27) | bool TestRandProj(size_t srcDim, size_t dstDim, size_t rep, dist_t eps) {
    function TEST (line 58) | TEST(TestRandProj) {

FILE: algorithms/NMSLIB/code/test/test_space_serial.cc
  type similarity (line 42) | namespace similarity {
    function fullTestCommon (line 47) | bool fullTestCommon(Space<dist_t>* pSpace, const ObjectVector& dataSet...
    function fullTest (line 88) | bool fullTest(const string& dataSetFileName, size_t maxNumRec, const s...
    function fullTest (line 116) | bool fullTest(const vector<string>& dataSetStr, size_t maxNumRec, cons...
    function TEST (line 154) | TEST(Test_WordEmbedSpace) {
    function TEST (line 163) | TEST(Test_DenseVectorSpace) {
    function TEST (line 170) | TEST(Test_DenseVectorKLDiv) {
    function TEST (line 180) | TEST(Test_SparseVectorSpace) {
    function TEST (line 189) | TEST(Test_SparseVectorSpaceFast) {
    function TEST (line 196) | TEST(Test_StringSpace) {
    function TEST (line 202) | TEST(Test_BitHamming) {
    function TEST (line 220) | TEST(Test_SFQD) {

FILE: algorithms/NMSLIB/code/test/test_sqfd.cc
  type similarity (line 25) | namespace similarity {
    function Object (line 27) | Object* CreateSqfdObject(
    function TEST (line 48) | TEST(Sqfd_From_Article) {
    function TEST (line 81) | TEST(Sqfd) {

FILE: algorithms/NMSLIB/code/test/test_timer.cc
  class WallClockTimerBannister (line 33) | class WallClockTimerBannister {
    type timeval (line 35) | struct timeval
    method WallClockTimerBannister (line 36) | WallClockTimerBannister() :
    method reset (line 41) | void reset() {
    method elapsed (line 45) | uint64_t elapsed() {
    method split (line 48) | uint64_t split() {
  function BurnCPU (line 54) | void BurnCPU(size_t qty = 10000000000) {
  function TEST (line 64) | TEST(DISABLE_TestTimer) {

FILE: algorithms/NMSLIB/code/test/testdataset.h
  function namespace (line 25) | namespace similarity {

FILE: algorithms/NSH/src/NSH.cpp
  function diff_timeval (line 37) | float diff_timeval(timeval t1, timeval t2) {
  function main (line 41) | int main(int argc, char * argv[]) {

FILE: algorithms/NSH/src/NSH.h
  function class (line 27) | class NSH

FILE: algorithms/NSH/src/center_chooser.h
  function class (line 5) | class CenterChooser

FILE: algorithms/NSH/src/data_util.h
  function transpose (line 21) | void transpose(vector<vector<float> > X,vector<vector<float> >* Y)
  function ReadPoints (line 37) | void ReadPoints(char* filepath,vector<vector<float> >* points, int* len,...
  function ReadGroundtruth (line 61) | void ReadGroundtruth(char* filepath, vector<vector<int> >* gnds, int* le...
  function ReadB1 (line 85) | void ReadB1(const string& filename, vector<vector<unsigned> >* B1,int n)...
  function ReadChecks (line 108) | void ReadChecks(const string& filename, vector<int>* checks) {

FILE: algorithms/NSH/src/dynamic_bitset.h
  function class (line 3) | class DynamicBitset
  function clear (line 17) | void clear()
  function reset (line 22) | void reset()
  function resize (line 28) | void resize(size_t size)
  function set (line 38) | void set(size_t index)
  function test (line 47) | bool test(size_t index) const

FILE: algorithms/NSH/src/eval.h
  function compute_recall (line 28) | float compute_recall(vector<vector<int> >* gnds, vector<vector<int> >* r...
  function compute_mean_reciprocal_rank (line 45) | float compute_mean_reciprocal_rank(vector<vector<int> >* gnds, vector<ve...
  function compute_number_closer (line 66) | float compute_number_closer(vector<vector<int> >* gnds, vector<vector<in...
  function compute_relative_distance_error (line 90) | float compute_relative_distance_error(vector<vector<float> >* points, ve...
  function compute_mean_average_precision (line 118) | float compute_mean_average_precision (vector<vector<int> >* gnds, vector...
  function compute_discounted_culmulative_gain (line 146) | float compute_discounted_culmulative_gain (vector<vector<int> >* gnds, v...
  function compute_recall (line 172) | float compute_recall(vector<vector<int> >* gnds, vector<vector<E_Neighbo...
  function compute_mean_reciprocal_rank (line 190) | float compute_mean_reciprocal_rank(vector<vector<int> >* gnds, vector<ve...
  function compute_number_closer (line 211) | float compute_number_closer(vector<vector<int> >* gnds, vector<vector<E_...
  function compute_relative_distance_error (line 235) | float compute_relative_distance_error(vector<vector<float> >* points, ve...
  function compute_mean_average_precision (line 261) | float compute_mean_average_precision (vector<vector<int> >* gnds, vector...
  function compute_discounted_culmulative_gain (line 289) | float compute_discounted_culmulative_gain (vector<vector<int> >* gnds, v...

FILE: algorithms/NSH/src/hammingDist.h
  type B_Neighbor (line 29) | struct B_Neighbor{
  type E_Neighbor (line 40) | struct E_Neighbor{
  function get_distance (line 50) | float get_distance(vector<float> point, vector<float> query)
  function get_distance (line 61) | int get_distance(const vector<unsigned>* p1, const vector<unsigned>* p2)
  function hammingDist (line 73) | void hammingDist(vector<vector<unsigned> >* B2,vector<vector<unsigned> >...
  function UpdatePriorityList_Binary (line 96) | void UpdatePriorityList_Binary (B_Neighbor *BList, B_Neighbor tmp, int l...
  function hammingDist (line 116) | void hammingDist(vector<vector<unsigned> >* B2,vector<vector<unsigned> >...
  function hammingDist_ByRange (line 151) | void hammingDist_ByRange(vector<vector<unsigned> >* B2,vector<vector<uns...
  function UpdatePriorityList_Euclidean (line 176) | void UpdatePriorityList_Euclidean (E_Neighbor *BList, E_Neighbor tmp, in...

FILE: algorithms/NSH/src/heap.h
  function size (line 42) | int size()
  function empty (line 52) | bool empty()
  function clear (line 60) | void clear()
  type CompareT (line 66) | struct CompareT
  function const (line 68) | bool operator()(const T& t_1, const T& t_2) const
  function insert (line 83) | void insert(const T& value)
  function popMin (line 105) | bool popMin(T& value)
  type Interval (line 125) | struct Interval
  function size (line 155) | size_t size()
  function empty (line 164) | bool empty()
  function clear (line 172) | void clear()
  function insert (line 177) | void insert(const T& value)
  function popMin (line 251) | bool popMin(T& value)
  function popMax (line 296) | bool popMax(T& value)
  function getMin (line 336) | bool getMin(T& value)
  function getMax (line 346) | bool getMax(T& value)
  function size (line 371) | int size()
  function empty (line 380) | bool empty()
  function clear (line 388) | void clear()
  function insert (line 393) | void insert(const T& value)
  function popMin (line 404) | bool popMin(T& value)

FILE: algorithms/NSH/src/hierarchical_clustering_index.h
  function class (line 23) | class HierarchicalClusteringIndex
  type Node (line 118) | typedef Node* NodePtr;
  type BranchStruct (line 119) | struct BranchStruct
  function get_distance (line 135) | int get_distance(int p1, int p2)
  function get_distance (line 148) | int get_distance(const vector<unsigned>* p1, const vector<unsigned>* p2)
  function computeLabels (line 161) | void computeLabels(int* indices, int indices_length,  int* centers, int ...
  function computeClustering (line 176) | void computeClustering(Node* node, int* indices, int indices_length)
  type BranchStruct (line 232) | typedef BranchStruct BranchSt;
  function findNN (line 234) | void findNN(NodePtr node, ResultSet& result, const vector<unsigned>* vec...
  function findNeighborsWithRemoved (line 275) | void findNeighborsWithRemoved(ResultSet& result, const vector<unsigned>*...
  function knnSearch (line 300) | int knnSearch(const vector<vector<unsigned> >& queries, vector< vector<i...

FILE: algorithms/NSH/src/random.h
  function seed_random (line 39) | inline void seed_random(unsigned int seed)
  function class (line 70) | class RandomGenerator
  function class (line 81) | class UniqueRandom
  function init (line 102) | void init(int n)
  function next (line 121) | int next()

FILE: algorithms/NSH/src/result_set.h
  type DistanceIndex (line 9) | struct DistanceIndex
  function class (line 24) | class ResultSet
  function clear (line 44) | void clear()
  function full (line 64) | bool full()
  function addPoint (line 75) | void addPoint(int dist, int index)
  function copy (line 108) | void copy(vector<int>* indices, vector<int>* dists, size_t num_elements)

FILE: algorithms/OPQ/src/data_util.cpp
  function Distance (line 5) | Distance Eucldistance(const Point& x, const Point& y) {
  function Distance (line 15) | Distance Eucldistance(const Point& x, const Point& y,
  function GetSubpoints (line 26) | void GetSubpoints(const Points& points,
  function ClusterId (line 42) | ClusterId GetNearestClusterId(const Point& point,
  function GetResidual (line 62) | void GetResidual(const Point& point, const CoarseQuantization& coarse_qu...
  function GetResidual (line 74) | void GetResidual(const Point& point, const CoarseQuantization& coarse_qu...
  function GetNearestClusterIdsForPointSubset (line 85) | void GetNearestClusterIdsForPointSubset(const Points& points, const Cent...
  function GetNearestClusterIdsForSubpoints (line 101) | void GetNearestClusterIdsForSubpoints(const Points& points, const Centro...
  function GetPointsCoarseQuaintizations (line 122) | void GetPointsCoarseQuaintizations(const Points& points,

FILE: algorithms/OPQ/src/data_util.h
  type Coord (line 37) | typedef float Coord;
  type Distance (line 42) | typedef float Distance;
  type Dimensions (line 47) | typedef int Dimensions;
  type PointId (line 52) | typedef int PointId;
  type ClusterId (line 57) | typedef int ClusterId;
  type vector (line 62) | typedef vector<Coord> Point;
  type vector (line 67) | typedef vector<Point> Points;
  type vector (line 72) | typedef vector<PointId> PointIds;
  type set (line 77) | typedef set<PointId> SetPoints;
  type vector (line 82) | typedef vector<ClusterId> ClusterIds;
  type vector (line 88) | typedef vector<ClusterId> CoarseQuantization;
  type FineClusterId (line 93) | typedef unsigned char FineClusterId;
  type vector (line 98) | typedef vector<FineClusterId> FineQuantization;
  type vector (line 104) | typedef vector<SetPoints> ClustersToPoints;
  type std (line 110) | typedef std::vector<ClusterId> PointsToClusters;
  type std (line 115) | typedef std::vector<Point> Centroids;
  type PointType (line 121) | enum PointType {
  type RerankMode (line 131) | enum RerankMode {
  type IndexConfig (line 405) | struct IndexConfig {
  type RerankADC8 (line 414) | struct RerankADC8 {
  type RerankADC16 (line 428) | struct RerankADC16 {

FILE: algorithms/OPQ/src/indexer.h
  type PointType (line 43) | enum PointType
  function GetRecord (line 240) | void GetRecord(const Point& point, const PointId pid,
  function GetRecord (line 680) | inline void GetRecord<PointId> (const Point& point, const PointId pid,
  function FillAdcInfo (line 687) | inline void FillAdcInfo(const Point& point, const PointId pid,
  function RerankADC8 (line 702) | inline void GetRecord<RerankADC8> (const Point& point, const PointId pid,
  function RerankADC16 (line 718) | inline void GetRecord<RerankADC16> (const Point& point, const PointId pid,

FILE: algorithms/OPQ/src/indexer_launcher.cpp
  function SetOptions (line 69) | int SetOptions(int argc, char** argv) {
  function diff_timeval (line 137) | float diff_timeval(timeval t1, timeval t2) {
  function main (line 141) | int main(int argc, char** argv) {

FILE: algorithms/OPQ/src/multitable.hpp
  type Multitable (line 15) | struct Multitable {
    method serialize (line 49) | void serialize(Archive& arc, unsigned int version) {
  function T (line 96) | T Multitable<T>::GetValue(const vector<int>& indices) {

FILE: algorithms/OPQ/src/ordered_lists_merger.h
  type vector (line 12) | typedef vector<int> MergedItemIndices;

FILE: algorithms/OPQ/src/perfomance_util.cpp
  function GetRecallAt (line 72) | int GetRecallAt(const int length, const vector<PointId>& groundtruth,
  function GetPresicionAt (line 86) | double GetPresicionAt(const int length, const vector<PointId>& groundtruth,
  function GetRecall (line 102) | double GetRecall(int k, const vector<PointId>& groundtruth,
  function get_distance (line 121) | float get_distance(Point data, Point query)
  function compute_relative_distance_error (line 131) | float compute_relative_distance_error(int k, const Points& dataset, cons...
  function compute_number_closer (line 147) | float compute_number_closer (int k, const vector<PointId>& groundtruth, ...
  function compute_mean_reciprocal_rank (line 164) | float compute_mean_reciprocal_rank (int k, const vector<PointId>& ground...
  function compute_mean_average_precision (line 179) | float compute_mean_average_precision (int k, const vector<PointId>& grou...
  function compute_discounted_culmulative_gain (line 199) | float compute_discounted_culmulative_gain(int k, const vector<PointId>& ...

FILE: algorithms/OPQ/src/perfomance_util.h
  type pair (line 20) | typedef pair<Distance, PointId> DistanceToPoint;
  function class (line 25) | class PerfTester {

FILE: algorithms/OPQ/src/searcher.h
  type PointType (line 26) | enum PointType
  type vector (line 35) | typedef vector<pair<Distance, ClusterId> > NearestSubspaceCentroids;
  function RecordToMetainfoAndDistance (line 188) | void RecordToMetainfoAndDistance(const Coord* point,

FILE: algorithms/OPQ/src/searcher_tester.cpp
  function SetOptions (line 75) | int SetOptions(int argc, char** argv) {
  function diff_timeval (line 146) | float diff_timeval(timeval t1, timeval t2) {
  function TestSearcher (line 151) | void TestSearcher(TSearcher& searcher,
  function main (line 187) | int main(int argc, char** argv) {

FILE: algorithms/QALSH/src/ann.cpp
  function diff_timeval (line 4) | float diff_timeval(timeval t1, timeval t2) {
  function ground_truth (line 10) | int ground_truth(					// output the ground truth results
  function indexing (line 121) | int indexing(						// build hash tables for the dataset
  function lshknn (line 195) | int lshknn(							// k-nn via qalsh (data in disk)
  function linear_scan (line 347) | int linear_scan(					// brute-force linear scan (data in disk)

FILE: algorithms/QALSH/src/b_node.cpp
  function BNode (line 95) | BNode* BNode::get_left_sibling()	// get the left-sibling node
  function BNode (line 106) | BNode* BNode::get_right_sibling()	// get the right-sibling node
  function BIndexNode (line 382) | BIndexNode* BIndexNode::get_left_sibling()
  function BIndexNode (line 394) | BIndexNode* BIndexNode::get_right_sibling()
  function BLeafNode (line 678) | BLeafNode* BLeafNode::get_left_sibling()
  function BLeafNode (line 690) | BLeafNode* BLeafNode::get_right_sibling()

FILE: algorithms/QALSH/src/b_node.h
  function class (line 10) | class BNode {
  function class (line 86) | class BIndexNode : public BNode {
  function class (line 140) | class BLeafNode : public BNode {

FILE: algorithms/QALSH/src/b_tree.h
  type HashValue (line 8) | struct HashValue
  function class (line 13) | class BTree {

FILE: algorithms/QALSH/src/block_file.h
  function class (line 8) | class BlockFile {

FILE: algorithms/QALSH/src/main.cpp
  function usage (line 4) | void usage() 						// display the usage of qalsh
  function main (line 34) | int main(int nargs, char **args)

FILE: algorithms/QALSH/src/qalsh.cpp
  function HashValueQsortComp (line 975) | int HashValueQsortComp(				// compare function for qsort

FILE: algorithms/QALSH/src/qalsh.h
  type ResultItem (line 10) | struct ResultItem {
  type PageBuffer (line 23) | struct PageBuffer {
  type HashValue (line 33) | struct HashValue {
  function class (line 42) | class QALSH {

FILE: algorithms/QALSH/src/random.cpp
  function uniform (line 6) | float uniform(						// r.v. from Uniform(min, max)
  function gaussian (line 24) | float gaussian(						// r.v. from Gaussian(mean, sigma)
  function gaussian_pdf (line 46) | float gaussian_pdf(					// pdf of N(0, 1)
  function gaussian_cdf (line 54) | float gaussian_cdf(					// cdf of N(0, 1) in range (-inf, x]
  function new_gaussian_cdf (line 66) | float new_gaussian_cdf(				// cdf of N(0, 1) in range [-x, x]
  function orig_gaussian_prob (line 84) | float orig_gaussian_prob(			// calc original gaussian probability
  function new_gaussian_prob (line 95) | float new_gaussian_prob(			// calc new gaussian probability
  function prob_of_gaussian (line 105) | void prob_of_gaussian()				// curve of p1, p2 vs. w under gaussian
  function diff_prob_of_gaussian (line 132) | void diff_prob_of_gaussian()		// curve of p1 - p2 vs. w under gaussian
  function rho_of_gaussian (line 160) | void rho_of_gaussian()				// curve of rho vs. w under gaussian

FILE: algorithms/QALSH/src/util.cpp
  function compfloats (line 13) | int compfloats(						// compare two real values
  function error (line 23) | void error(							// display an error message
  function check_mem (line 32) | int check_mem()						// check memory is enough
  function calc_l2_dist (line 49) | float calc_l2_dist(					// calculate l2 distance of 2 vectors
  function read_set (line 67) | int read_set(						// read (data or query) set from disk
  function write_data_new_form (line 107) | int write_data_new_form(			// write dataset with new format
  function get_data_filename (line 214) | void get_data_filename(				// get file name of data
  function write_data_to_buffer (line 228) | void write_data_to_buffer(			// write data to buffer
  function write_buffer_to_page (line 245) | int write_buffer_to_page(			// write buffer to one page
  function read_data (line 267) | int read_data(						// read data from page
  function read_buffer_from_page (line 321) | int read_buffer_from_page(			// read buffer from page
  function read_data_from_buffer (line 341) | void read_data_from_buffer(			// read data from buffer

FILE: algorithms/RCT/src/DistData.h
  function class (line 12) | class DistData {

FILE: algorithms/RCT/src/data_util.h
  function DistData (line 26) | DistData** ReadPoints(const char * filepath, int *len, int *d) {
  function ReadPoints (line 50) | void ReadPoints(const char * filepath,DistData** points, int *len, int *...
  function ReadGroundtruth (line 73) | void ReadGroundtruth(const string& filename,int** gnds, int count) {
  function ReadChecks (line 95) | void ReadChecks(const string& filename, vector<float>* checks) {
  function compute_recall (line 107) | float compute_recall(int** gnds, int** indices,int nq,int nn,int* nums)
  function compute_mean_reciprocal_rank (line 122) | float compute_mean_reciprocal_rank(int** gnds, int** indices,int nq,int ...
  function compute_number_closer (line 145) | float compute_number_closer(int** gnds, int** indices,int nq,int nn,int*...
  function compute_relative_distance_error (line 168) | float compute_relative_distance_error(int** gnds,DistData** points,DistD...
  function compute_mean_average_precision (line 194) | float compute_mean_average_precision (int** gnds,  int** indices,int nq,...
  function compute_discounted_culmulative_gain (line 216) | float compute_discounted_culmulative_gain (int** gnds,  int** indices,in...

FILE: algorithms/RCT/src/indexer.cpp
  function diff_timeval (line 26) | float diff_timeval(timeval t1, timeval t2) {
  function main (line 30) | int main(int argc, char * argv[]) {

FILE: algorithms/RCT/src/random.cpp
  function Random (line 48) | Random& Random::seed(const unsigned long& s) {
  function Random (line 58) | Random& Random::seed(const unsigned long* array, const unsigned long& si...

FILE: algorithms/RCT/src/random.h
  function class (line 4) | class Random {

FILE: algorithms/RCT/src/rct.cpp
  function DistData (line 592) | DistData** RCT::getData() {

FILE: algorithms/RCT/src/rct.h
  function class (line 233) | class RCT {

FILE: algorithms/RCT/src/searcher.cpp
  function diff_timeval (line 34) | float diff_timeval(timeval t1, timeval t2) {
  function main (line 38) | int main(int argc, char * argv[]) {

FILE: algorithms/SGH/src/SGH.cpp
  function diff_timeval (line 40) | float diff_timeval(timeval t1, timeval t2) {
  function main (line 44) | int main(int argc, char * argv[]) {

FILE: algorithms/SGH/src/SGH.h
  function class (line 21) | class SGH

FILE: algorithms/SGH/src/center_chooser.h
  function class (line 5) | class CenterChooser

FILE: algorithms/SGH/src/data_util.h
  function transpose (line 22) | void transpose(vector<vector<float> > X,vector<vector<float> >* Y)
  function ReadPoints (line 40) | void ReadPoints(char* filepath,vector<vector<float> >* points, int* len,...
  function ReadGroundtruth (line 64) | void ReadGroundtruth(char* filepath, vector<vector<int> >* gnds, int* le...
  function ReadB1 (line 88) | void ReadB1(const string& filename, vector<vector<unsigned> >* B1,int n)...
  function ReadChecks (line 111) | void ReadChecks(const string& filename, vector<int>* checks) {

FILE: algorithms/SGH/src/dynamic_bitset.h
  function class (line 3) | class DynamicBitset
  function clear (line 17) | void clear()
  function reset (line 22) | void reset()
  function resize (line 28) | void resize(size_t size)
  function set (line 38) | void set(size_t index)
  function test (line 47) | bool test(size_t index) const

FILE: algorithms/SGH/src/eval.h
  function compute_recall (line 29) | float compute_recall(vector<vector<int> >* gnds, vector<vector<int> >* r...
  function compute_mean_reciprocal_rank (line 46) | float compute_mean_reciprocal_rank(vector<vector<int> >* gnds, vector<ve...
  function compute_number_closer (line 67) | float compute_number_closer(vector<vector<int> >* gnds, vector<vector<in...
  function compute_relative_distance_error (line 91) | float compute_relative_distance_error(vector<vector<float> >* points, ve...
  function compute_mean_average_precision (line 115) | float compute_mean_average_precision (vector<vector<int> >* gnds, vector...
  function compute_discounted_culmulative_gain (line 143) | float compute_discounted_culmulative_gain (vector<vector<int> >* gnds, v...
  function compute_recall (line 169) | float compute_recall(vector<vector<int> >* gnds, vector<vector<E_Neighbo...
  function compute_mean_reciprocal_rank (line 187) | float compute_mean_reciprocal_rank(vector<vector<int> >* gnds, vector<ve...
  function compute_number_closer (line 208) | float compute_number_closer(vector<vector<int> >* gnds, vector<vector<E_...
  function compute_relative_distance_error (line 232) | float compute_relative_distance_error(vector<vector<float> >* points, ve...
  function compute_mean_average_precision (line 257) | float compute_mean_average_precision (vector<vector<int> >* gnds, vector...
  function compute_discounted_culmulative_gain (line 285) | float compute_discounted_culmulative_gain (vector<vector<int> >* gnds, v...

FILE: algorithms/SGH/src/hammingDist.h
  type B_Neighbor (line 30) | struct B_Neighbor{
  type E_Neighbor (line 41) | struct E_Neighbor{
  function get_distance (line 51) | float get_distance(vector<float> point, vector<float> query)
  function hammingDist (line 62) | void hammingDist(vector<vector<unsigned> >* B2,vector<vector<unsigned> >...
  function UpdatePriorityList_Binary (line 84) | void UpdatePriorityList_Binary (B_Neighbor *BList, B_Neighbor tmp, int l...
  function hammingDist (line 104) | void hammingDist(vector<vector<unsigned> >* B2,vector<vector<unsigned> >...
  function hammingDist_ByRange (line 138) | void hammingDist_ByRange(vector<vector<unsigned> >* B2,vector<vector<uns...
  function UpdatePriorityList_Euclidean (line 162) | void UpdatePriorityList_Euclidean (E_Neighbor *BList, E_Neighbor tmp, in...

FILE: algorithms/SGH/src/heap.h
  function size (line 42) | int size()
  function empty (line 52) | bool empty()
  function clear (line 60) | void clear()
  type CompareT (line 66) | struct CompareT
  function const (line 68) | bool operator()(const T& t_1, const T& t_2) const
  function insert (line 83) | void insert(const T& value)
  function popMin (line 105) | bool popMin(T& value)
  type Interval (line 125) | struct Interval
  function size (line 155) | size_t size()
  function empty (line 164) | bool empty()
  function clear (line 172) | void clear()
  function insert (line 177) | void insert(const T& value)
  function popMin (line 251) | bool popMin(T& value)
  function popMax (line 296) | bool popMax(T& value)
  function getMin (line 336) | bool getMin(T& value)
  function getMax (line 346) | bool getMax(T& value)
  function size (line 371) | int size()
  function empty (line 380) | bool empty()
  function clear (line 388) | void clear()
  function insert (line 393) | void insert(const T& value)
  function popMin (line 404) | bool popMin(T& value)

FILE: algorithms/SGH/src/hierarchical_clustering_index.h
  function class (line 23) | class HierarchicalClusteringIndex
  type Node (line 126) | typedef Node* NodePtr;
  type BranchStruct (line 127) | struct BranchStruct
  function get_distance (line 143) | int get_distance(int p1, int p2)
  function get_distance (line 156) | int get_distance(const vector<unsigned>* p1, const vector<unsigned>* p2)
  function computeLabels (line 169) | void computeLabels(int* indices, int indices_length,  int* centers, int ...
  function computeClustering (line 184) | void computeClustering(Node* node, int* indices, int indices_length)
  type BranchStruct (line 240) | typedef BranchStruct BranchSt;
  function findNN (line 242) | void findNN(NodePtr node, ResultSet& result, const vector<unsigned>* vec...
  function findNeighborsWithRemoved (line 283) | void findNeighborsWithRemoved(ResultSet& result, const vector<unsigned>*...
  function knnSearch (line 308) | int knnSearch(const vector<vector<unsigned> >& queries, vector< vector<i...

FILE: algorithms/SGH/src/random.h
  function seed_random (line 39) | inline void seed_random(unsigned int seed)
  function class (line 70) | class RandomGenerator
  function class (line 81) | class UniqueRandom
  function init (line 102) | void init(int n)
  function next (line 121) | int next()

FILE: algorithms/SGH/src/result_set.h
  type DistanceIndex (line 9) | struct DistanceIndex
  function class (line 24) | class ResultSet
  function clear (line 44) | void clear()
  function full (line 64) | bool full()
  function addPoint (line 75) | void addPoint(int dist, int index)
  function copy (line 108) | void copy(vector<int>* indices, vector<int>* dists, size_t num_elements)

FILE: algorithms/SH/src/SHgeneral.h
  function class (line 14) | class SHGeneral{

FILE: algorithms/SH/src/SHindex.cpp
  function datakeycompare (line 37) | bool datakeycompare(datakey a,datakey b)

FILE: algorithms/SH/src/SHindex.h
  type datakey (line 13) | struct datakey
  function class (line 19) | class SHIndex{

FILE: algorithms/SH/src/SHselection.h
  function class (line 12) | class SHSelection{

FILE: algorithms/SH/src/io.h
  function class (line 8) | class IO{

FILE: algorithms/SH/src/knn.cpp
  function GenRandom (line 31) | vector<int> GenRandom (int size,int N)

FILE: algorithms/SH/src/knn.h
  function class (line 9) | class Knn{

FILE: algorithms/SH/src/main.cpp
  function main (line 49) | int main()

FILE: algorithms/SH/src/myrandom.h
  function class (line 5) | class MyRandom{

FILE: algorithms/SH/src/myvector.h
  function class (line 4) | class MyVector{

FILE: algorithms/SH/src/statisticsmodule.h
  function class (line 11) | class StatisticsModule{

FILE: algorithms/SRS/src/ParamFile.cpp
  function writeParamFile (line 26) | void writeParamFile(char * file_path, long long n, int d, int m, int B,

FILE: algorithms/SRS/src/ProjData.cpp
  function cal_squared_dist_1 (line 27) | inline float cal_squared_dist_1(float * a, float * b) {
  function cal_squared_dist_2 (line 31) | inline float cal_squared_dist_2(float * a, float * b) {
  function cal_squared_dist_3 (line 35) | inline float cal_squared_dist_3(float * a, float * b) {
  function cal_squared_dist_4 (line 40) | inline float cal_squared_dist_4(float * a, float * b) {
  function cal_squared_dist_5 (line 44) | inline float cal_squared_dist_5(float * a, float * b) {
  function cal_squared_dist_6 (line 49) | inline float cal_squared_dist_6(float * a, float * b) {
  function cal_squared_dist_7 (line 54) | inline float cal_squared_dist_7(float * a, float * b) {
  function cal_squared_dist_8 (line 60) | inline float cal_squared_dist_8(float * a, float * b) {
  function cal_squared_dist_9 (line 66) | inline float cal_squared_dist_9(float * a, float * b) {
  function cal_squared_dist_10 (line 73) | inline float cal_squared_dist_10(float * a, float * b) {

FILE: algorithms/SRS/src/ProjData.h
  function class (line 26) | class Proj_data {

FILE: algorithms/SRS/src/RandGen.cpp
  function gaussian (line 31) | float gaussian(float mean, float sigma) {
  function uniform (line 56) | float uniform(float _min, float _max) {

FILE: algorithms/SRS/src/Rawdata.h
  type T (line 29) | typedef T Type;
  function float (line 32) | struct Accumulator<float> {
  function int (line 36) | struct Accumulator<int> {
  type typename (line 42) | typedef typename Accumulator<T>::Type ResultType;
  function virtual (line 56) | virtual ~Raw_data() {
  function ResultType (line 60) | ResultType cal_squared_dist(long long id, T * q) {

FILE: algorithms/SRS/src/SRSCoverTree.cpp
  type search_node (line 23) | struct search_node {
  function dist_of_scale (line 55) | inline float dist_of_scale(int s) {
  function get_scale (line 59) | inline int get_scale(float d) {
  function min (line 63) | inline int min(int a, int b) {
  function max (line 70) | inline float max(float a, float b) {
  function TreeNode (line 101) | TreeNode * SRS_Cover_Tree::new_node(int id) {
  function TreeNode (line 159) | TreeNode * SRS_Cover_Tree::batch_insert(int pivot, int max_scale, int to...
  function res_pair (line 278) | res_pair SRS_Cover_Tree::increm_knn_search_compressed() {
  function adjust_offset (line 408) | void adjust_offset(CompressedTreeNode * node, char * tmppool, char * poo...
  function traverse (line 445) | void traverse(CompressedTreeNode * node, int my_height, int & max_height,

FILE: algorithms/SRS/src/SRSCoverTree.h
  type TreeNode (line 37) | struct TreeNode {
  type CompressedTreeNode (line 44) | struct CompressedTreeNode {
  type res_pair (line 59) | struct res_pair {
  type ds_node (line 64) | struct ds_node {
  type search_node (line 69) | struct search_node
  function class (line 71) | class SRS_Cover_Tree {

FILE: algorithms/SRS/src/SRSInMemory.h
  function int (line 117) | struct type_name<int> {
  function float (line 122) | struct type_name<float> {
  function double (line 127) | struct type_name<double> {
  type type_name (line 132) | struct type_name
  function int (line 143) | struct type_format<int> {
  function float (line 148) | struct type_format<float> {
  function double (line 153) | struct type_format<double> {
  type type_format (line 158) | struct type_format
  function get_m (line 186) | int get_m() {

FILE: algorithms/SRS/src/cal_param.cpp
  function main (line 32) | int main(int argc, char* argv[]) {
  function cal_para_given_t (line 113) | void cal_para_given_t(int n, double max_f, double c, double sp) {
  function cal_para_given_m (line 164) | void cal_para_given_m(int n, int m, double c, double sp) {
  function usage (line 193) | void usage() {

FILE: algorithms/SRS/src/gen_gt.cpp
  function main (line 50) | int main(int argc, char * argv[]) {
  function usage (line 140) | void usage() {
  function file_exists (line 159) | bool file_exists(const char *filename) {
  function l2_dist_int (line 164) | double l2_dist_int(int *_p1, int *_p2, int _dim) {
  function l2_dist_float (line 173) | double l2_dist_float(float *_p1, float *_p2, int _dim) {
  function gen_gt (line 182) | void gen_gt(int n, int d, int k, const char * data_file,

FILE: algorithms/SRS/src/gen_hard_data.cpp
  function main (line 34) | int main(int argc, char* argv[]) {
  function gen_hard_data_float (line 118) | void gen_hard_data_float(int n, int d, float c, char * data_file_path,
  function usage (line 216) | void usage() {

FILE: algorithms/SRS/src/srs.cpp
  function diff_timeval (line 50) | float diff_timeval(timeval t1, timeval t2) {
  function main (line 54) | int main(int argc, char * argv[]) {
  function usage (line 282) | void usage() {
  function file_exists (line 316) | bool file_exists(const char *filename) {
  function dir_exists (line 324) | bool dir_exists(const char *dirname) {
  function query_workload (line 335) | void query_workload(SRS_In_Memory<T> * searcher,int qn, int d, int k, in...
  function cal_thres (line 392) | double cal_thres(double c, double p_thres, int m) {

FILE: algorithms/SRS/src/stack.h
  function T (line 30) | T last() {
  function decr (line 33) | void decr() {

FILE: algorithms/flann/code/bin/download_checkmd5.py
  class AppURLopener (line 6) | class AppURLopener(urllib.FancyURLopener):
    method prompt_user_passwd (line 9) | def prompt_user_passwd(self, host, realm):
  function file_md5 (line 13) | def file_md5(file):
  function main (line 19) | def main():

FILE: algorithms/flann/code/build/CMakeFiles/3.2.3/CompilerIdC/CMakeCCompilerId.c
  function main (line 479) | void main() {}
  function main (line 481) | int main(int argc, char* argv[])

FILE: algorithms/flann/code/build/CMakeFiles/3.2.3/CompilerIdCXX/CMakeCXXCompilerId.cpp
  function main (line 473) | int main(int argc, char* argv[])

FILE: algorithms/flann/code/build/CMakeFiles/feature_tests.c
  function main (line 34) | int main(int argc, char** argv) { (void)argv; return features[argc]; }

FILE: algorithms/flann/code/build/CMakeFiles/feature_tests.cxx
  function main (line 405) | int main(int argc, char** argv) { (void)argv; return features[argc]; }

FILE: algorithms/flann/code/build/src/python/setup.py
  function find_path (line 9) | def find_path():

FILE: algorithms/flann/code/examples/build_auto.cpp
  function diff_timeval (line 13) | float diff_timeval(timeval t1, timeval t2) {
  function main (line 17) | int main(int argc, char** argv)

FILE: algorithms/flann/code/examples/build_hkmeans.cpp
  function diff_timeval (line 14) | float diff_timeval(timeval t1, timeval t2) {
  function main (line 18) | int main(int argc, char** argv)

FILE: algorithms/flann/code/examples/build_kdtree.cpp
  function diff_timeval (line 15) | float diff_timeval(timeval t1, timeval t2) {
  function main (line 19) | int main(int argc, char** argv)

FILE: algorithms/flann/code/examples/linear.cpp
  function diff_timeval (line 14) | float diff_timeval(timeval t1, timeval t2) {
  function main (line 19) | int main(int argc, char** argv)

FILE: algorithms/flann/code/examples/search_auto.cpp
  function compute_recall (line 15) | float compute_recall(int k,const flann::Matrix<int>& results, const flan...
  function diff_timeval (line 31) | float diff_timeval(timeval t1, timeval t2) {
  function main (line 35) | int main(int argc, char** argv)

FILE: algorithms/flann/code/examples/search_hkmeans.cpp
  function compute_recall (line 14) | float compute_recall(int k,const flann::Matrix<int>& results, const flan...
  function diff_timeval (line 31) | float diff_timeval(timeval t1, timeval t2) {
  function main (line 35) | int main(int argc, char** argv)

FILE: algorithms/flann/code/examples/search_kdtree.cpp
  function compute_recall (line 14) | float compute_recall(int k,const flann::Matrix<int>& results, const flan...
  function diff_timeval (line 29) | float diff_timeval(timeval t1, timeval t2) {
  function main (line 33) | int main(int argc, char** argv)

FILE: algorithms/flann/code/src/cpp/flann/algorithms/#kmeans_index.h
  function namespace (line 55) | namespace flann
  type typename (line 89) | typedef typename Distance::ElementType ElementType;
  type typename (line 90) | typedef typename Distance::ResultType DistanceType;
  type NNIndex (line 92) | typedef NNIndex<Distance> BaseClass;
  type needs_vector_space_distance (line 94) | typedef bool needs_vector_space_distance;
  function initCenterChooser (line 170) | void initCenterChooser()
  function virtual (line 192) | virtual ~KMeansIndex()
  function BaseClass (line 198) | BaseClass* clone() const
  function set_cb_index (line 204) | void set_cb_index( float index)
  function saveIndex (line 265) | void saveIndex(FILE* stream)
  function loadIndex (line 271) | void loadIndex(FILE* stream)
  function findNeighbors (line 288) | void findNeighbors(ResultSet<DistanceType>& result, const ElementType* v...
  function getClusterCenters (line 306) | int getClusterCenters(Matrix<DistanceType>& centers)
  type PointInfo (line 394) | struct PointInfo
  type serialization (line 410) | struct serialization
  type Node (line 416) | struct Node
  type KMeansIndex (line 460) | typedef KMeansIndex<Distance> Index;
  type Node (line 494) | typedef Node* NodePtr;
  type BranchStruct (line 499) | typedef BranchStruct<NodePtr, DistanceType> BranchSt;
  function freeIndex (line 505) | void freeIndex()
  function copyTree (line 512) | void copyTree(NodePtr& dst, const NodePtr& src)
  function computeNodeStatistics (line 540) | void computeNodeStatistics(NodePtr node, const std::vector<int>& indices)
  type _clus (line 588) | struct _clus
  function computeClustering (line 596) | void computeClustering(NodePtr node, int* indices, int indices_length, i...
  function exploreNodeBranches (line 879) | int exploreNodeBranches(NodePtr node, const ElementType* q, Heap<BranchS...
  function getCenterOrdering (line 957) | void getCenterOrdering(NodePtr node, const ElementType* q, std::vector<i...
  function DistanceType (line 979) | DistanceType getDistanceToBorder(DistanceType* p, DistanceType* c, Dista...
  function getMinVarianceClusters (line 1003) | int getMinVarianceClusters(NodePtr root, std::vector<NodePtr>& clusters,...
  function addPointToTree (line 1046) | void addPointToTree(NodePtr node, size_t index, DistanceType dist_to_pivot)
  function swap (line 1087) | void swap(KMeansIndex& other)

FILE: algorithms/flann/code/src/cpp/flann/algorithms/#nn_index.h
  function namespace (line 44) | namespace flann
  function virtual (line 113) | virtual ~NNIndex()
  function virtual (line 126) | virtual void buildIndex()
  function virtual (line 142) | virtual void buildIndex(const Matrix<ElementType>& dataset)
  function virtual (line 162) | virtual void removePoint(size_t id)
  function virtual (line 188) | virtual ElementType* getPoint(size_t id)
  function virtual (line 302) | virtual int knnSearch(const Matrix<ElementType>& queries,
  function knnSearch (line 364) | int knnSearch(const Matrix<ElementType>& queries,
  function knnSearch (line 391) | int knnSearch(const Matrix<ElementType>& queries,
  function knnSearch (line 462) | int knnSearch(const Matrix<ElementType>& queries,
  function radiusSearch (line 487) | int radiusSearch(const Matrix<ElementType>& queries,
  function radiusSearch (line 570) | int radiusSearch(const Matrix<ElementType>& queries,
  function radiusSearch (line 597) | int radiusSearch(const Matrix<ElementType>& queries,
  function radiusSearch (line 676) | int radiusSearch(const Matrix<ElementType>& queries,
  function id_to_index (line 701) | size_t id_to_index(size_t id)
  function indices_to_ids (line 733) | void indices_to_ids(const size_t* in, size_t* out, size_t size) const
  function setDataset (line 742) | void setDataset(const Matrix<ElementType>& dataset)
  function extendDataset (line 759) | void extendDataset(const Matrix<ElementType>& new_points)
  function cleanRemovedPoints (line 778) | void cleanRemovedPoints()
  function swap (line 798) | void swap(NNIndex& other)

FILE: algorithms/flann/code/src/cpp/flann/algorithms/all_indices.h
  function namespace (line 49) | namespace flann

FILE: algorithms/flann/code/src/cpp/flann/algorithms/autotuned_index.h
  function namespace (line 47) | namespace flann
  type typename (line 78) | typedef typename Distance::ResultType DistanceType;
  type NNIndex (line 80) | typedef NNIndex<Distance> BaseClass;
  type AutotunedIndex (line 82) | typedef AutotunedIndex<Distance> IndexType;
  type needs_kdtree_distance (line 84) | typedef bool needs_kdtree_distance;
  function virtual (line 123) | virtual ~AutotunedIndex()
  function BaseClass (line 128) | BaseClass* clone() const
  function buildIndex (line 136) | void buildIndex()
  function buildIndex (line 163) | void buildIndex(const Matrix<ElementType>& dataset)
  function removePoint (line 178) | void removePoint(size_t id)
  function saveIndex (line 216) | void saveIndex(FILE* stream)
  function loadIndex (line 224) | void loadIndex(FILE* stream)
  function knnSearch (line 235) | int knnSearch(const Matrix<ElementType>& queries,
  function knnSearch (line 249) | int knnSearch(const Matrix<ElementType>& queries,
  function radiusSearch (line 264) | int radiusSearch(const Matrix<ElementType>& queries,
  function radiusSearch (line 278) | int radiusSearch(const Matrix<ElementType>& queries,
  function findNeighbors (line 297) | void findNeighbors(ResultSet<DistanceType>& result, const ElementType* v...
  function freeIndex (line 357) | void freeIndex()
  type CostData (line 364) | struct CostData
  function evaluate_kmeans (line 373) | void evaluate_kmeans(CostData& cost)
  function evaluate_kdtree (line 400) | void evaluate_kdtree(CostData& cost)
  function optimizeKMeans (line 473) | void optimizeKMeans(std::vector<CostData>& costs)
  function optimizeKDTree (line 521) | void optimizeKDTree(std::vector<CostData>& costs)
  function IndexParams (line 563) | IndexParams estimateBuildParams()
  function estimateSearchParams (line 652) | float estimateSearchParams(SearchParams& searchParams)
  function swap (line 725) | void swap(AutotunedIndex& other)

FILE: algorithms/flann/code/src/cpp/flann/algorithms/center_chooser.h
  function namespace (line 13) | namespace flann

FILE: algorithms/flann/code/src/cpp/flann/algorithms/composite_index.h
  function namespace (line 39) | namespace flann
  type typename (line 75) | typedef typename Distance::ResultType DistanceType;
  type NNIndex (line 77) | typedef NNIndex<Distance> BaseClass;
  type needs_kdtree_distance (line 79) | typedef bool needs_kdtree_distance;
  function virtual (line 114) | virtual ~CompositeIndex()
  function BaseClass (line 120) | BaseClass* clone() const
  function buildIndex (line 161) | void buildIndex()
  function removePoint (line 175) | void removePoint(size_t index)
  function saveIndex (line 186) | void saveIndex(FILE* stream)
  function loadIndex (line 196) | void loadIndex(FILE* stream)
  function findNeighbors (line 205) | void findNeighbors(ResultSet<DistanceType>& result, const ElementType* v...
  function buildIndexImpl (line 218) | void buildIndexImpl()
  function freeIndex (line 223) | void freeIndex()

FILE: algorithms/flann/code/src/cpp/flann/algorithms/dist.h
  function namespace (line 47) | namespace flann
  function byteBitsLookUp (line 408) | static unsigned char byteBitsLookUp(unsigned char b)
  type T (line 487) | typedef T ElementType;
  type ResultType (line 488) | typedef int ResultType;
  type pop_t (line 517) | typedef unsigned long long pop_t;
  type T (line 545) | typedef T ElementType;
  type ResultType (line 546) | typedef unsigned int ResultType;
  function popcnt32 (line 550) | unsigned int popcnt32(uint32_t n) const
  function popcnt64 (line 557) | unsigned int popcnt64(uint64_t n) const
  type is_kdtree_distance (line 599) | typedef bool is_kdtree_distance;
  type T (line 601) | typedef T ElementType;
  type typename (line 602) | typedef typename Accumulator<T>::Type ResultType;
  function ResultType (line 642) | ResultType accum_dist(const U& a, const V& b, int) const
  type is_kdtree_distance (line 653) | typedef bool is_kdtree_distance;
  type T (line 655) | typedef T ElementType;
  type typename (line 656) | typedef typename Accumulator<T>::Type ResultType;
  function ResultType (line 690) | ResultType accum_dist(const U& a, const V& b, int) const
  type is_kdtree_distance (line 700) | typedef bool is_kdtree_distance;
  type T (line 702) | typedef T ElementType;
  type typename (line 703) | typedef typename Accumulator<T>::Type ResultType;
  function ResultType (line 735) | ResultType accum_dist(const U& a, const V& b, int) const
  type is_kdtree_distance (line 753) | typedef bool is_kdtree_distance;
  type T (line 755) | typedef T ElementType;
  type typename (line 756) | typedef typename Accumulator<T>::Type ResultType;
  function ResultType (line 788) | ResultType accum_dist(const U& a, const V& b, int) const

FILE: algorithms/flann/code/src/cpp/flann/algorithms/hierarchical_clustering_index.h
  function namespace (line 52) | namespace flann
  type typename (line 86) | typedef typename Distance::ResultType DistanceType;
  type NNIndex (line 88) | typedef NNIndex<Distance> BaseClass;
  function initCenterChooser (line 157) | void initCenterChooser()
  function virtual (line 179) | virtual ~HierarchicalClusteringIndex()
  function BaseClass (line 185) | BaseClass* clone() const
  function saveIndex (line 258) | void saveIndex(FILE* stream)
  function loadIndex (line 265) | void loadIndex(FILE* stream)
  function findNeighbors (line 282) | void findNeighbors(ResultSet<DistanceType>& result, const ElementType* v...
  type PointInfo (line 315) | struct PointInfo
  type Node (line 342) | struct Node
  type HierarchicalClusteringIndex (line 373) | typedef HierarchicalClusteringIndex<Distance> Index;
  type Node (line 403) | typedef Node* NodePtr;
  type BranchStruct (line 410) | typedef BranchStruct<NodePtr, DistanceType> BranchSt;
  function freeIndex (line 417) | void freeIndex(){
  function copyTree (line 424) | void copyTree(NodePtr& dst, const NodePtr& src)
  function computeLabels (line 443) | void computeLabels(int* indices, int indices_length,  int* centers, int ...
  function computeClustering (line 471) | void computeClustering(NodePtr node, int* indices, int indices_length)
  function addPointToTree (line 603) | void addPointToTree(NodePtr node, size_t index)
  function swap (line 639) | void swap(HierarchicalClusteringIndex& other)

FILE: algorithms/flann/code/src/cpp/flann/algorithms/kdtree_cuda_3d_index.h
  function namespace (line 49) | namespace flann
  type typename (line 74) | typedef typename Distance::ResultType DistanceType;
  type NNIndex (line 76) | typedef NNIndex<Distance> BaseClass;
  type needs_kdtree_distance (line 80) | typedef bool needs_kdtree_distance;
  function BaseClass (line 114) | BaseClass* clone() const
  function buildIndex (line 122) | void buildIndex()
  function removePoint (line 147) | void removePoint(size_t index)
  function ElementType (line 152) | ElementType* getPoint(size_t id)
  function saveIndex (line 157) | void saveIndex(FILE* stream)
  function loadIndex (line 164) | void loadIndex(FILE* stream)
  function knnSearch (line 194) | int knnSearch(const Matrix<ElementType>& queries, Matrix<int>& indices, ...
  function knnSearch (line 208) | int knnSearch(const Matrix<ElementType>& queries,
  function knnSearchGpu (line 228) | int knnSearchGpu(const Matrix<ElementType>& queries,
  function radiusSearch (line 250) | int radiusSearch(const Matrix<ElementType>& queries, Matrix<int>& indice...
  function radiusSearch (line 256) | int radiusSearch(const Matrix<ElementType>& queries, std::vector< std::v...
  function findNeighbors (line 272) | void findNeighbors(ResultSet<DistanceType>& result, const ElementType* v...
  function freeIndex (line 282) | void freeIndex()
  type GpuHelper (line 298) | struct GpuHelper

FILE: algorithms/flann/code/src/cpp/flann/algorithms/kdtree_cuda_builder.h
  function namespace (line 43) | namespace flann
  type SplitNodes (line 271) | struct SplitNodes
  type set_addr3 (line 366) | struct set_addr3
  type pointxyz_to_px_py_pz (line 383) | struct pointxyz_to_px_py_pz
  function class (line 401) | class CudaKdTreeBuilder
  function resize_node_vectors (line 670) | void resize_node_vectors( size_t new_size )
  type AllocationInfo (line 701) | enum AllocationInfo

FILE: algorithms/flann/code/src/cpp/flann/algorithms/kdtree_index.h
  function namespace (line 51) | namespace flann
  type typename (line 75) | typedef typename Distance::ResultType DistanceType;
  type NNIndex (line 77) | typedef NNIndex<Distance> BaseClass;
  type needs_kdtree_distance (line 79) | typedef bool needs_kdtree_distance;
  function virtual (line 129) | virtual ~KDTreeIndex()
  function BaseClass (line 134) | BaseClass* clone() const
  function saveIndex (line 192) | void saveIndex(FILE* stream)
  function loadIndex (line 199) | void loadIndex(FILE* stream)
  function findNeighbors (line 224) | void findNeighbors(ResultSet<DistanceType>& result, const ElementType* v...
  function freeIndex (line 280) | void freeIndex()
  type Node (line 293) | struct Node
  type KDTreeIndex (line 321) | typedef KDTreeIndex<Distance> Index;
  type Node (line 350) | typedef Node* NodePtr;
  type BranchStruct (line 351) | typedef BranchStruct<NodePtr, DistanceType> BranchSt;
  type BranchSt (line 352) | typedef BranchSt* Branch;
  function High (line 355) | int High(NodePtr T)
  function copyTree (line 366) | void copyTree(NodePtr& dst, const NodePtr& src)
  function NodePtr (line 391) | NodePtr divideTree(int* ind, int count)
  function meanSplit (line 422) | void meanSplit(int* ind, int count, int& index, int& cutfeat, DistanceTy...
  function selectDivision (line 472) | int selectDivision(DistanceType* v)
  function planeSplit (line 510) | void planeSplit(int* ind, int count, int cutfeat, DistanceType cutval, i...
  function addPointToTree (line 674) | void addPointToTree(NodePtr node, int ind)

FILE: algorithms/flann/code/src/cpp/flann/algorithms/kdtree_single_index.h
  function namespace (line 48) | namespace flann
  type typename (line 73) | typedef typename Distance::ResultType DistanceType;
  type NNIndex (line 75) | typedef NNIndex<Distance> BaseClass;
  type needs_kdtree_distance (line 77) | typedef bool needs_kdtree_distance;
  function virtual (line 131) | virtual ~KDTreeSingleIndex()
  function BaseClass (line 136) | BaseClass* clone() const
  function saveIndex (line 188) | void saveIndex(FILE* stream)
  function loadIndex (line 195) | void loadIndex(FILE* stream)
  function findNeighbors (line 220) | void findNeighbors(ResultSet<DistanceType>& result, const ElementType* v...
  type Node (line 262) | struct Node
  type KDTreeSingleIndex (line 291) | typedef KDTreeSingleIndex<Distance> Index;
  type Node (line 317) | typedef Node* NodePtr;
  type Interval (line 320) | struct Interval
  type serialization (line 331) | struct serialization
  type std (line 334) | typedef std::vector<Interval> BoundingBox;
  type BranchStruct (line 336) | typedef BranchStruct<NodePtr, DistanceType> BranchSt;
  type BranchSt (line 337) | typedef BranchSt* Branch;

FILE: algorithms/flann/code/src/cpp/flann/algorithms/kmeans_index.h
  function namespace (line 55) | namespace flann
  type typename (line 87) | typedef typename Distance::ResultType DistanceType;
  type NNIndex (line 89) | typedef NNIndex<Distance> BaseClass;
  type needs_vector_space_distance (line 91) | typedef bool needs_vector_space_distance;
  function initCenterChooser (line 167) | void initCenterChooser()
  function virtual (line 189) | virtual ~KMeansIndex()
  function BaseClass (line 195) | BaseClass* clone() const
  function set_cb_index (line 201) | void set_cb_index( float index)
  function saveIndex (line 262) | void saveIndex(FILE* stream)
  function loadIndex (line 268) | void loadIndex(FILE* stream)
  function findNeighbors (line 285) | void findNeighbors(ResultSet<DistanceType>& result, const ElementType* v...
  function getClusterCenters (line 303) | int getClusterCenters(Matrix<DistanceType>& centers)
  type PointInfo (line 349) | struct PointInfo
  type serialization (line 365) | struct serialization
  type Node (line 371) | struct Node
  type KMeansIndex (line 415) | typedef KMeansIndex<Distance> Index;
  type Node (line 449) | typedef Node* NodePtr;
  type BranchStruct (line 454) | typedef BranchStruct<NodePtr, DistanceType> BranchSt;
  function freeIndex (line 460) | void freeIndex()
  function copyTree (line 467) | void copyTree(NodePtr& dst, const NodePtr& src)
  function computeNodeStatistics (line 495) | void computeNodeStatistics(NodePtr node, const std::vector<int>& indices)
  function computeClustering (line 542) | void computeClustering(NodePtr node, int* indices, int indices_length, i...
  function exploreNodeBranches (line 802) | int exploreNodeBranches(NodePtr node, const ElementType* q, Heap<BranchS...
  function getCenterOrdering (line 880) | void getCenterOrdering(NodePtr node, const ElementType* q, std::vector<i...
  function DistanceType (line 902) | DistanceType getDistanceToBorder(DistanceType* p, DistanceType* c, Dista...
  function getMinVarianceClusters (line 926) | int getMinVarianceClusters(NodePtr root, std::vector<NodePtr>& clusters,...
  function addPointToTree (line 969) | void addPointToTree(NodePtr node, size_t index, DistanceType dist_to_pivot)
  function swap (line 1010) | void swap(KMeansIndex& other)

FILE: algorithms/flann/code/src/cpp/flann/algorithms/kmeans_index_print.h
  function namespace (line 55) | namespace flann
  type typename (line 87) | typedef typename Distance::ResultType DistanceType;
  type NNIndex (line 89) | typedef NNIndex<Distance> BaseClass;
  type needs_vector_space_distance (line 91) | typedef bool needs_vector_space_distance;
  function initCenterChooser (line 167) | void initCenterChooser()
  function virtual (line 189) | virtual ~KMeansIndex()
  function BaseClass (line 195) | BaseClass* clone() const
  function set_cb_index (line 201) | void set_cb_index( float index)
  function saveIndex (line 262) | void saveIndex(FILE* stream)
  function loadIndex (line 268) | void loadIndex(FILE* stream)
  function findNeighbors (line 285) | void findNeighbors(ResultSet<DistanceType>& result, const ElementType* v...
  function getClusterCenters (line 303) | int getClusterCenters(Matrix<DistanceType>& centers)
  type PointInfo (line 383) | struct PointInfo
  type serialization (line 399) | struct serialization
  type Node (line 405) | struct Node
  type KMeansIndex (line 449) | typedef KMeansIndex<Distance> Index;
  type Node (line 483) | typedef Node* NodePtr;
  type BranchStruct (line 488) | typedef BranchStruct<NodePtr, DistanceType> BranchSt;
  function freeIndex (line 494) | void freeIndex()
  function copyTree (line 501) | void copyTree(NodePtr& dst, const NodePtr& src)
  function computeNodeStatistics (line 529) | void computeNodeStatistics(NodePtr node, const std::vector<int>& indices)
  type _clus (line 578) | struct _clus
  function computeClustering (line 587) | void computeClustering(NodePtr node, int* indices, int indices_length, i...
  function exploreNodeBranches (line 869) | int exploreNodeBranches(NodePtr node, const ElementType* q, Heap<BranchS...
  function getCenterOrdering (line 947) | void getCenterOrdering(NodePtr node, const ElementType* q, std::vector<i...
  function DistanceType (line 969) | DistanceType getDistanceToBorder(DistanceType* p, DistanceType* c, Dista...
  function getMinVarianceClusters (line 993) | int getMinVarianceClusters(NodePtr root, std::vector<NodePtr>& clusters,...
  function addPointToTree (line 1036) | void addPointToTree(NodePtr node, size_t index, DistanceType dist_to_pivot)
  function swap (line 1077) | void swap(KMeansIndex& other)

FILE: algorithms/flann/code/src/cpp/flann/algorithms/linear_index.h
  function namespace (line 37) | namespace flann
  type typename (line 54) | typedef typename Distance::ResultType DistanceType;
  type NNIndex (line 56) | typedef NNIndex<Distance> BaseClass;
  function BaseClass (line 69) | LinearIndex(const LinearIndex& other) : BaseClass(other)
  function virtual (line 79) | virtual ~LinearIndex()
  function BaseClass (line 83) | BaseClass* clone() const
  function saveIndex (line 117) | void saveIndex(FILE* stream)
  function loadIndex (line 123) | void loadIndex(FILE* stream)
  function findNeighbors (line 129) | void findNeighbors(ResultSet<DistanceType>& resultSet, const ElementType...
  function freeIndex (line 151) | void freeIndex()

FILE: algorithms/flann/code/src/cpp/flann/algorithms/lsh_index.h
  function namespace (line 54) | namespace flann
  type typename (line 82) | typedef typename Distance::ResultType DistanceType;
  type NNIndex (line 84) | typedef NNIndex<Distance> BaseClass;
  function virtual (line 133) | virtual ~LshIndex()
  function BaseClass (line 139) | BaseClass* clone() const
  function saveIndex (line 195) | void saveIndex(FILE* stream)
  function loadIndex (line 201) | void loadIndex(FILE* stream)
  function knnSearch (line 224) | int knnSearch(const Matrix<ElementType>& queries,
  function knnSearch (line 279) | int knnSearch(const Matrix<ElementType>& queries,
  function findNeighbors (line 341) | void findNeighbors(ResultSet<DistanceType>& result, const ElementType* v...
  function freeIndex (line 368) | void freeIndex()
  type SortScoreIndexPairOnSecond (line 378) | struct SortScoreIndexPairOnSecond
  function fill_xor_mask (line 392) | void fill_xor_mask(lsh::BucketKey key, int lowest_index, unsigned int le...
  function getNeighbors (line 412) | void getNeighbors(const ElementType* vec, bool do_radius, float radius, ...
  function getNeighbors (line 490) | void getNeighbors(const ElementType* vec, ResultSet<DistanceType>& resul...
  function swap (line 520) | void swap(LshIndex& other)

FILE: algorithms/flann/code/src/cpp/flann/algorithms/nn_index.h
  function namespace (line 43) | namespace flann
  function virtual (line 112) | virtual ~NNIndex()
  function virtual (line 125) | virtual void buildIndex()
  function virtual (line 141) | virtual void buildIndex(const Matrix<ElementType>& dataset)
  function virtual (line 161) | virtual void removePoint(size_t id)
  function virtual (line 187) | virtual ElementType* getPoint(size_t id)
  function virtual (line 301) | virtual int knnSearch(const Matrix<ElementType>& queries,
  function knnSearch (line 363) | int knnSearch(const Matrix<ElementType>& queries,
  function knnSearch (line 390) | int knnSearch(const Matrix<ElementType>& queries,
  function knnSearch (line 461) | int knnSearch(const Matrix<ElementType>& queries,
  function radiusSearch (line 486) | int radiusSearch(const Matrix<ElementType>& queries,
  function radiusSearch (line 569) | int radiusSearch(const Matrix<ElementType>& queries,
  function radiusSearch (line 596) | int radiusSearch(const Matrix<ElementType>& queries,
  function radiusSearch (line 675) | int radiusSearch(const Matrix<ElementType>& queries,
  function id_to_index (line 700) | size_t id_to_index(size_t id)
  function indices_to_ids (line 732) | void indices_to_ids(const size_t* in, size_t* out, size_t size) const
  function setDataset (line 741) | void setDataset(const Matrix<ElementType>& dataset)
  function extendDataset (line 758) | void extendDataset(const Matrix<ElementType>& new_points)
  function cleanRemovedPoints (line 777) | void cleanRemovedPoints()
  function swap (line 797) | void swap(NNIndex& other)

FILE: algorithms/flann/code/src/cpp/flann/defines.h
  function namespace (line 75) | namespace flann {

FILE: algorithms/flann/code/src/cpp/flann/flann.cpp
  type FLANNParameters (line 34) | struct FLANNParameters
  function create_parameters (line 48) | flann::IndexParams create_parameters(FLANNParameters* p)
  function create_search_params (line 105) | flann::SearchParams create_search_params(FLANNParameters* p)
  function update_flann_parameters (line 118) | void update_flann_parameters(const IndexParams& params, FLANNParameters*...
  function init_flann_parameters (line 168) | void init_flann_parameters(FLANNParameters* p)
  function flann_log_verbosity (line 179) | void flann_log_verbosity(int level)
  function flann_set_distance_type (line 187) | void flann_set_distance_type(flann_distance_t distance_type, int order)
  function flann_index_t (line 195) | flann_index_t __flann_build_index(typename Distance::ElementType* datase...
  function flann_index_t (line 228) | flann_index_t _flann_build_index(T* dataset, int rows, int cols, float* ...
  function flann_index_t (line 257) | flann_index_t flann_build_index(float* dataset, int rows, int cols, floa...
  function flann_index_t (line 262) | flann_index_t flann_build_index_float(float* dataset, int rows, int cols...
  function flann_index_t (line 267) | flann_index_t flann_build_index_double(double* dataset, int rows, int co...
  function flann_index_t (line 272) | flann_index_t flann_build_index_byte(unsigned char* dataset, int rows, i...
  function flann_index_t (line 277) | flann_index_t flann_build_index_int(int* dataset, int rows, int cols, fl...
  function __flann_save_index (line 283) | int __flann_save_index(flann_index_t index_ptr, char* filename)
  function _flann_save_index (line 302) | int _flann_save_index(flann_index_t index_ptr, char* filename)
  function flann_save_index (line 331) | int flann_save_index(flann_index_t index_ptr, char* filename)
  function flann_save_index_float (line 336) | int flann_save_index_float(flann_index_t index_ptr, char* filename)
  function flann_save_index_double (line 341) | int flann_save_index_double(flann_index_t index_ptr, char* filename)
  function flann_save_index_byte (line 346) | int flann_save_index_byte(flann_index_t index_ptr, char* filename)
  function flann_save_index_int (line 351) | int flann_save_index_int(flann_index_t index_ptr, char* filename)
  function flann_index_t (line 358) | flann_index_t __flann_load_index(char* filename, typename Distance::Elem...
  function flann_index_t (line 372) | flann_index_t _flann_load_index(char* filename, T* dataset, int rows, in...
  function flann_index_t (line 402) | flann_index_t flann_load_index(char* filename, float* dataset, int rows,...
  function flann_index_t (line 407) | flann_index_t flann_load_index_float(char* filename, float* dataset, int...
  function flann_index_t (line 412) | flann_index_t flann_load_index_double(char* filename, double* dataset, i...
  function flann_index_t (line 417) | flann_index_t flann_load_index_byte(char* filename, unsigned char* datas...
  function flann_index_t (line 422) | flann_index_t flann_load_index_int(char* filename, int* dataset, int row...
  function __flann_find_nearest_neighbors (line 430) | int __flann_find_nearest_neighbors(typename Distance::ElementType* datas...
  function _flann_find_nearest_neighbors (line 459) | int _flann_find_nearest_neighbors(T* dataset,  int rows, int cols, T* te...
  function flann_find_nearest_neighbors (line 489) | int flann_find_nearest_neighbors(float* dataset,  int rows, int cols, fl...
  function flann_find_nearest_neighbors_float (line 494) | int flann_find_nearest_neighbors_float(float* dataset,  int rows, int co...
  function flann_find_nearest_neighbors_double (line 499) | int flann_find_nearest_neighbors_double(double* dataset,  int rows, int ...
  function flann_find_nearest_neighbors_byte (line 504) | int flann_find_nearest_neighbors_byte(unsigned char* dataset,  int rows,...
  function flann_find_nearest_neighbors_int (line 509) | int flann_find_nearest_neighbors_int(int* dataset,  int rows, int cols, ...
  function __flann_find_nearest_neighbors_index (line 516) | int __flann_find_nearest_neighbors_index(flann_index_t index_ptr, typena...
  function _flann_find_nearest_neighbors_index (line 548) | int _flann_find_nearest_neighbors_index(flann_index_t index_ptr, T* test...
  function flann_find_nearest_neighbors_index (line 579) | int flann_find_nearest_neighbors_index(flann_index_t index_ptr, float* t...
  function flann_find_nearest_neighbors_index_float (line 584) | int flann_find_nearest_neighbors_index_float(flann_index_t index_ptr, fl...
  function flann_find_nearest_neighbors_index_double (line 589) | int flann_find_nearest_neighbors_index_double(flann_index_t index_ptr, d...
  function flann_find_nearest_neighbors_index_byte (line 594) | int flann_find_nearest_neighbors_index_byte(flann_index_t index_ptr, uns...
  function flann_find_nearest_neighbors_index_int (line 599) | int flann_find_nearest_neighbors_index_int(flann_index_t index_ptr, int*...
  function __flann_radius_search (line 606) | int __flann_radius_search(flann_index_t index_ptr,
  function _flann_radius_search (line 641) | int _flann_radius_search(flann_index_t index_ptr,
  function flann_radius_search (line 676) | int flann_radius_search(flann_index_t index_ptr,
  function flann_radius_search_float (line 687) | int flann_radius_search_float(flann_index_t index_ptr,
  function flann_radius_search_double (line 698) | int flann_radius_search_double(flann_index_t index_ptr,
  function flann_radius_search_byte (line 709) | int flann_radius_search_byte(flann_index_t index_ptr,
  function flann_radius_search_int (line 720) | int flann_radius_search_int(flann_index_t index_ptr,
  function __flann_free_index (line 733) | int __flann_free_index(flann_index_t index_ptr, FLANNParameters* flann_p...
  function _flann_free_index (line 752) | int _flann_free_index(flann_index_t index_ptr, FLANNParameters* flann_pa...
  function flann_free_index (line 781) | int flann_free_index(flann_index_t index_ptr, FLANNParameters* flann_par...
  function flann_free_index_float (line 786) | int flann_free_index_float(flann_index_t index_ptr, FLANNParameters* fla...
  function flann_free_index_double (line 791) | int flann_free_index_double(flann_index_t index_ptr, FLANNParameters* fl...
  function flann_free_index_byte (line 796) | int flann_free_index_byte(flann_index_t index_ptr, FLANNParameters* flan...
  function flann_free_index_int (line 801) | int flann_free_index_int(flann_index_t index_ptr, FLANNParameters* flann...
  function __flann_compute_cluster_centers (line 808) | int __flann_compute_cluster_centers(typename Distance::ElementType* data...
  function _flann_compute_cluster_centers (line 832) | int _flann_compute_cluster_centers(T* dataset, int rows, int cols, int c...
  function flann_compute_cluster_centers (line 861) | int flann_compute_cluster_centers(float* dataset, int rows, int cols, in...
  function flann_compute_cluster_centers_float (line 866) | int flann_compute_cluster_centers_float(float* dataset, int rows, int co...
  function flann_compute_cluster_centers_double (line 871) | int flann_compute_cluster_centers_double(double* dataset, int rows, int ...
  function flann_compute_cluster_centers_byte (line 876) | int flann_compute_cluster_centers_byte(unsigned char* dataset, int rows,...
  function flann_compute_cluster_centers_int (line 881) | int flann_compute_cluster_centers_int(int* dataset, int rows, int cols, ...

FILE: algorithms/flann/code/src/cpp/flann/flann.h
  type FLANNParameters (line 43) | struct FLANNParameters
  type flann_distance_t (line 101) | enum flann_distance_t
  type FLANNParameters (line 122) | struct FLANNParameters
  type FLANNParameters (line 128) | struct FLANNParameters
  type FLANNParameters (line 134) | struct FLANNParameters
  type FLANNParameters (line 140) | struct FLANNParameters
  type FLANNParameters (line 146) | struct FLANNParameters
  type FLANNParameters (line 229) | struct FLANNParameters
  type FLANNParameters (line 239) | struct FLANNParameters
  type FLANNParameters (line 249) | struct FLANNParameters
  type FLANNParameters (line 259) | struct FLANNParameters
  type FLANNParameters (line 269) | struct FLANNParameters
  type FLANNParameters (line 294) | struct FLANNParameters
  type FLANNParameters (line 302) | struct FLANNParameters
  type FLANNParameters (line 310) | struct FLANNParameters
  type FLANNParameters (line 318) | struct FLANNParameters
  type FLANNParameters (line 326) | struct FLANNParameters
  type FLANNParameters (line 349) | struct FLANNParameters
  type FLANNParameters (line 357) | struct FLANNParameters
  type FLANNParameters (line 365) | struct FLANNParameters
  type FLANNParameters (line 373) | struct FLANNParameters
  type FLANNParameters (line 381) | struct FLANNParameters
  type FLANNParameters (line 393) | struct FLANNParameters
  type FLANNParameters (line 396) | struct FLANNParameters
  type FLANNParameters (line 399) | struct FLANNParameters
  type FLANNParameters (line 402) | struct FLANNParameters
  type FLANNParameters (line 405) | struct FLANNParameters
  type FLANNParameters (line 431) | struct FLANNParameters
  type FLANNParameters (line 438) | struct FLANNParameters
  type FLANNParameters (line 445) | struct FLANNParameters
  type FLANNParameters (line 452) | struct FLANNParameters
  type FLANNParameters (line 459) | struct FLANNParameters

FILE: algorithms/flann/code/src/cpp/flann/flann.hpp
  type flann (line 47) | namespace flann
    function log_verbosity (line 54) | inline void log_verbosity(int level)
    type SavedIndexParams (line 64) | struct SavedIndexParams : public IndexParams
      method SavedIndexParams (line 66) | SavedIndexParams(std::string filename)
    class Index (line 76) | class Index
      method Index (line 83) | Index(const IndexParams& params, Distance distance = Distance() )
      method Index (line 101) | Index(const Matrix<ElementType>& features, const IndexParams& params...
      method Index (line 118) | Index(const Index& other) : loaded_(other.loaded_), index_params_(ot...
      method Index (line 123) | Index& operator=(Index other)
      method buildIndex (line 137) | void buildIndex()
      method buildIndex (line 144) | void buildIndex(const Matrix<ElementType>& points)
      method addPoints (line 149) | void addPoints(const Matrix<ElementType>& points, float rebuild_thre...
      method removePoint (line 158) | void removePoint(size_t point_id)
      method ElementType (line 168) | ElementType* getPoint(size_t point_id)
      method save (line 177) | void save(std::string filename)
      method veclen (line 190) | size_t veclen() const
      method size (line 198) | size_t size() const
      method flann_algorithm_t (line 206) | flann_algorithm_t getType() const
      method usedMemory (line 214) | int usedMemory() const
      method IndexParams (line 223) | IndexParams getParameters() const
      method knnSearch (line 236) | int knnSearch(const Matrix<ElementType>& queries,
      method knnSearch (line 255) | int knnSearch(const Matrix<ElementType>& queries,
      method knnSearch (line 272) | int knnSearch(const Matrix<ElementType>& queries,
      method knnSearch (line 290) | int knnSearch(const Matrix<ElementType>& queries,
      method radiusSearch (line 308) | int radiusSearch(const Matrix<ElementType>& queries,
      method radiusSearch (line 326) | int radiusSearch(const Matrix<ElementType>& queries,
      method radiusSearch (line 344) | int radiusSearch(const Matrix<ElementType>& queries,
      method radiusSearch (line 362) | int radiusSearch(const Matrix<ElementType>& queries,
      method IndexType (line 372) | IndexType* load_saved_index(const Matrix<ElementType>& dataset, cons...
      method swap (line 393) | void swap( Index& other)
    function hierarchicalClustering (line 425) | int hierarchicalClustering(const Matrix<typename Distance::ElementType...

FILE: algorithms/flann/code/src/cpp/flann/general.h
  function namespace (line 39) | namespace flann

FILE: algorithms/flann/code/src/cpp/flann/io/hdf5.h
  function namespace (line 38) | namespace flann

FILE: algorithms/flann/code/src/cpp/flann/kmeans_index.h
  function namespace (line 55) | namespace flann
  type typename (line 89) | typedef typename Distance::ElementType ElementType;
  type typename (line 90) | typedef typename Distance::ResultType DistanceType;
  type NNIndex (line 92) | typedef NNIndex<Distance> BaseClass;
  type needs_vector_space_distance (line 94) | typedef bool needs_vector_space_distance;
  function initCenterChooser (line 170) | void initCenterChooser()
  function virtual (line 192) | virtual ~KMeansIndex()
  function BaseClass (line 198) | BaseClass* clone() const
  function set_cb_index (line 204) | void set_cb_index( float index)
  function saveIndex (line 265) | void saveIndex(FILE* stream)
  function loadIndex (line 271) | void loadIndex(FILE* stream)
  function findNeighbors (line 288) | void findNeighbors(ResultSet<DistanceType>& result, const ElementType* v...
  function getClusterCenters (line 306) | int getClusterCenters(Matrix<DistanceType>& centers)
  type PointInfo (line 361) | struct PointInfo
  type serialization (line 377) | struct serialization
  type Node (line 383) | struct Node
  type KMeansIndex (line 427) | typedef KMeansIndex<Distance> Index;
  type Node (line 461) | typedef Node* NodePtr;
  type BranchStruct (line 466) | typedef BranchStruct<NodePtr, DistanceType> BranchSt;
  function freeIndex (line 472) | void freeIndex()
  function copyTree (line 479) | void copyTree(NodePtr& dst, const NodePtr& src)
  function computeNodeStatistics (line 507) | void computeNodeStatistics(NodePtr node, const std::vector<int>& indices)
  function computeClustering (line 554) | void computeClustering(NodePtr node, int* indices, int indices_length, i...
  function exploreNodeBranches (line 816) | int exploreNodeBranches(NodePtr node, const ElementType* q, Heap<BranchS...
  function getCenterOrdering (line 894) | void getCenterOrdering(NodePtr node, const ElementType* q, std::vector<i...
  function DistanceType (line 916) | DistanceType getDistanceToBorder(DistanceType* p, DistanceType* c, Dista...
  function getMinVarianceClusters (line 940) | int getMinVarianceClusters(NodePtr root, std::vector<NodePtr>& clusters,...
  function addPointToTree (line 983) | void addPointToTree(NodePtr node, size_t index, DistanceType dist_to_pivot)
  function swap (line 1024) | void swap(KMeansIndex& other)

FILE: algorithms/flann/code/src/cpp/flann/mpi/client.h
  function namespace (line 39) | namespace flann {

FILE: algorithms/flann/code/src/cpp/flann/mpi/flann_mpi_client.cpp
  function start_timer (line 15) | void start_timer(const std::string& message = "")
  function stop_timer (line 24) | double stop_timer()
  function compute_precision (line 32) | float compute_precision(const flann::Matrix<int>& match, const flann::Ma...
  function main (line 53) | int main(int argc, char* argv[])

FILE: algorithms/flann/code/src/cpp/flann/mpi/flann_mpi_server.cpp
  function main (line 6) | int main(int argc, char* argv[])

FILE: algorithms/flann/code/src/cpp/flann/mpi/index.h
  function namespace (line 40) | namespace mpi

FILE: algorithms/flann/code/src/cpp/flann/mpi/matrix.h
  function namespace (line 37) | namespace boost {

FILE: algorithms/flann/code/src/cpp/flann/mpi/queries.h
  function namespace (line 38) | namespace flann

FILE: algorithms/flann/code/src/cpp/flann/mpi/server.h
  function namespace (line 46) | namespace flann {

FILE: algorithms/flann/code/src/cpp/flann/nn/ground_truth.h
  type typename (line 45) | typedef typename Distance::ElementType ElementType;
  type typename (line 46) | typedef typename Distance::ResultType DistanceType;

FILE: algorithms/flann/code/src/cpp/flann/nn/index_testing.h
  function namespace (line 45) | namespace flann

FILE: algorithms/flann/code/src/cpp/flann/nn/simplex_downhill.h
  function namespace (line 34) | namespace flann

FILE: algorithms/flann/code
Copy disabled (too large) Download .json
Condensed preview — 1093 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (11,914K chars).
[
  {
    "path": ".gitignore",
    "chars": 273,
    "preview": "# mac file\n.DS_Store\n\n# Compiled Object files\n*.slo\n*.lo\n*.o\n*.obj\n\n# Precompiled Headers\n*.gch\n*.pch\n\n# Compiled Dynami"
  },
  {
    "path": "README.md",
    "chars": 19468,
    "preview": "# NNS Benchmark: Evaluating Approximate Nearest Neighbor Search Algorithms in High Dimensional Euclidean Space\n\nNearest "
  },
  {
    "path": "algorithms/AGH/README.md",
    "chars": 1311,
    "preview": "# AGH - Anchor-based Graph Hashing\n\nThis is a modified version of AGH. The original version can be downloaded from [here"
  },
  {
    "path": "algorithms/AGH/preprocess/OneLayerAGH_Test.m",
    "chars": 1078,
    "preview": "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\nfunction Y = OneLayerAGH_Test(X, Anchor, W, s, si"
  },
  {
    "path": "algorithms/AGH/preprocess/OneLayerAGH_Train.m",
    "chars": 1711,
    "preview": "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\nfunction [Y, W, sigma] = OneLayerAGH_Train(X, Anc"
  },
  {
    "path": "algorithms/AGH/preprocess/TwoLayerAGH_Test.m",
    "chars": 1321,
    "preview": "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\nfunction Y = TwoLayerAGH_Test(X, Anchor, W, Thres"
  },
  {
    "path": "algorithms/AGH/preprocess/TwoLayerAGH_Train.m",
    "chars": 2467,
    "preview": "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\nfunction [Y, W, Thres, sigma] = TwoLayerAGH_Train"
  },
  {
    "path": "algorithms/AGH/preprocess/compactbit.m",
    "chars": 475,
    "preview": "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\nfunction cb = compactbit(b)\r\n%\r\n% Written by Rob "
  },
  {
    "path": "algorithms/AGH/preprocess/fvecs_read.m",
    "chars": 1425,
    "preview": "% Read a set of vectors stored in the fvec format (int + n * float)\r\n% The function returns a set of output vector (one "
  },
  {
    "path": "algorithms/AGH/preprocess/get_anchor.m",
    "chars": 471,
    "preview": "function get_anchor(data_path,anchor_path,m)\ndataset = fvecs_read(data_path);\ndataset=dataset';\nn=size(dataset,1);\np=200"
  },
  {
    "path": "algorithms/AGH/preprocess/hammingDist.m",
    "chars": 1683,
    "preview": "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\nfunction Dh=hammingDist(B1, B2)\r\n%\r\n% Written by "
  },
  {
    "path": "algorithms/AGH/preprocess/ivecs_read.m",
    "chars": 1417,
    "preview": "% Read a set of vectors stored in the ivec format (int + n * int)\r\n% The function returns a set of output vector (one ve"
  },
  {
    "path": "algorithms/AGH/preprocess/ivecs_write.m",
    "chars": 561,
    "preview": "% This function writes a vector from a file in the ivecs format\n\nfunction ivecs_write (filename, v)\n\n% open the file and"
  },
  {
    "path": "algorithms/AGH/preprocess/main.m",
    "chars": 841,
    "preview": "% data_path: the full path of the dataset\n% m: the number of anchor\n% s: the number of the nearest anchors need to be co"
  },
  {
    "path": "algorithms/AGH/preprocess/main_OneLayer.m",
    "chars": 671,
    "preview": "function main_c_OneLayer(data_path, anchor_path, params_path,B1_path,s,bit)\n\ndataset = fvecs_read(data_path); \ndataset=d"
  },
  {
    "path": "algorithms/AGH/preprocess/main_TwoLayer.m",
    "chars": 778,
    "preview": "function main_c_TwoLayer(data_path, anchor_path, params_path,B1_path,s,bit)\n\ntraindata = fvecs_read(data_path);\ntraindat"
  },
  {
    "path": "algorithms/AGH/preprocess/main_c_OneLayer.m~",
    "chars": 672,
    "preview": "function main_c_OneLayer(data_path, anchor_path,indices_path,B1_path,s,bit)\n\ndataset = fvecs_read(data_path); \ndataset=d"
  },
  {
    "path": "algorithms/AGH/preprocess/main_c_TwoLayer.m~",
    "chars": 770,
    "preview": "function main_c_TwoLayer(data_path, anchor_path,indices_path,B1_path,s,bit)\n\ntraindata = fvecs_read(data_path);\ntraindat"
  },
  {
    "path": "algorithms/AGH/preprocess/sqdist.m",
    "chars": 390,
    "preview": "function d=sqdist(a,b)\r\n% SQDIST - computes squared Euclidean distance matrix\r\n%          computes a rectangular matrix "
  },
  {
    "path": "algorithms/AGH/script/searcher.sh",
    "chars": 1000,
    "preview": "\ndata_path=\"../../../data\"\nresult_path=\"../results\"\nmkdir ${result_path}\n\ncd ../src\n\nk=20\n\nfor data in \"audio\"\ndo\n\ndatas"
  },
  {
    "path": "algorithms/AGH/src/AGH.cpp",
    "chars": 4817,
    "preview": "#include \"data_util.h\"\n#include \"AGH.h\"\n#include \"hammingDist.h\"\n#include \"eval.h\"\n\n#include <cstring>\n#include <malloc."
  },
  {
    "path": "algorithms/AGH/src/AGH.h",
    "chars": 5334,
    "preview": "#include <vector>\n#include <cmath>\n#include <cstring>\n#include <malloc.h>\n#include <getopt.h>\n#include <cstdlib>\n#includ"
  },
  {
    "path": "algorithms/AGH/src/Makefile",
    "chars": 511,
    "preview": "##############\n# Make the AGH project\n##############\n\nPROD\t:= DEBUG\nOPT     := -O3 -march=native \nVERSION := \\\"0.1_${PRO"
  },
  {
    "path": "algorithms/AGH/src/center_chooser.h",
    "chars": 1439,
    "preview": "#include \"random.h\"\n#include \"char_bit_cnt.h\"\n\nclass CenterChooser\n{\n\tvector<vector<unsigned>* > dataset_;\npublic:\n\n\tvoi"
  },
  {
    "path": "algorithms/AGH/src/char_bit_cnt.h",
    "chars": 1313,
    "preview": "unsigned char_bit_cnt [] = {\n0x0,\n0x1,\n0x1,\n0x2,\n0x1,\n0x2,\n0x2,\n0x3,\n0x1,\n0x2,\n0x2,\n0x3,\n0x2,\n0x3,\n0x3,\n0x4,\n0x1,\n0x2,\n0"
  },
  {
    "path": "algorithms/AGH/src/data_util.h",
    "chars": 4051,
    "preview": "#include <cstring>\n#include <malloc.h>\n#include <vector>\n#include <cmath>\n#include <iostream>\n#include <fstream>\n#includ"
  },
  {
    "path": "algorithms/AGH/src/dynamic_bitset.h",
    "chars": 1158,
    "preview": "#include <limits.h>\n\nclass DynamicBitset\n{\npublic:\n    /** @param only constructor we use in our code\n     * @param the "
  },
  {
    "path": "algorithms/AGH/src/eval.h",
    "chars": 6267,
    "preview": "#ifndef EVAL_H_\n#define EVAL_H_\n\n#include <vector>\n#include <cmath>\n#include <cstring>\n#include <malloc.h>\n#include <get"
  },
  {
    "path": "algorithms/AGH/src/hammingDist.h",
    "chars": 4449,
    "preview": "#ifndef HAMMINGDIST_H_\n#define HAMMINGDIST_H_\n\n#include <vector>\n#include <cmath>\n#include <cstring>\n#include <malloc.h>"
  },
  {
    "path": "algorithms/AGH/src/heap.h",
    "chars": 8068,
    "preview": "#include <algorithm>\n#include <vector>\n\n\ntemplate <typename T>\nclass Heap\n{\n\n    /**\n     * Storage array for the heap.\n"
  },
  {
    "path": "algorithms/AGH/src/hierarchical_clustering_index.h",
    "chars": 9279,
    "preview": "#include <algorithm>\n#include <string>\n#include <cmath>\n#include <vector>\n#include <iostream>\n#include \"center_chooser.h"
  },
  {
    "path": "algorithms/AGH/src/random.h",
    "chars": 2101,
    "preview": "#include <algorithm>\n#include <cstdlib>\n#include <cstddef>\n#include <vector>\n/**\n * Seeds the random number generator\n *"
  },
  {
    "path": "algorithms/AGH/src/result_set.h",
    "chars": 3017,
    "preview": "#include <algorithm>\n#include <cstring>\n#include <iostream>\n#include <limits>\n#include <set>\n#include <vector>\n\n\nstruct "
  },
  {
    "path": "algorithms/Annoy/README.html",
    "chars": 1765,
    "preview": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\""
  },
  {
    "path": "algorithms/Annoy/README.md",
    "chars": 1079,
    "preview": "# Annoy \n\nAnnoy (Approximate Nearest Neighbors Oh Yeah) is a C++ library with Python\nbindings to search for approximate "
  },
  {
    "path": "algorithms/Annoy/script/indexer.sh",
    "chars": 181,
    "preview": "data_path=$1 # ./fvecs\ntrees=$2     # the number of tree\nindex_path=$3    \nindextime_path=$4\n\ncd ../src\n\n./indexer -i ${"
  },
  {
    "path": "algorithms/Annoy/script/run.sh",
    "chars": 316,
    "preview": "\nk=20\nntree=50\n\nmkdir ../index \nsh ./indexer.sh ../../../data/audio_base.fvecs ${ntree} ../index/audio.${ntree}tree ../i"
  },
  {
    "path": "algorithms/Annoy/script/searcher.sh",
    "chars": 239,
    "preview": "index_path=$1\nquery_path=$2 # ./fvecs\ngnd_path=$3 # ./ivecs\nk=$4\noutput_path=$5\n\ncd ../src\n\nfor stop in 100 300 400 500 "
  },
  {
    "path": "algorithms/Annoy/src/Makefile",
    "chars": 497,
    "preview": "CC=g++\nCCFLAGS=-O3 -lm -fPIC -fomit-frame-pointer -fno-stack-protector \nCPP_FILES=annoy.cpp\nOBJ_FILES=$(CPP_FILES:%.cpp="
  },
  {
    "path": "algorithms/Annoy/src/annoy.cpp",
    "chars": 17917,
    "preview": "// Copyright (c) 2013 Spotify AB\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n// us"
  },
  {
    "path": "algorithms/Annoy/src/data.h",
    "chars": 16208,
    "preview": "#ifndef WDONG_KGRAPH_DATA\n#define WDONG_KGRAPH_DATA\n\n#include <cstring>\n#include <malloc.h>\n#include <vector>\n#include <"
  },
  {
    "path": "algorithms/Annoy/src/indexer.cpp",
    "chars": 2737,
    "preview": "#include <iostream>\n#include <fstream>\n#include <cctype>\n#include <ctime>\n#include <time.h>\n#include <sys/time.h>\n#inclu"
  },
  {
    "path": "algorithms/Annoy/src/kissrandom.h",
    "chars": 2118,
    "preview": "#ifndef KISSRANDOM_H\n#define KISSRANDOM_H\n\n#include <stdint.h>\n\n// KISS = \"keep it simple, stupid\", but high quality ran"
  },
  {
    "path": "algorithms/Annoy/src/searcher.cpp",
    "chars": 4219,
    "preview": "#include <iostream>\n#include <fstream>\n#include <cctype>\n#include <ctime>\n#include <time.h>\n#include <sys/time.h>\n#inclu"
  },
  {
    "path": "algorithms/DPG/README.html",
    "chars": 3070,
    "preview": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\""
  },
  {
    "path": "algorithms/DPG/README.md",
    "chars": 2130,
    "preview": "# DPG\n\nDiversified Proximity Graph (**DPG**) is an extension of [**KGraph**](http://www.kgraph.org/) which maximizes the"
  },
  {
    "path": "algorithms/DPG/script/build_index.sh",
    "chars": 655,
    "preview": "data_dir=\"../../../data\"\nindex_dir=\"../index\"\nbin_dir=\"../src\"\n\nmkdir ${index_dir} \n\n# Please sure the data ( data point"
  },
  {
    "path": "algorithms/DPG/script/search.sh",
    "chars": 731,
    "preview": "\ndata_dir=\"../../../data\"\nindex_dir=\"../index\"\nbin_dir=\"../src\"\nresult_dir=\"../results\"\n\n\nmkdir ${result_dir}\n\n\nk=20\nL=2"
  },
  {
    "path": "algorithms/DPG/src/DPG_diverse.cpp",
    "chars": 3105,
    "preview": "#include <cctype>\n#include <type_traits>\n#include <iostream>\n#include <boost/timer/timer.hpp>\n#include <boost/program_op"
  },
  {
    "path": "algorithms/DPG/src/DPG_index.cpp",
    "chars": 6181,
    "preview": "#ifndef KGRAPH_VALUE_TYPE\n#define KGRAPH_VALUE_TYPE float\n#endif\n\n\n#include <cctype>\n#include <type_traits>\n#include <io"
  },
  {
    "path": "algorithms/DPG/src/DPG_search.cpp",
    "chars": 5133,
    "preview": "#include <cctype>\n#include <type_traits>\n#include <iostream>\n#include <boost/timer/timer.hpp>\n#include <boost/program_op"
  },
  {
    "path": "algorithms/DPG/src/Makefile",
    "chars": 742,
    "preview": "CC=g++ \n\n#ARCH=-msse2\nOPT=-O3\n#OPENMP=-fopenmp\nboost_dir=\"/home/yingz/Software/boost_1_58_0/\"\nboost_lib=\"/usr/local/lib\""
  },
  {
    "path": "algorithms/DPG/src/RandGen.cpp",
    "chars": 1939,
    "preview": "/*\n *   This file is part of SRS project.\n *\n *   SRS is free software: you can redistribute it and/or modify\n *   it un"
  },
  {
    "path": "algorithms/DPG/src/RandGen.h",
    "chars": 923,
    "preview": "/*\n *   This file is part of SRS project.\n *\n *   SRS is free software: you can redistribute it and/or modify\n *   it un"
  },
  {
    "path": "algorithms/DPG/src/build.sh",
    "chars": 60,
    "preview": "make DPG_index\nmake DPG_diverse\nmake DPG_search\n\nmake clean\n"
  },
  {
    "path": "algorithms/DPG/src/kgraph-data.h",
    "chars": 16208,
    "preview": "#ifndef WDONG_KGRAPH_DATA\n#define WDONG_KGRAPH_DATA\n\n#include <cstring>\n#include <malloc.h>\n#include <vector>\n#include <"
  },
  {
    "path": "algorithms/DPG/src/kgraph.cpp",
    "chars": 83074,
    "preview": "//static char const *kgraph_version = KGRAPH_VERSION \"-\" KGRAPH_BUILD_NUMBER \",\" KGRAPH_BUILD_ID;\nstatic char const *kgr"
  },
  {
    "path": "algorithms/DPG/src/kgraph.h",
    "chars": 13291,
    "preview": "// Copyright (C) 2013-2015 Wei Dong <wdong@wdong.org>. All Rights Reserved.\n//\n// \\mainpage KGraph: A Library for Effici"
  },
  {
    "path": "algorithms/DPG/src/main.cpp",
    "chars": 15700,
    "preview": "/* \n    Copyright (C) 2010,2011 Wei Dong <wdong.pku@gmail.com>. All Rights Reserved.\n\n    DISTRIBUTION OF THIS PROGRAM I"
  },
  {
    "path": "algorithms/DPG/src/metric.cpp",
    "chars": 5718,
    "preview": "#include \"kgraph.h\"\n#include \"kgraph-data.h\"\n#include <math.h>\n\n#ifdef __GNUC__\n#ifdef __AVX__\n#include <immintrin.h>\n#d"
  },
  {
    "path": "algorithms/KGraph/README.html",
    "chars": 2850,
    "preview": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\""
  },
  {
    "path": "algorithms/KGraph/README.md",
    "chars": 1858,
    "preview": "# KGraph\n\nThis is a modified version of [**KGraph**](http://www.kgraph.org) from the\nKGraph source code obtained on 5 Ap"
  },
  {
    "path": "algorithms/KGraph/script/kgraph_index.sh",
    "chars": 526,
    "preview": "data_dir=\"../../../data\"\nindex_dir=\"../index\"\nbin_dir=\"../src\"\n\nmkdir ${index_dir} \n\n\n# Please sure the data ( data poin"
  },
  {
    "path": "algorithms/KGraph/script/kgraph_search.sh",
    "chars": 786,
    "preview": "data_dir=\"../../../data\"\nindex_dir=\"../index\"\nbin_dir=\"../src\"\n\nresult_dir=\"../results\"\n\nmkdir ${result_dir}\n\n\nk=20\nL=40"
  },
  {
    "path": "algorithms/KGraph/src/Makefile",
    "chars": 737,
    "preview": "CC=g++ \n\n#ARCH=-msse2\n#OPENMP=-fopenmp\n\nOPT=-O3\n\nboost_dir=\"/home/yingz/Software/boost_1_58_0/\"\nboost_lib=\"/usr/local/li"
  },
  {
    "path": "algorithms/KGraph/src/RandGen.cpp",
    "chars": 1939,
    "preview": "/*\n *   This file is part of SRS project.\n *\n *   SRS is free software: you can redistribute it and/or modify\n *   it un"
  },
  {
    "path": "algorithms/KGraph/src/RandGen.h",
    "chars": 923,
    "preview": "/*\n *   This file is part of SRS project.\n *\n *   SRS is free software: you can redistribute it and/or modify\n *   it un"
  },
  {
    "path": "algorithms/KGraph/src/build.sh",
    "chars": 51,
    "preview": "make kgraph_index \nmake kgraph_search\n\nmake clean\n\n"
  },
  {
    "path": "algorithms/KGraph/src/kgraph-data.h",
    "chars": 16208,
    "preview": "#ifndef WDONG_KGRAPH_DATA\n#define WDONG_KGRAPH_DATA\n\n#include <cstring>\n#include <malloc.h>\n#include <vector>\n#include <"
  },
  {
    "path": "algorithms/KGraph/src/kgraph.cpp",
    "chars": 82794,
    "preview": "//static char const *kgraph_version = KGRAPH_VERSION \"-\" KGRAPH_BUILD_NUMBER \",\" KGRAPH_BUILD_ID;\nstatic char const *kgr"
  },
  {
    "path": "algorithms/KGraph/src/kgraph.h",
    "chars": 13272,
    "preview": "// Copyright (C) 2013-2015 Wei Dong <wdong@wdong.org>. All Rights Reserved.\n//\n// \\mainpage KGraph: A Library for Effici"
  },
  {
    "path": "algorithms/KGraph/src/kgraph_index.cpp",
    "chars": 6180,
    "preview": "#ifndef KGRAPH_VALUE_TYPE\n#define KGRAPH_VALUE_TYPE float\n#endif\n\n\n#include <cctype>\n#include <type_traits>\n#include <io"
  },
  {
    "path": "algorithms/KGraph/src/kgraph_search.cpp",
    "chars": 5133,
    "preview": "#include <cctype>\n#include <type_traits>\n#include <iostream>\n#include <boost/timer/timer.hpp>\n#include <boost/program_op"
  },
  {
    "path": "algorithms/KGraph/src/metric.cpp",
    "chars": 5718,
    "preview": "#include \"kgraph.h\"\n#include \"kgraph-data.h\"\n#include <math.h>\n\n#ifdef __GNUC__\n#ifdef __AVX__\n#include <immintrin.h>\n#d"
  },
  {
    "path": "algorithms/NMSLIB/README.md",
    "chars": 1343,
    "preview": "NonMetricSpaceLib\n======================================================\n\nThis is a modified version of NonMetricSpaceLi"
  },
  {
    "path": "algorithms/NMSLIB/code/CMakeFiles/3.2.3/CMakeCCompiler.cmake",
    "chars": 1899,
    "preview": "set(CMAKE_C_COMPILER \"/opt/rh/devtoolset-2/root/usr/bin/cc\")\nset(CMAKE_C_COMPILER_ARG1 \"\")\nset(CMAKE_C_COMPILER_ID \"GNU\""
  },
  {
    "path": "algorithms/NMSLIB/code/CMakeFiles/3.2.3/CMakeCXXCompiler.cmake",
    "chars": 3920,
    "preview": "set(CMAKE_CXX_COMPILER \"/opt/rh/devtoolset-2/root/usr/bin/c++\")\nset(CMAKE_CXX_COMPILER_ARG1 \"\")\nset(CMAKE_CXX_COMPILER_I"
  },
  {
    "path": "algorithms/NMSLIB/code/CMakeFiles/3.2.3/CMakeSystem.cmake",
    "chars": 438,
    "preview": "set(CMAKE_HOST_SYSTEM \"Linux-2.6.32-573.12.1.el6.x86_64\")\nset(CMAKE_HOST_SYSTEM_NAME \"Linux\")\nset(CMAKE_HOST_SYSTEM_VERS"
  },
  {
    "path": "algorithms/NMSLIB/code/CMakeFiles/3.2.3/CompilerIdC/CMakeCCompilerId.c",
    "chars": 15134,
    "preview": "#ifdef __cplusplus\n# error \"A C++ compiler has been selected for C.\"\n#endif\n\n#if defined(__18CXX)\n# define ID_VOID_MAIN\n"
  },
  {
    "path": "algorithms/NMSLIB/code/CMakeFiles/3.2.3/CompilerIdCXX/CMakeCXXCompilerId.cpp",
    "chars": 15160,
    "preview": "/* This source file must have a .cpp extension so that all C++ compilers\n   recognize the extension without flags.  Borl"
  },
  {
    "path": "algorithms/NMSLIB/code/CMakeFiles/CMakeDirectoryInformation.cmake",
    "chars": 669,
    "preview": "# CMAKE generated file: DO NOT EDIT!\n# Generated by \"Unix Makefiles\" Generator, CMake Version 3.2\n\n# Relative path conve"
  },
  {
    "path": "algorithms/NMSLIB/code/CMakeFiles/CMakeError.log",
    "chars": 11539,
    "preview": "Determining if the pthread_create exist failed with the following output:\nChange Dir: /home/yzhang4/HD/home/liwen/Docume"
  },
  {
    "path": "algorithms/NMSLIB/code/CMakeFiles/CMakeOutput.log",
    "chars": 58270,
    "preview": "The system is: Linux - 2.6.32-573.12.1.el6.x86_64 - x86_64\nCompiling the C compiler identification source file \"CMakeCCo"
  },
  {
    "path": "algorithms/NMSLIB/code/CMakeFiles/Makefile.cmake",
    "chars": 4045,
    "preview": "# CMAKE generated file: DO NOT EDIT!\n# Generated by \"Unix Makefiles\" Generator, CMake Version 3.2\n\n# The generator used "
  },
  {
    "path": "algorithms/NMSLIB/code/CMakeFiles/Makefile2",
    "chars": 21724,
    "preview": "# CMAKE generated file: DO NOT EDIT!\n# Generated by \"Unix Makefiles\" Generator, CMake Version 3.2\n\n# Default target exec"
  },
  {
    "path": "algorithms/NMSLIB/code/CMakeFiles/TargetDirectories.txt",
    "chars": 881,
    "preview": "/home/yzhang4/HD/release/algorithms/NMSLIB/code/src/CMakeFiles/tune_vptree.dir\n/home/yzhang4/HD/release/algorithms/NMSLI"
  },
  {
    "path": "algorithms/NMSLIB/code/CMakeFiles/cmake.check_cache",
    "chars": 85,
    "preview": "# This file is generated by cmake for dependency checking of the CMakeCache.txt file\n"
  },
  {
    "path": "algorithms/NMSLIB/code/CMakeFiles/feature_tests.c",
    "chars": 686,
    "preview": "\n  const char features[] = {\"\"\n\"C_FEATURE:\"\n#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404\n\"1\"\n#else\n\"0\"\n#endif\n\"c_functio"
  },
  {
    "path": "algorithms/NMSLIB/code/CMakeFiles/feature_tests.cxx",
    "chars": 10009,
    "preview": "\n  const char features[] = {\"\"\n\"CXX_FEATURE:\"\n#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L\n\"1\""
  },
  {
    "path": "algorithms/NMSLIB/code/CMakeFiles/progress.marks",
    "chars": 3,
    "preview": "89\n"
  },
  {
    "path": "algorithms/NMSLIB/code/CMakeLists.txt",
    "chars": 5478,
    "preview": "#\n# Non-metric Space Library\n#\n# Authors: Bilegsaikhan Naidan, Leonid Boytsov.\n#\n# This code is released under the\n# Apa"
  },
  {
    "path": "algorithms/NMSLIB/code/CMakeLists.txt~",
    "chars": 5478,
    "preview": "#\n# Non-metric Space Library\n#\n# Authors: Bilegsaikhan Naidan, Leonid Boytsov.\n#\n# This code is released under the\n# Apa"
  },
  {
    "path": "algorithms/NMSLIB/code/FindEigen3.cmake",
    "chars": 2995,
    "preview": "# - Try to find Eigen3 lib\n#\n# This module supports requiring a minimum version, e.g. you can do\n#   find_package(Eigen3"
  },
  {
    "path": "algorithms/NMSLIB/code/FindGSL.cmake",
    "chars": 5274,
    "preview": "# Try to find gnu scientific library GSL\n# See \n# http://www.gnu.org/software/gsl/  and \n# http://gnuwin32.sourceforge.n"
  },
  {
    "path": "algorithms/NMSLIB/code/Makefile",
    "chars": 10354,
    "preview": "# CMAKE generated file: DO NOT EDIT!\n# Generated by \"Unix Makefiles\" Generator, CMake Version 3.2\n\n# Default target exec"
  },
  {
    "path": "algorithms/NMSLIB/code/NonMetricSpaceLib.sln",
    "chars": 7452,
    "preview": "Microsoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Express 2013 for Windows Desktop\nVisualStudi"
  },
  {
    "path": "algorithms/NMSLIB/code/cmake_install.cmake",
    "chars": 1768,
    "preview": "# Install script for directory: /home/yzhang4/HD/release/algorithms/NMSLIB/code\n\n# Set the install prefix\nif(NOT DEFINED"
  },
  {
    "path": "algorithms/NMSLIB/code/include/cluster_util.h",
    "chars": 7415,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/distcomp.h",
    "chars": 6819,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/distcomp_edist.h",
    "chars": 1085,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/eval_metrics.h",
    "chars": 8387,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/eval_results.h",
    "chars": 8146,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/experimentconf.h",
    "chars": 6578,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/experiments.h",
    "chars": 16593,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/init_methods.h",
    "chars": 9986,
    "preview": "#ifndef INIT_METHODS_H\n#define INIT_METHODS_H\n/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https:"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/init_spaces.h",
    "chars": 6413,
    "preview": "#ifndef INIT_SPACES_H\n#define INIT_SPACES_H\n/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/method/bbtree.h",
    "chars": 948,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/method/dummy.h",
    "chars": 948,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/method/ghtree.h",
    "chars": 948,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/method/hnsw.h",
    "chars": 1258,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/method/list_clusters.h",
    "chars": 981,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/method/lsh.h",
    "chars": 2127,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/method/lsh_multiprobe.h",
    "chars": 1075,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/method/multi_index.h",
    "chars": 995,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/method/multi_vantage_point_tree.h",
    "chars": 1007,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/method/nndes.h",
    "chars": 971,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/method/nonmetr_list_clust.h",
    "chars": 1054,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/method/omedrank.h",
    "chars": 1030,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/method/perm_bin_vptree.h",
    "chars": 1028,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/method/perm_index_incr_bin.h",
    "chars": 1232,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/method/perm_lsh_bin.h",
    "chars": 1111,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/method/permutation_inverted_index.h",
    "chars": 959,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/method/permutation_prefix_index.h",
    "chars": 1028,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/method/pivot_neighb_invindx.h",
    "chars": 986,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/method/proj_vptree.h",
    "chars": 1072,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/method/projection_index_incremental.h",
    "chars": 1137,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/method/seqsearch.h",
    "chars": 960,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/method/small_world_rand.h",
    "chars": 1461,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/method/spatial_approx_tree.h",
    "chars": 963,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/method/vptree.h",
    "chars": 1075,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/space/space_bit_hamming.h",
    "chars": 797,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/space/space_bregman.h",
    "chars": 1566,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/space/space_dummy.h",
    "chars": 972,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/space/space_edist.h",
    "chars": 879,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/space/space_js.h",
    "chars": 1757,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/space/space_lp.h",
    "chars": 1269,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/space/space_savch.h",
    "chars": 2719,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/space/space_scalar.h",
    "chars": 1025,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/space/space_sparse_lp.h",
    "chars": 1339,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/space/space_sparse_scalar.h",
    "chars": 1439,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/space/space_sqfd.h",
    "chars": 1379,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/factory/space/space_word_embed.h",
    "chars": 1212,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/flexbuff.h",
    "chars": 2820,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/floatdiff.h",
    "chars": 4101,
    "preview": "// -*- c++ -*-\n//\n// Copyright 2005, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and bina"
  },
  {
    "path": "algorithms/NMSLIB/code/include/global.h",
    "chars": 1342,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/gold_standard.h",
    "chars": 13774,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/idtype.h",
    "chars": 1575,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/incremental_quick_select.h",
    "chars": 1883,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/index.h",
    "chars": 3009,
    "preview": "/**\n * Non-metric Space Library\n *#\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://b"
  },
  {
    "path": "algorithms/NMSLIB/code/include/init.h",
    "chars": 747,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/knnquery.h",
    "chars": 1601,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/knnqueue.h",
    "chars": 1911,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/logging.h",
    "chars": 2565,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/memory.h",
    "chars": 797,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/meta_analysis.h",
    "chars": 11065,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/bbtree.h",
    "chars": 3961,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/dummy.h",
    "chars": 3609,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/ghtree.h",
    "chars": 2484,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/hnsw.h",
    "chars": 18492,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/lcstrategy.h",
    "chars": 1068,
    "preview": "#ifndef _LIST_OF_CLUSTERS_STRAT_H_\n#define _LIST_OF_CLUSTERS_STRAT_H_\n\n#include <iostream>\n\nnamespace similarity {\n\nenum"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/list_clusters.h",
    "chars": 3130,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/lsh.h",
    "chars": 4763,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/lsh_multiprobe.h",
    "chars": 2658,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/lsh_space.h",
    "chars": 1579,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/multi_index.h",
    "chars": 2138,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/multi_vantage_point_tree.h",
    "chars": 5045,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/multi_vantage_point_tree_utils.h",
    "chars": 1259,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/nndes.h",
    "chars": 4530,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/nonmetr_list_clust.h",
    "chars": 3196,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/omedrank.h",
    "chars": 4543,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/perm_bin_vptree.h",
    "chars": 2285,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/perm_index_incr_bin.h",
    "chars": 2588,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/perm_lsh_bin.h",
    "chars": 2768,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/permutation_inverted_index.h",
    "chars": 2711,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/permutation_prefix_index.h",
    "chars": 2465,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/pivot_neighb_common.h",
    "chars": 1253,
    "preview": "\n#ifndef NONMETRICSPACELIB_PIVOT_NEIGHB_COMMON_H_H\n#define NONMETRICSPACELIB_PIVOT_NEIGHB_COMMON_H_H\n\n#include <idtype.h"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/pivot_neighb_invindx.h",
    "chars": 4628,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/proj_vptree.h",
    "chars": 2473,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/projection_index_incremental.h",
    "chars": 3399,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/seqsearch.h",
    "chars": 1725,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/small_world_rand.h",
    "chars": 5973,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/small_world_rand_split.h",
    "chars": 6215,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/spatial_approx_tree.h",
    "chars": 1572,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/vptree.h",
    "chars": 3498,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/method/vptree_utils.h",
    "chars": 2463,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/methodfactory.h",
    "chars": 2153,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/nndes/nndes-common.h",
    "chars": 6610,
    "preview": "/*\nCopyright (C) 2010,2011 Wei Dong <wdong@wdong.org>\nAll rights reserved.\n\nRedistribution and use in source and binary "
  },
  {
    "path": "algorithms/NMSLIB/code/include/nndes/nndes.h",
    "chars": 9287,
    "preview": "/*\nCopyright (C) 2010,2011 Wei Dong <wdong@wdong.org>\nAll rights reserved.\n\nRedistribution and use in source and binary "
  },
  {
    "path": "algorithms/NMSLIB/code/include/object.h",
    "chars": 8651,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/params.h",
    "chars": 9135,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/params_cmdline.h",
    "chars": 2313,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/params_def.h",
    "chars": 4714,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/permutation_type.h",
    "chars": 893,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/permutation_utils.h",
    "chars": 5589,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/ported_boost_progress.h",
    "chars": 4148,
    "preview": "//  boost progress.hpp header file  ------------------------------------------//\n\n//  Copyright Beman Dawes 1994-99.  Di"
  },
  {
    "path": "algorithms/NMSLIB/code/include/pow.h",
    "chars": 3554,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/projection.h",
    "chars": 4655,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/query.h",
    "chars": 1622,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/query_creator.h",
    "chars": 1580,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  },
  {
    "path": "algorithms/NMSLIB/code/include/randproj_util.h",
    "chars": 1432,
    "preview": "/**\n * Non-metric Space Library\n *\n * Authors: Bilegsaikhan Naidan (https://github.com/bileg), Leonid Boytsov (http://bo"
  }
]

// ... and 893 more files (download for full content)

About this extraction

This page contains the full source code of the DBWangGroupUNSW/nns_benchmark GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 1093 files (90.4 MB), approximately 2.9M tokens, and a symbol index with 2608 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!