├── test_files ├── query.txt └── data.txt ├── Doxygen └── html │ ├── bc_s.png │ ├── bdwn.png │ ├── nav_f.png │ ├── nav_g.png │ ├── nav_h.png │ ├── open.png │ ├── tab_a.png │ ├── tab_b.png │ ├── tab_h.png │ ├── tab_s.png │ ├── closed.png │ ├── doxygen.png │ ├── ftv2doc.png │ ├── ftv2link.png │ ├── ftv2node.png │ ├── sync_off.png │ ├── sync_on.png │ ├── ftv2blank.png │ ├── ftv2mnode.png │ ├── ftv2pnode.png │ ├── ftv2lastnode.png │ ├── ftv2mlastnode.png │ ├── ftv2plastnode.png │ ├── ftv2splitbar.png │ ├── ftv2vertline.png │ ├── search │ ├── close.png │ ├── files_4.js │ ├── mag_sel.png │ ├── search_l.png │ ├── search_m.png │ ├── search_r.png │ ├── files_8.js │ ├── files_5.js │ ├── all_12.js │ ├── typedefs_1.js │ ├── variables_5.js │ ├── all_9.js │ ├── classes_0.js │ ├── files_0.js │ ├── functions_9.js │ ├── variables_2.js │ ├── classes_1.js │ ├── files_1.js │ ├── variables_0.js │ ├── variables_1.js │ ├── files_6.js │ ├── enumvalues_1.js │ ├── functions_8.js │ ├── classes_3.js │ ├── enumvalues_0.js │ ├── files_3.js │ ├── files_2.js │ ├── all_8.js │ ├── classes_2.js │ ├── files_7.js │ ├── variables_4.js │ ├── typedefs_2.js │ ├── variables_3.js │ ├── enums_0.js │ ├── all_4.js │ ├── functions_4.js │ ├── all_11.js │ ├── functions_0.js │ ├── typedefs_0.js │ ├── all_1.js │ ├── functions_1.js │ ├── related_0.js │ ├── functions_b.js │ ├── all_a.js │ ├── functions_a.js │ ├── all_0.js │ ├── nomatches.html │ ├── all_6.js │ ├── functions_6.js │ ├── all_b.js │ ├── functions_3.js │ ├── functions_7.js │ ├── all_3.js │ ├── all_0.html │ ├── all_1.html │ ├── all_2.html │ ├── all_3.html │ ├── all_4.html │ ├── all_5.html │ ├── all_6.html │ ├── all_7.html │ ├── all_8.html │ ├── all_9.html │ ├── all_a.html │ ├── all_b.html │ ├── all_c.html │ ├── all_d.html │ ├── all_e.html │ ├── all_f.html │ ├── all_10.html │ ├── all_11.html │ ├── all_12.html │ ├── enums_0.html │ ├── files_0.html │ ├── files_1.html │ ├── files_2.html │ ├── files_3.html │ ├── files_4.html │ ├── files_5.html │ ├── files_6.html │ ├── files_7.html │ ├── files_8.html │ ├── classes_0.html │ ├── classes_1.html │ ├── classes_2.html │ ├── classes_3.html │ ├── related_0.html │ ├── typedefs_0.html │ ├── typedefs_1.html │ ├── typedefs_2.html │ ├── enumvalues_0.html │ ├── enumvalues_1.html │ ├── functions_0.html │ ├── functions_1.html │ ├── functions_10.html │ ├── functions_2.html │ ├── functions_3.html │ ├── functions_4.html │ ├── functions_5.html │ ├── functions_6.html │ ├── functions_7.html │ ├── functions_8.html │ ├── functions_9.html │ ├── functions_a.html │ ├── functions_b.html │ ├── functions_c.html │ ├── functions_d.html │ ├── functions_e.html │ ├── functions_f.html │ ├── variables_0.html │ ├── variables_1.html │ ├── variables_2.html │ ├── variables_3.html │ ├── variables_4.html │ ├── variables_5.html │ ├── all_7.js │ ├── all_2.js │ ├── functions_2.js │ ├── functions_5.js │ ├── functions_d.js │ ├── functions_e.js │ ├── all_d.js │ ├── all_5.js │ ├── all_e.js │ ├── functions_c.js │ ├── all_c.js │ ├── functions_f.js │ ├── all_f.js │ ├── functions_10.js │ ├── all_10.js │ └── search.css │ ├── ftv2folderopen.png │ ├── ftv2folderclosed.png │ ├── class_division___euclidean__space.png │ ├── tabs.css │ ├── dynsections.js │ ├── index.html │ ├── examples.html │ ├── structprng__state-members.html │ ├── globals_enum.html │ ├── globals_type.html │ ├── globals_eval.html │ └── functions_rela.html ├── run.sh ├── Makefile ├── makefiles ├── Makefile_manual ├── Makefile_par ├── Makefile_no_par ├── Makefile_par_auto └── Makefile_exp_par_auto ├── main ├── main_par_auto.cpp ├── main_par.cpp ├── main_no_par.cpp ├── main_manual.cpp └── main_exp_par_auto.cpp ├── README.md ├── source ├── Hardware_con.h ├── Random_generator.h ├── Parameters.h ├── Find_k_max.h └── Find_diameter.h └── LICENSE.txt /test_files/query.txt: -------------------------------------------------------------------------------- 1 | 1.0 2.1 3.2 0.3 5.4 5.5 5.6 5.7 5.8 5.9 2 | -------------------------------------------------------------------------------- /Doxygen/html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/bc_s.png -------------------------------------------------------------------------------- /Doxygen/html/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/bdwn.png -------------------------------------------------------------------------------- /Doxygen/html/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/nav_f.png -------------------------------------------------------------------------------- /Doxygen/html/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/nav_g.png -------------------------------------------------------------------------------- /Doxygen/html/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/nav_h.png -------------------------------------------------------------------------------- /Doxygen/html/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/open.png -------------------------------------------------------------------------------- /Doxygen/html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/tab_a.png -------------------------------------------------------------------------------- /Doxygen/html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/tab_b.png -------------------------------------------------------------------------------- /Doxygen/html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/tab_h.png -------------------------------------------------------------------------------- /Doxygen/html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/tab_s.png -------------------------------------------------------------------------------- /Doxygen/html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/closed.png -------------------------------------------------------------------------------- /Doxygen/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/doxygen.png -------------------------------------------------------------------------------- /Doxygen/html/ftv2doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/ftv2doc.png -------------------------------------------------------------------------------- /Doxygen/html/ftv2link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/ftv2link.png -------------------------------------------------------------------------------- /Doxygen/html/ftv2node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/ftv2node.png -------------------------------------------------------------------------------- /Doxygen/html/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/sync_off.png -------------------------------------------------------------------------------- /Doxygen/html/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/sync_on.png -------------------------------------------------------------------------------- /Doxygen/html/ftv2blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/ftv2blank.png -------------------------------------------------------------------------------- /Doxygen/html/ftv2mnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/ftv2mnode.png -------------------------------------------------------------------------------- /Doxygen/html/ftv2pnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/ftv2pnode.png -------------------------------------------------------------------------------- /Doxygen/html/ftv2lastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/ftv2lastnode.png -------------------------------------------------------------------------------- /Doxygen/html/ftv2mlastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/ftv2mlastnode.png -------------------------------------------------------------------------------- /Doxygen/html/ftv2plastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/ftv2plastnode.png -------------------------------------------------------------------------------- /Doxygen/html/ftv2splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/ftv2splitbar.png -------------------------------------------------------------------------------- /Doxygen/html/ftv2vertline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/ftv2vertline.png -------------------------------------------------------------------------------- /Doxygen/html/search/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/search/close.png -------------------------------------------------------------------------------- /Doxygen/html/ftv2folderopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/ftv2folderopen.png -------------------------------------------------------------------------------- /Doxygen/html/search/files_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['io_2eh',['IO.h',['../_i_o_8h.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /Doxygen/html/search/mag_sel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/search/mag_sel.png -------------------------------------------------------------------------------- /Doxygen/html/search/search_l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/search/search_l.png -------------------------------------------------------------------------------- /Doxygen/html/search/search_m.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/search/search_m.png -------------------------------------------------------------------------------- /Doxygen/html/search/search_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/search/search_r.png -------------------------------------------------------------------------------- /Doxygen/html/ftv2folderclosed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/ftv2folderclosed.png -------------------------------------------------------------------------------- /Doxygen/html/search/files_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['tree_2eh',['Tree.h',['../_tree_8h.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /Doxygen/html/class_division___euclidean__space.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsamaras/kd_GeRaF/HEAD/Doxygen/html/class_division___euclidean__space.png -------------------------------------------------------------------------------- /Doxygen/html/search/files_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['mean_5fvariance_2eh',['Mean_variance.h',['../_mean__variance_8h.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_12.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['u64',['u64',['../structprng__state.html#a413bfe3e1ee6cacf65d749c6bdf8588a',1,'prng_state']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /Doxygen/html/search/typedefs_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['min_5fheap',['Min_heap',['../_tree_8h.html#a6f07b2dee07ef2f5e8930fe52d9066af',1,'Tree.h']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /Doxygen/html/search/variables_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['u64',['u64',['../structprng__state.html#a413bfe3e1ee6cacf65d749c6bdf8588a',1,'prng_state']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_9.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['kthlargest',['kthLargest',['../_find__k__max_8h.html#a57b886c1520c708693856ca1cf6f8e86',1,'Find_k_max.h']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /Doxygen/html/search/classes_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['auto_5frandom_5fkd_5fforest',['Auto_random_kd_forest',['../class_auto__random__kd__forest.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /Doxygen/html/search/files_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['auto_5frandom_5fkd_5fforest_2eh',['Auto_random_kd_forest.h',['../_auto__random__kd__forest_8h.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_9.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['kthlargest',['kthLargest',['../_find__k__max_8h.html#a57b886c1520c708693856ca1cf6f8e86',1,'Find_k_max.h']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /Doxygen/html/search/variables_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['rotate_5foption',['rotate_option',['../struct_params.html#a47dddce198f88583d5ee801ab0cb1e2b',1,'Params']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /Doxygen/html/search/classes_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['division_5feuclidean_5fspace',['Division_Euclidean_space',['../class_division___euclidean__space.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /Doxygen/html/search/files_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['division_5feuclidean_5fspace_2eh',['Division_Euclidean_space.h',['../_division___euclidean__space_8h.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /Doxygen/html/search/variables_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['max_5fleaf_5fcheck',['max_leaf_check',['../struct_params.html#a0f52e11f198476e930f4c3e1f7fc10b6',1,'Params']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /Doxygen/html/search/variables_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['points_5fper_5fleaf',['points_per_leaf',['../struct_params.html#a676f503718a6f0316b0167d20126d1cd',1,'Params']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /Doxygen/html/search/files_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['parameters_2eh',['Parameters.h',['../_parameters_8h.html',1,'']]], 4 | ['point_2eh',['Point.h',['../_point_8h.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /Doxygen/html/search/enumvalues_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['no',['No',['../_parameters_8h.html#a4940d1dc528122726d2c8c475657e1a9a996e257033c09daf66076efc1ebd3b1c',1,'Parameters.h']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['insert',['insert',['../class_division___euclidean__space.html#acaf5b9d6cc5a32a0839bdb839ef3bc89',1,'Division_Euclidean_space']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /Doxygen/html/search/classes_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['random_5fkd_5fforest',['Random_kd_forest',['../class_random__kd__forest.html',1,'']]], 4 | ['rkd',['RKD',['../class_r_k_d.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /Doxygen/html/search/enumvalues_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['householder',['Householder',['../_parameters_8h.html#a4940d1dc528122726d2c8c475657e1a9a9db08339065f28367b9ae058d1127a04',1,'Parameters.h']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /Doxygen/html/search/files_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['hardware_5fcon_2eh',['Hardware_con.h',['../_hardware__con_8h.html',1,'']]], 4 | ['householder_2eh',['Householder.h',['../_householder_8h.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /Doxygen/html/search/files_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['find_5fdiameter_2eh',['Find_diameter.h',['../_find__diameter_8h.html',1,'']]], 4 | ['find_5fk_5fmax_2eh',['Find_k_max.h',['../_find__k__max_8h.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Use this to feed geraf with your own data 4 | 5 | ./geraf 1000000 960 ~/Desktop/NN_libs/data/gist/data.txt 999 ~/Desktop/NN_libs/data/gist/query.txt 1 0.0 0 ~/Desktop/NN_libs/data/gist/match.txt float 6 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['insert',['insert',['../class_division___euclidean__space.html#acaf5b9d6cc5a32a0839bdb839ef3bc89',1,'Division_Euclidean_space']]], 4 | ['io_2eh',['IO.h',['../_i_o_8h.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /Doxygen/html/search/classes_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['params',['Params',['../struct_params.html',1,'']]], 4 | ['point',['Point',['../class_point.html',1,'']]], 5 | ['prng_5fstate',['prng_state',['../structprng__state.html',1,'']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /Doxygen/html/search/files_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['random_5fgenerator_2eh',['Random_generator.h',['../_random__generator_8h.html',1,'']]], 4 | ['random_5fkd_5fforest_2eh',['Random_kd_forest.h',['../_random__kd__forest_8h.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /Doxygen/html/search/variables_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['t',['t',['../struct_params.html#a5dd57978431144d32d3ea14c668810c3',1,'Params']]], 4 | ['trees_5fno',['trees_no',['../struct_params.html#a3fe9e8208bbcf95cd9645f6b31ecf3ec',1,'Params']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /Doxygen/html/search/typedefs_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['params',['Params',['../_parameters_8h.html#a359edf934813f4509a7a7d923d32b595',1,'Parameters.h']]], 4 | ['point_5fit',['Point_it',['../class_point.html#a34e26a6b5eb1c573a6aa740f833b3d48',1,'Point']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /Doxygen/html/search/variables_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['sample_5fsize',['sample_size',['../struct_params.html#af7298afd4eb245d873c833b141971c4c',1,'Params']]], 4 | ['shuffle_5fenable',['shuffle_enable',['../struct_params.html#a56eccfccb575685bb66a838e60a3c063',1,'Params']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /Doxygen/html/search/enums_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['rotation',['Rotation',['../_parameters_8h.html#a4940d1dc528122726d2c8c475657e1a9',1,'Rotation(): Parameters.h'],['../_random__kd__forest_8h.html#a4940d1dc528122726d2c8c475657e1a9',1,'Rotation(): Random_kd_forest.h']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['end',['end',['../class_point.html#aef9c5aaefbb069022ef315f04c93985a',1,'Point']]], 4 | ['eucl_5fdistance',['Eucl_distance',['../_division___euclidean__space_8h.html#a3419bf778fc4d72a4894572ee2802117',1,'Division_Euclidean_space.h']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['end',['end',['../class_point.html#aef9c5aaefbb069022ef315f04c93985a',1,'Point']]], 4 | ['eucl_5fdistance',['Eucl_distance',['../_division___euclidean__space_8h.html#a3419bf778fc4d72a4894572ee2802117',1,'Division_Euclidean_space.h']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_11.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['t',['t',['../struct_params.html#a5dd57978431144d32d3ea14c668810c3',1,'Params']]], 4 | ['tree_2eh',['Tree.h',['../_tree_8h.html',1,'']]], 5 | ['trees_5fno',['trees_no',['../struct_params.html#a3fe9e8208bbcf95cd9645f6b31ecf3ec',1,'Params']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['assign',['assign',['../_parameters_8h.html#af2fe44dd58a1a166440621ac7295daa8',1,'Parameters.h']]], 4 | ['auto_5frandom_5fkd_5fforest',['Auto_random_kd_forest',['../class_auto__random__kd__forest.html#ae7e736a63968a6221cb278010453db31',1,'Auto_random_kd_forest']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /Doxygen/html/search/typedefs_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['ft',['FT',['../class_division___euclidean__space.html#a52960dbc1f49094093ceb175fe6bb0ac',1,'Division_Euclidean_space::FT()'],['../class_point.html#ab60ad51d74d6e98df4d20c6ca3d4d138',1,'Point::FT()'],['../class_r_k_d.html#ae8306819bca15c24af977ff2aa028447',1,'RKD::FT()']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['begin',['begin',['../class_point.html#a9de9cb5a244c05b182bb280bf80d3930',1,'Point']]], 4 | ['build',['build',['../class_r_k_d.html#a35b6f195a8ed9cb1a87fd81cc5dc7a11',1,'RKD']]], 5 | ['buildminheap',['buildMinHeap',['../_find__k__max_8h.html#af60f12614ab78d9817d856c74c897531',1,'Find_k_max.h']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['begin',['begin',['../class_point.html#a9de9cb5a244c05b182bb280bf80d3930',1,'Point']]], 4 | ['build',['build',['../class_r_k_d.html#a35b6f195a8ed9cb1a87fd81cc5dc7a11',1,'RKD']]], 5 | ['buildminheap',['buildMinHeap',['../_find__k__max_8h.html#af60f12614ab78d9817d856c74c897531',1,'Find_k_max.h']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /Doxygen/html/search/related_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['operator_2a',['operator*',['../class_point.html#ad87318f5c20761b429dcc00e9406890f',1,'Point']]], 4 | ['operator_2f',['operator/',['../class_point.html#a6cb34a6d80fc00ee548e027eac727a20',1,'Point']]], 5 | ['operator_3c_3c',['operator<<',['../class_point.html#acf86dcb7cc6c3aa8b837e60ebe46ee69',1,'Point']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_b.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['minheapify',['minHeapify',['../_find__k__max_8h.html#ae725ecb2fcd82b725d747ad7d3478c12',1,'Find_k_max.h']]], 4 | ['my_5fhardware_5fconcurrency',['my_hardware_concurrency',['../_hardware__con_8h.html#ac765b60d9cf63b8195e8645af595a03e',1,'Hardware_con.h']]], 5 | ['myrandomuniform',['myRandomUniform',['../_random__generator_8h.html#a62d10566286af3612d311705f0d25078',1,'Random_generator.h']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_a.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['lib_5fcompar',['lib_compar',['../_auto__random__kd__forest_8h.html#a9719c336095bfa9f256f1787854313fb',1,'lib_compar(const std::pair< float, int > &a, const std::pair< float, int > &b): Auto_random_kd_forest.h'],['../_random__kd__forest_8h.html#a9719c336095bfa9f256f1787854313fb',1,'lib_compar(const std::pair< float, int > &a, const std::pair< float, int > &b): Random_kd_forest.h']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | #prune: 2 | # make -f makefiles/Makefile_prune 3 | 4 | #exact: 5 | # make -f makefiles/Makefile_exact 6 | 7 | #radius: 8 | # make -f makefiles/Makefile_radius 9 | 10 | no_par: 11 | make -f makefiles/Makefile_no_par 12 | 13 | par: 14 | make -f makefiles/Makefile_par 15 | 16 | par_auto: 17 | make -f makefiles/Makefile_par_auto 18 | 19 | exp_par_auto: 20 | make -f makefiles/Makefile_exp_par_auto 21 | 22 | manual: 23 | make -f makefiles/Makefile_manual 24 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_a.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['lib_5fcompar',['lib_compar',['../_auto__random__kd__forest_8h.html#a9719c336095bfa9f256f1787854313fb',1,'lib_compar(const std::pair< float, int > &a, const std::pair< float, int > &b): Auto_random_kd_forest.h'],['../_random__kd__forest_8h.html#a9719c336095bfa9f256f1787854313fb',1,'lib_compar(const std::pair< float, int > &a, const std::pair< float, int > &b): Random_kd_forest.h']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /test_files/data.txt: -------------------------------------------------------------------------------- 1 | 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2 | 12.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 3 | 3.0 2.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 4 | 4.0 1.1 2.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 5 | 5.0 1.1 1.2 2.3 1.4 1.5 1.6 1.7 1.8 1.9 6 | 6.0 1.1 1.2 1.3 2.4 1.5 1.6 1.7 1.8 1.9 7 | 7.0 1.1 1.2 1.3 1.4 2.5 1.6 1.7 1.8 1.9 8 | 8.0 1.1 1.2 1.3 1.4 1.5 2.6 1.7 1.8 1.9 9 | 9.0 1.1 1.2 1.3 1.4 1.5 1.6 2.7 1.8 1.9 10 | 10.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 2.8 1.9 11 | 11.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 2.9 12 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['assign',['assign',['../_parameters_8h.html#af2fe44dd58a1a166440621ac7295daa8',1,'Parameters.h']]], 4 | ['auto_5frandom_5fkd_5fforest',['Auto_random_kd_forest',['../class_auto__random__kd__forest.html',1,'Auto_random_kd_forest< T >'],['../class_auto__random__kd__forest.html#ae7e736a63968a6221cb278010453db31',1,'Auto_random_kd_forest::Auto_random_kd_forest()']]], 5 | ['auto_5frandom_5fkd_5fforest_2eh',['Auto_random_kd_forest.h',['../_auto__random__kd__forest_8h.html',1,'']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /Doxygen/html/search/nomatches.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
No Matches
10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['get_5fcoords',['get_coords',['../class_point.html#a7dfdabcef357eedb13df66b9e2085115',1,'Point']]], 4 | ['get_5fpoints',['get_points',['../class_r_k_d.html#a62dff0c3597681007a5aefc81dd95d1f',1,'RKD']]], 5 | ['getpoints',['getPoints',['../class_division___euclidean__space.html#ab193355a230dc30b77faeab342b35d6b',1,'Division_Euclidean_space']]], 6 | ['getpointspointer',['getPointsPointer',['../class_division___euclidean__space.html#acefb5abca0d49181a5d9ee2b2c125acc',1,'Division_Euclidean_space']]], 7 | ['getsquaredcoords',['getSquaredCoords',['../class_division___euclidean__space.html#aac2e4a9f7d7e3bb3d03c8b4cf9c44066',1,'Division_Euclidean_space']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['get_5fcoords',['get_coords',['../class_point.html#a7dfdabcef357eedb13df66b9e2085115',1,'Point']]], 4 | ['get_5fpoints',['get_points',['../class_r_k_d.html#a62dff0c3597681007a5aefc81dd95d1f',1,'RKD']]], 5 | ['getpoints',['getPoints',['../class_division___euclidean__space.html#ab193355a230dc30b77faeab342b35d6b',1,'Division_Euclidean_space']]], 6 | ['getpointspointer',['getPointsPointer',['../class_division___euclidean__space.html#acefb5abca0d49181a5d9ee2b2c125acc',1,'Division_Euclidean_space']]], 7 | ['getsquaredcoords',['getSquaredCoords',['../class_division___euclidean__space.html#aac2e4a9f7d7e3bb3d03c8b4cf9c44066',1,'Division_Euclidean_space']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /makefiles/Makefile_manual: -------------------------------------------------------------------------------- 1 | OBJS = main_manual.o 2 | SOURCE = ../main/main_manual.cpp 3 | HEADER = ../Division_Euclidean_space.h ../Find_diameter.h ../Find$ 4 | OUT = geraf 5 | CXX = g++ 6 | FLAGS = -std=c++0x -O3 -Wall 7 | 8 | all: $(OBJS) 9 | $(CXX) $(OBJS) -o $(OUT) $(FLAGS) 10 | make -f makefiles/Makefile_manual clean 11 | 12 | # create/compile the individual files >>separately<< 13 | main_manual.o: main/main_manual.cpp 14 | $(CXX) -c main/main_manual.cpp $(FLAGS) 15 | 16 | .PHONY : all 17 | # clean house 18 | clean: 19 | rm -f $(OBJS) 20 | 21 | # do a bit of accounting 22 | count: 23 | wc $(SOURCE) $(HEADER) 24 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_b.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['max_5fleaf_5fcheck',['max_leaf_check',['../struct_params.html#a0f52e11f198476e930f4c3e1f7fc10b6',1,'Params']]], 4 | ['mean_5fvariance_2eh',['Mean_variance.h',['../_mean__variance_8h.html',1,'']]], 5 | ['min_5fheap',['Min_heap',['../_tree_8h.html#a6f07b2dee07ef2f5e8930fe52d9066af',1,'Tree.h']]], 6 | ['minheapify',['minHeapify',['../_find__k__max_8h.html#ae725ecb2fcd82b725d747ad7d3478c12',1,'Find_k_max.h']]], 7 | ['my_5fhardware_5fconcurrency',['my_hardware_concurrency',['../_hardware__con_8h.html#ac765b60d9cf63b8195e8645af595a03e',1,'Hardware_con.h']]], 8 | ['myrandomuniform',['myRandomUniform',['../_random__generator_8h.html#a62d10566286af3612d311705f0d25078',1,'Random_generator.h']]] 9 | ]; 10 | -------------------------------------------------------------------------------- /makefiles/Makefile_par: -------------------------------------------------------------------------------- 1 | OBJS = main_par.o 2 | SOURCE = ../main/main_par.cpp 3 | HEADER = ../Division_Euclidean_space.h ../Find_diameter.h ../Find_k_max.h ../Householder.h ../IO.h ../Mean_variance.h ../Point.h ../Random_generator.h ../Random_kd_forest.h ../Tree.h ../Auto_random_kd_forest.h 4 | OUT = geraf 5 | CXX = g++ 6 | FLAGS = -pthread -std=c++0x -DRKD_PAR -O3 -Wall 7 | 8 | all: $(OBJS) 9 | $(CXX) $(OBJS) -o $(OUT) $(FLAGS) 10 | make -f makefiles/Makefile_par clean 11 | 12 | # create/compile the individual files >>separately<< 13 | main_par.o: main/main_par.cpp 14 | $(CXX) -c main/main_par.cpp $(FLAGS) 15 | 16 | .PHONY : all 17 | # clean house 18 | clean: 19 | rm -f $(OBJS) 20 | 21 | # do a bit of accounting 22 | count: 23 | wc $(SOURCE) $(HEADER) 24 | -------------------------------------------------------------------------------- /makefiles/Makefile_no_par: -------------------------------------------------------------------------------- 1 | OBJS = main_no_par.o 2 | SOURCE = ../main/main_no_par.cpp 3 | HEADER = ../Division_Euclidean_space.h ../Find_diameter.h ../Find_k_max.h ../Householder.h ../IO.h ../Mean_variance.h ../Point.h ../Random_generator.h ../Random_kd_forest.h ../Tree.h ../Auto_random_kd_forest.h 4 | OUT = geraf 5 | CXX = g++ 6 | FLAGS = -std=c++0x -O3 -Wall 7 | 8 | all: $(OBJS) 9 | $(CXX) $(OBJS) -o $(OUT) $(FLAGS) 10 | make -f makefiles/Makefile_no_par clean 11 | 12 | # create/compile the individual files >>separately<< 13 | main_no_par.o: main/main_no_par.cpp 14 | $(CXX) -c main/main_no_par.cpp $(FLAGS) 15 | 16 | .PHONY : all 17 | # clean house 18 | clean: 19 | rm -f $(OBJS) 20 | 21 | # do a bit of accounting 22 | count: 23 | wc $(SOURCE) $(HEADER) 24 | -------------------------------------------------------------------------------- /makefiles/Makefile_par_auto: -------------------------------------------------------------------------------- 1 | OBJS = main_par_auto.o 2 | SOURCE = ../main/main_par_auto.cpp 3 | HEADER = ../Division_Euclidean_space.h ../Find_diameter.h ../Find_k_max.h ../Householder.h ../IO.h ../Mean_variance.h ../Point.h ../Random_generator.h ../Random_kd_forest.h ../Tree.h ../Auto_random_kd_forest.h 4 | OUT = geraf 5 | CXX = g++ 6 | FLAGS = -pthread -std=c++0x -DRKD_PAR -O3 -Wall 7 | 8 | all: $(OBJS) 9 | $(CXX) $(OBJS) -o $(OUT) $(FLAGS) 10 | make -f makefiles/Makefile_par_auto clean 11 | 12 | # create/compile the individual files >>separately<< 13 | main_par_auto.o: main/main_par_auto.cpp 14 | $(CXX) -c main/main_par_auto.cpp $(FLAGS) 15 | 16 | .PHONY : all 17 | # clean house 18 | clean: 19 | rm -f $(OBJS) 20 | 21 | # do a bit of accounting 22 | count: 23 | wc $(SOURCE) $(HEADER) 24 | -------------------------------------------------------------------------------- /makefiles/Makefile_exp_par_auto: -------------------------------------------------------------------------------- 1 | OBJS = main_exp_par_auto.o 2 | SOURCE = ../main/main_exp_par_auto.cpp 3 | HEADER = ../Division_Euclidean_space.h ../Find_diameter.h ../Find_k_max.h ../Householder.h ../IO.h ../Mean_variance.h ../Point.h ../Random_generator.h ../Random_kd_forest.h ../Tree.h ../Auto_random_kd_forest.h 4 | OUT = geraf 5 | CXX = g++ 6 | FLAGS = -pthread -std=c++0x -DRKD_PAR -O3 -Wall 7 | 8 | all: $(OBJS) 9 | $(CXX) $(OBJS) -o $(OUT) $(FLAGS) 10 | make -f makefiles/Makefile_exp_par_auto clean 11 | 12 | # create/compile the individual files >>separately<< 13 | main_exp_par_auto.o: main/main_exp_par_auto.cpp 14 | $(CXX) -c main/main_exp_par_auto.cpp $(FLAGS) 15 | 16 | .PHONY : all 17 | # clean house 18 | clean: 19 | rm -f $(OBJS) 20 | 21 | # do a bit of accounting 22 | count: 23 | wc $(SOURCE) $(HEADER) 24 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['dim',['dim',['../class_division___euclidean__space.html#ac06e984d6404fca2fefdcb1799e648da',1,'Division_Euclidean_space::dim() const '],['../class_division___euclidean__space.html#aba2ff3ff1573ec96e393777311a314c5',1,'Division_Euclidean_space::dim()'],['../class_point.html#a8ec1682eb32eb15a601d99ae98d0d3ac',1,'Point::dim()'],['../class_r_k_d.html#abf370cb9dd602282ec449c68af30a5ba',1,'RKD::dim()']]], 4 | ['discard_5frot_5fp',['discard_rot_p',['../class_r_k_d.html#a110ec96488a9e885c9830b018f67c0b3',1,'RKD']]], 5 | ['division_5feuclidean_5fspace',['Division_Euclidean_space',['../class_division___euclidean__space.html#a8903aeba263b72957441e41fa893506e',1,'Division_Euclidean_space::Division_Euclidean_space()'],['../class_division___euclidean__space.html#a5b3a72d86a7fdf2df34eae98946330e9',1,'Division_Euclidean_space::Division_Euclidean_space(const size_t &n, int d)']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /main/main_par_auto.cpp: -------------------------------------------------------------------------------- 1 | /** \example main_par_auto.cpp 2 | * This is an example of how to use parallel building of the forest 3 | * and then search it efficiently, by using auto configured parameters. 4 | */ 5 | 6 | #include 7 | #include "../source/Auto_random_kd_forest.h" 8 | 9 | int main(int argc, char *argv[]) { 10 | size_t N = 11, D = 10, Q = 1; 11 | int k = 2; 12 | double epsilon = 0.0; 13 | std::string datafile = "test_files/data.txt", queryfile = "test_files/query.txt"; 14 | std::vector< std::vector > > res; 15 | 16 | Auto_random_kd_forest RKDf(N, D, datafile, Q, queryfile, k, epsilon, res); 17 | 18 | std::cout << "\nRESULTS\n"; 19 | for (std::vector >::const_iterator it = res[0] 20 | .begin(); it != res[0].end(); ++it) 21 | std::cout << it->first << ", index = " << it->second << std::endl; 22 | 23 | 24 | std::cout << "main_par_auto successfully terminated" << std::endl; 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['householder_5ftransform',['householder_transform',['../_householder_8h.html#a220c0108f470efcce13d296d14e30baa',1,'householder_transform(const int N, const int D, std::vector< T > &transformed, const std::vector< T > &original, const std::vector< float > &vector): Householder.h'],['../_householder_8h.html#ab7f7dfa0da281c24fd40fa443242549f',1,'householder_transform(const int N, const int D, Division_Euclidean_space< T > &transformed, const std::vector< T > &original, const std::vector< float > &vector): Householder.h'],['../_householder_8h.html#a2e8bd373b9f2a099cf4b35fdf608710d',1,'householder_transform(const int N, const int D, Division_Euclidean_space< T > &transformed, const std::vector< T > &original, const std::vector< float > &vector, size_t *split_dims, const int t): Householder.h']]], 4 | ['householder_5fvector',['householder_vector',['../_householder_8h.html#a3d8f3e6678a37987e095d178f4dd3dec',1,'Householder.h']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['dim',['dim',['../class_division___euclidean__space.html#ac06e984d6404fca2fefdcb1799e648da',1,'Division_Euclidean_space::dim() const '],['../class_division___euclidean__space.html#aba2ff3ff1573ec96e393777311a314c5',1,'Division_Euclidean_space::dim()'],['../class_point.html#a8ec1682eb32eb15a601d99ae98d0d3ac',1,'Point::dim()'],['../class_r_k_d.html#abf370cb9dd602282ec449c68af30a5ba',1,'RKD::dim()']]], 4 | ['discard_5frot_5fp',['discard_rot_p',['../class_r_k_d.html#a110ec96488a9e885c9830b018f67c0b3',1,'RKD']]], 5 | ['division_5feuclidean_5fspace',['Division_Euclidean_space',['../class_division___euclidean__space.html',1,'Division_Euclidean_space< T >'],['../class_division___euclidean__space.html#a8903aeba263b72957441e41fa893506e',1,'Division_Euclidean_space::Division_Euclidean_space()'],['../class_division___euclidean__space.html#a5b3a72d86a7fdf2df34eae98946330e9',1,'Division_Euclidean_space::Division_Euclidean_space(const size_t &n, int d)']]], 6 | ['division_5feuclidean_5fspace_2eh',['Division_Euclidean_space.h',['../_division___euclidean__space_8h.html',1,'']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_e.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_f.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_10.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_11.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_12.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/enums_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/files_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/files_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/files_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/files_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/files_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/files_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/files_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/files_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/files_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/classes_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/classes_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/classes_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/classes_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/related_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/typedefs_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/typedefs_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/typedefs_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/enumvalues_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/enumvalues_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_10.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_e.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_f.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/variables_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/variables_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/variables_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/variables_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/variables_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/variables_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /main/main_par.cpp: -------------------------------------------------------------------------------- 1 | /** \example main_par.cpp 2 | * This is an example of how to use parallel building of the forest 3 | * and then search it efficiently. 4 | */ 5 | 6 | #include 7 | #include "../source/Auto_random_kd_forest.h" 8 | 9 | int main(int argc, char *argv[]) { 10 | size_t N = 11, D = 10, Q = 1; 11 | int k = 2; 12 | double epsilon = 0.0; 13 | std::string datafile = "test_files/data.txt", queryfile = "test_files/query.txt"; 14 | std::vector< std::vector > > res; 15 | 16 | Params mypars; 17 | mypars.points_per_leaf = 1; 18 | mypars.trees_no = 1; 19 | mypars.t = 1; 20 | mypars.max_leaf_check = 3; 21 | mypars.rotate_option = No; 22 | mypars.shuffle_enable = false; 23 | mypars.sample_size = N; 24 | 25 | Auto_random_kd_forest RKDf(N, D, datafile, Q, queryfile, k, epsilon, 26 | res, &mypars); 27 | 28 | std::cout << "\nRESULTS\n"; 29 | for (std::vector >::const_iterator it = res[0] 30 | .begin(); it != res[0].end(); ++it) 31 | std::cout << it->first << ", index = " << it->second << std::endl; 32 | 33 | std::cout << "main_par successfully terminated" << std::endl; 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # kd-GeRaF 2 | *kd-GeRaF* is a **C++ [header-only](http://en.wikipedia.org/wiki/Header-only) library**, whcich provides a Generalized Randomized k-d Forest for (approximate) Nearest Neighbor Search in a high dimensional space. 3 | 4 | 5 | ## How to use kd-GeRaF? 6 | 7 | Just include kd-GeRaF's header file. 8 | 9 | ## How fast is kd-GeRaF?? 10 | 11 | We handle GIST datasets of 106 images in 960 dimensions in < 1 sec with about 90% outputs being true nearest neighbors. 12 | 13 | --- 14 | 15 | Project/thesis of George Samaras, university of Athens, 2015. 16 | 17 | * Foler 'Doxygen' contains the html documentation. 18 | * Folder 'main' contains files that can be the main() of the project. 19 | * Folder 'makefiles' contains several Makefiles. 20 | * Folder 'source' contains the source code of kd-GeRaF. 21 | * Folder 'test_files' contains files used by the files in 'main' folder. 22 | * Makefile should be used for compilation. 23 | * LICENSE.txt contains the license of kd-GeRaF. 24 | * run.sh contains a script for running experiments. 25 | 26 | 27 | --- 28 | 29 | Read more in our Paper: [High-dimensional approximate nearest neighbor: k-d Generalized Randomized Forests](https://arxiv.org/pdf/1603.09596.pdf)[Avrithis, Prof. Emiris and Samaras]. 30 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['hardware_5fcon_2eh',['Hardware_con.h',['../_hardware__con_8h.html',1,'']]], 4 | ['householder',['Householder',['../_parameters_8h.html#a4940d1dc528122726d2c8c475657e1a9a9db08339065f28367b9ae058d1127a04',1,'Parameters.h']]], 5 | ['householder_2eh',['Householder.h',['../_householder_8h.html',1,'']]], 6 | ['householder_5ftransform',['householder_transform',['../_householder_8h.html#a220c0108f470efcce13d296d14e30baa',1,'householder_transform(const int N, const int D, std::vector< T > &transformed, const std::vector< T > &original, const std::vector< float > &vector): Householder.h'],['../_householder_8h.html#ab7f7dfa0da281c24fd40fa443242549f',1,'householder_transform(const int N, const int D, Division_Euclidean_space< T > &transformed, const std::vector< T > &original, const std::vector< float > &vector): Householder.h'],['../_householder_8h.html#a2e8bd373b9f2a099cf4b35fdf608710d',1,'householder_transform(const int N, const int D, Division_Euclidean_space< T > &transformed, const std::vector< T > &original, const std::vector< float > &vector, size_t *split_dims, const int t): Householder.h']]], 7 | ['householder_5fvector',['householder_vector',['../_householder_8h.html#a3d8f3e6678a37987e095d178f4dd3dec',1,'Householder.h']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /source/Hardware_con.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file Hardware_con.h 3 | Provides hardware info for parallel execution, 4 | if the compiler is old. 5 | */ 6 | 7 | #ifndef HARDWARE_CON_H 8 | #define HARDWARE_CON_H 9 | 10 | #include 11 | 12 | /** 13 | * \brief Returns number of concurrent threads 14 | * supported by the implementation. The value 15 | * should be considered only a hint. 16 | * 17 | * @return - number of concurrent threads supported. 18 | * If the value is not well defined or not computable, 19 | * returns 0. 20 | */ 21 | unsigned int my_hardware_concurrency() 22 | { 23 | #if defined(PTW32_VERSION) || defined(__hpux) 24 | return pthread_num_processors_np(); 25 | #elif defined(__APPLE__) || defined(__FreeBSD__) 26 | int count; 27 | size_t size=sizeof(count); 28 | return sysctlbyname("hw.ncpu",&count,&size,NULL,0)?0:count; 29 | #elif defined(BOOST_HAS_UNISTD_H) && defined(_SC_NPROCESSORS_ONLN) 30 | int const count=sysconf(_SC_NPROCESSORS_ONLN); 31 | return (count>0)?count:0; 32 | #elif defined(_GNU_SOURCE) 33 | return get_nprocs(); 34 | #endif 35 | return 0; 36 | } 37 | 38 | /* 39 | windows version 40 | unsigned thread::hardware_concurrency() 41 | { 42 | SYSTEM_INFO info={{0}}; 43 | GetSystemInfo(&info); 44 | return info.dwNumberOfProcessors; 45 | } 46 | */ 47 | 48 | #endif /* HARDWARE_CON_H */ 49 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['check_5fmiss',['check_miss',['../class_auto__random__kd__forest.html#a7f8bba83996efd2f2ef8e14463754d62',1,'Auto_random_kd_forest']]], 4 | ['compute_5fvariances',['compute_variances',['../_mean__variance_8h.html#ad9df66eba007446c26027a35fba9f2b6',1,'compute_variances(const std::vector< T > &points, size_t size, const int D, float *var, int sample=-1): Mean_variance.h'],['../_mean__variance_8h.html#acd7a5e91b5f25e87d14d7aaa15f1c19a',1,'compute_variances(size_t t, const std::vector< T > &points, const int D, size_t size, float *avg, float *var, size_t *split_dims, int sample=-1): Mean_variance.h']]], 5 | ['computesquare',['computeSquare',['../class_division___euclidean__space.html#a56eb342488f9d573d397b5f144708b16',1,'Division_Euclidean_space::computeSquare()'],['../_division___euclidean__space_8h.html#a1e50a4dbc00549be03337fffc0c59464',1,'computeSquare(const std::vector< T > &p, const size_t N, const size_t D, std::vector< T > &squared_coords): Division_Euclidean_space.h'],['../_division___euclidean__space_8h.html#a01d03c94f0990b1f9193158b9380ed45',1,'computeSquare(const std::vector< std::vector< T > > &p, const size_t N, const size_t D, std::vector< T > &squared_coords): Division_Euclidean_space.h']]], 6 | ['constdata',['constData',['../class_point.html#ab8036f40dbc1e7e03494d9a90afb9e7e',1,'Point']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['check_5fmiss',['check_miss',['../class_auto__random__kd__forest.html#a7f8bba83996efd2f2ef8e14463754d62',1,'Auto_random_kd_forest']]], 4 | ['compute_5fvariances',['compute_variances',['../_mean__variance_8h.html#ad9df66eba007446c26027a35fba9f2b6',1,'compute_variances(const std::vector< T > &points, size_t size, const int D, float *var, int sample=-1): Mean_variance.h'],['../_mean__variance_8h.html#acd7a5e91b5f25e87d14d7aaa15f1c19a',1,'compute_variances(size_t t, const std::vector< T > &points, const int D, size_t size, float *avg, float *var, size_t *split_dims, int sample=-1): Mean_variance.h']]], 5 | ['computesquare',['computeSquare',['../class_division___euclidean__space.html#a56eb342488f9d573d397b5f144708b16',1,'Division_Euclidean_space::computeSquare()'],['../_division___euclidean__space_8h.html#a1e50a4dbc00549be03337fffc0c59464',1,'computeSquare(const std::vector< T > &p, const size_t N, const size_t D, std::vector< T > &squared_coords): Division_Euclidean_space.h'],['../_division___euclidean__space_8h.html#a01d03c94f0990b1f9193158b9380ed45',1,'computeSquare(const std::vector< std::vector< T > > &p, const size_t N, const size_t D, std::vector< T > &squared_coords): Division_Euclidean_space.h']]], 6 | ['constdata',['constData',['../class_point.html#ab8036f40dbc1e7e03494d9a90afb9e7e',1,'Point']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /Doxygen/html/tabs.css: -------------------------------------------------------------------------------- 1 | .tabs, .tabs2, .tabs3 { 2 | background-image: url('tab_b.png'); 3 | width: 100%; 4 | z-index: 101; 5 | font-size: 13px; 6 | font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; 7 | } 8 | 9 | .tabs2 { 10 | font-size: 10px; 11 | } 12 | .tabs3 { 13 | font-size: 9px; 14 | } 15 | 16 | .tablist { 17 | margin: 0; 18 | padding: 0; 19 | display: table; 20 | } 21 | 22 | .tablist li { 23 | float: left; 24 | display: table-cell; 25 | background-image: url('tab_b.png'); 26 | line-height: 36px; 27 | list-style: none; 28 | } 29 | 30 | .tablist a { 31 | display: block; 32 | padding: 0 20px; 33 | font-weight: bold; 34 | background-image:url('tab_s.png'); 35 | background-repeat:no-repeat; 36 | background-position:right; 37 | color: #283A5D; 38 | text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); 39 | text-decoration: none; 40 | outline: none; 41 | } 42 | 43 | .tabs3 .tablist a { 44 | padding: 0 10px; 45 | } 46 | 47 | .tablist a:hover { 48 | background-image: url('tab_h.png'); 49 | background-repeat:repeat-x; 50 | color: #fff; 51 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 52 | text-decoration: none; 53 | } 54 | 55 | .tablist li.current a { 56 | background-image: url('tab_a.png'); 57 | background-repeat:repeat-x; 58 | color: #fff; 59 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 60 | } 61 | -------------------------------------------------------------------------------- /main/main_no_par.cpp: -------------------------------------------------------------------------------- 1 | /** \example main_no_par.cpp 2 | * This is an example of how to use serial building of the forest 3 | * and then search it efficiently. 4 | */ 5 | 6 | /** 7 | @mainpage 8 | 9 | This project provides approximate and exact nearest neighbor search for high dimensions. 10 | 11 | @author Georgios Samaras 12 | @date 22/04/2015 13 | @version 1.0 14 | */ 15 | 16 | #include 17 | #include "../source/Auto_random_kd_forest.h" 18 | 19 | int main(int argc, char *argv[]) { 20 | size_t N = 11, D = 10, Q = 1; 21 | int k = 2; 22 | double epsilon = 0.0; 23 | std::string datafile = "test_files/data.txt", queryfile = "test_files/query.txt"; 24 | std::vector< std::vector > > res; 25 | 26 | Params mypars; 27 | mypars.points_per_leaf = 1; 28 | mypars.trees_no = 1; 29 | mypars.t = 1; 30 | mypars.max_leaf_check = 3; 31 | mypars.rotate_option = No; 32 | mypars.shuffle_enable = false; 33 | mypars.sample_size = N; 34 | 35 | Auto_random_kd_forest RKDf(N, D, datafile, Q, queryfile, k, epsilon, 36 | res, &mypars); 37 | 38 | std::cout << "\nRESULTS\n"; 39 | for (std::vector >::const_iterator it = res[0] 40 | .begin(); it != res[0].end(); ++it) 41 | std::cout << it->first << ", index = " << it->second << std::endl; 42 | 43 | std::cout << "main_no_par successfully terminated" << std::endl; 44 | return 0; 45 | } 46 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Software License Agreement (BSD License) 2 | A C++ library for Approximate Nearest Neighbour Search in High Dimensions. 3 | 4 | Copyright (c) 2015, Georgios Samaras . 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | * Redistributions in binary form must reproduce the above copyright notice, this 14 | list of conditions and the following disclaimer in the documentation and/or 15 | other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 21 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['find_5fdiameter_5fappr',['find_diameter_appr',['../_find__diameter_8h.html#aa63070422b6dd5b7c8e82542657818cf',1,'find_diameter_appr(const int N, const int D, const std::vector< T > &v): Find_diameter.h'],['../_find__diameter_8h.html#aa14f4d3dbb3c78d14d91208acfc16596',1,'find_diameter_appr(const std::vector< T > &v_p, std::vector< size_t >::iterator &v_i_begin, std::vector< size_t >::iterator &v_i_end, const size_t D): Find_diameter.h']]], 4 | ['find_5fdiameter_5fexact',['find_diameter_exact',['../_find__diameter_8h.html#a775395eceb42659f7e77b321d06bf4c0',1,'find_diameter_exact(const int N, const int D, const std::vector< T > &v): Find_diameter.h'],['../_find__diameter_8h.html#aacfb9d217f6995cc3a2c2e7690f75bbd',1,'find_diameter_exact(const std::vector< T > &v_p, std::vector< size_t >::iterator &v_i_begin, std::vector< size_t >::iterator &v_i_end, const size_t D): Find_diameter.h']]], 5 | ['find_5fmedian',['find_median',['../_mean__variance_8h.html#af586710bfe2200b28c525bbe7a4d8c8d',1,'find_median(const std::vector< T > &v_p, std::vector< size_t >::iterator &v_i_begin, std::vector< size_t >::iterator &v_i_end, const size_t middle, const size_t atDim, const size_t D): Mean_variance.h'],['../_mean__variance_8h.html#a9ef2439730e6e0e1bb1a7653a690f302',1,'find_median(std::vector< size_t >::iterator &v_i_begin, std::vector< size_t >::iterator &v_i_end, const size_t middle, std::vector< T > &t_dims): Mean_variance.h']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_d.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['operator_26',['operator&',['../class_point.html#a62d73cfb7942e79ef3172fec0754ae2f',1,'Point']]], 4 | ['operator_2a',['operator*',['../class_point.html#a5450204da9f82121b28b1c5bd45dd62e',1,'Point::operator*(const FT m) const '],['../class_point.html#a4a158816c0d0a89090b809dcce462f8a',1,'Point::operator*(const Point &p) const ']]], 5 | ['operator_2a_3d',['operator*=',['../class_point.html#a57d0c8d0cafccb4b397584914eabde89',1,'Point']]], 6 | ['operator_2b',['operator+',['../class_point.html#acf15ac33d35ed1f7cd74e3be18562db1',1,'Point::operator+(const Point &p) const '],['../class_point.html#ad375b9568ce290d4952e0076c9a2c8a8',1,'Point::operator+(FT &a) const '],['../class_point.html#a08f38899a121ac593a094f5e01e16e8b',1,'Point::operator+(FT a) const ']]], 7 | ['operator_2d',['operator-',['../class_point.html#a4ffc8f51d9384fea744817a4f2b214e1',1,'Point::operator-(const Point &p) const '],['../class_point.html#ab930edad2ef53bd9c2ed2963cabc8493',1,'Point::operator-(FT &a) const '],['../class_point.html#aa00bfd89f016938d2f75cd8975a603aa',1,'Point::operator-(FT a) const ']]], 8 | ['operator_2f',['operator/',['../class_point.html#abaf9a57cc8b7e87a24f72258a24121b6',1,'Point']]], 9 | ['operator_2f_3d',['operator/=',['../class_point.html#a42b587627e4a2e20ebe9afd5c4414509',1,'Point']]], 10 | ['operator_3d_3d',['operator==',['../class_point.html#a55fc503896454a0f7722c60386090bec',1,'Point']]], 11 | ['operator_5b_5d',['operator[]',['../class_point.html#aeec2def42bb24eac2433e43c56554aec',1,'Point::operator[](int i) const '],['../class_point.html#a3fa64e85ec86e0d4de528d5d16c8eaf4',1,'Point::operator[](int i)']]] 12 | ]; 13 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_e.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['point',['Point',['../class_point.html#a025155bb88e5423c56deffa7b30f27eb',1,'Point::Point()'],['../class_point.html#afede6e1f6fe8c8896608238b03a140c8',1,'Point::Point(const int d, const FT c)'],['../class_point.html#ac5f70c92f58335897bf43b7aa8653b1b',1,'Point::Point(const int d, const FT c[])'],['../class_point.html#ad9bf4ed00b63a7142c679f3b2700c6f8',1,'Point::Point(const int d, const std::vector< FT > &c)']]], 4 | ['print',['print',['../class_auto__random__kd__forest.html#a5669f1115f0392d2aa8ddd3483c1c526',1,'Auto_random_kd_forest::print()'],['../class_point.html#ab9de195d343e5a0d6f8e059508ca57f2',1,'Point::print()'],['../class_random__kd__forest.html#a5fbf4bcdc91d8a4c9bd317bee813374e',1,'Random_kd_forest::print()']]], 5 | ['print_5ftrees',['print_trees',['../class_auto__random__kd__forest.html#a689c779fa4a31457b943886bb921a9dd',1,'Auto_random_kd_forest::print_trees()'],['../class_random__kd__forest.html#abc01e19d2f11a308b74fef3cfa0f2ba1',1,'Random_kd_forest::print_trees()']]], 6 | ['print_5fvector',['print_vector',['../_i_o_8h.html#ac484bc92e4892939526d6a87c2647eee',1,'IO.h']]], 7 | ['printleaves',['printLeaves',['../class_r_k_d.html#a0b48fa64200c64477ca39ffc6e4cd16d',1,'RKD']]], 8 | ['printleavespoints',['printLeavesPoints',['../class_r_k_d.html#ad0b2ce3dd740a480be05d7cc8e6d3192',1,'RKD']]], 9 | ['printnodes',['printNodes',['../class_r_k_d.html#a2ecd3d151f2d207983ac9e30d3dd8f11',1,'RKD']]], 10 | ['printpoints',['printPoints',['../class_division___euclidean__space.html#a5cfcf40995f805c2b4d217feee1978d5',1,'Division_Euclidean_space']]], 11 | ['prng_5finit',['prng_init',['../_householder_8h.html#a84476161f15dbd7d7bb2b6b7dcc99bb9',1,'Householder.h']]] 12 | ]; 13 | -------------------------------------------------------------------------------- /source/Random_generator.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file Random_generator.h 3 | */ 4 | 5 | #ifndef RANDOMGEN_H 6 | #define RANDOMGEN_H 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | /** 13 | * \brief Generates (uniformly) 14 | * a random number in [0, n-1] 15 | * 16 | * @param n - upper bound 17 | * @return - generated number 18 | */ 19 | int myRandomUniform(int n) { 20 | int top = ((((RAND_MAX - n) + 1) / n) * n - 1) + n; 21 | int r; 22 | do { 23 | r = rand(); 24 | } while (r > top); 25 | return (r % n); 26 | } 27 | 28 | 29 | /** 30 | * \brief Mersenne number generator. 31 | */ 32 | std::mt19937 rng(time(NULL)); 33 | 34 | /** 35 | * \brief Generates (uniformly) 36 | * a random number in [0, n] 37 | * 38 | * @param n - upper bound 39 | * @return - generated number 40 | */ 41 | int random(int n) { 42 | std::uniform_int_distribution distribution(0, n); 43 | return distribution(rng); 44 | } 45 | 46 | /** 47 | * \brief Generates (uniformly) 48 | * a random number in [min, max] 49 | * 50 | * @param min - lower bound 51 | * @param max - upper bound 52 | * @return - generated number 53 | */ 54 | template 55 | int random(T min, T max) { 56 | std::uniform_real_distribution distribution(min, max); 57 | return distribution(rng); 58 | } 59 | 60 | /** 61 | * \brief Generates a random point. 62 | * 63 | * The random coordinate is generated in [0, n] and 64 | * has 0.5 possibility to receive a negative sign. 65 | * 66 | * @param q - random point 67 | * @param n - upper bound 68 | * for random generator 69 | * @return - generated number 70 | */ 71 | void random_query(std::vector& q, int n) { 72 | for(size_t i = 0; i < q.size(); ++i) { 73 | q[i] = random(n); 74 | if(myRandomUniform(2)) 75 | q[i] *= -1; 76 | } 77 | } 78 | 79 | #endif /*RANDOMGEN_H*/ 80 | -------------------------------------------------------------------------------- /main/main_manual.cpp: -------------------------------------------------------------------------------- 1 | /** \example main_manual.cpp (may produce compiler errors) 2 | * This is an example of how to use serial building of the forest 3 | * and then search it efficiently, by using the manual Random_kd_forest.h, and not the auto one. 4 | * It doesn't employ all of the power or kd-GeRaF, but it's a good starting point. 5 | */ 6 | 7 | /** 8 | @mainpage 9 | 10 | This project provides approximate and exact nearest neighbor search for high dimensions. 11 | 12 | @author Georgios Samaras 13 | @date 03/01/2017 14 | @version 1.0 15 | */ 16 | 17 | #include 18 | #include "../source/Random_kd_forest.h" 19 | #include "../source/IO.h" 20 | 21 | #define T float 22 | 23 | int main(int argc, char *argv[]) { 24 | int N = 11, D = 10, Q = 1; 25 | int k = 2; 26 | double epsilon = 0.0; 27 | std::string datafile = "test_files/data.txt", queryfile = "test_files/query.txt"; 28 | std::vector > > results; 29 | 30 | size_t points_per_leaf = 1; 31 | int trees_no = 1; 32 | int t = 1; 33 | int max_leaf_check = 3; 34 | int sample_size = N; 35 | 36 | Division_Euclidean_space ds(N, D); 37 | readDivisionSpace(ds, N, D, datafile.c_str()); 38 | 39 | Random_kd_forest RKDf(ds, sample_size, points_per_leaf, trees_no, t); 40 | 41 | // read the queries 42 | std::vector > q; 43 | read_points(q, Q, D, queryfile.c_str()); 44 | 45 | // perform the search 46 | results.resize(Q); 47 | for (unsigned int i = 0; i < Q; ++i) { 48 | search_nn_prune(q[i], results[i], max_leaf_check, k, epsilon); 49 | } 50 | 51 | std::cout << "\nRESULTS\n"; 52 | for (std::vector >::const_iterator it = res[0] 53 | .begin(); it != res[0].end(); ++it) 54 | std::cout << it->first << ", index = " << it->second << std::endl; 55 | 56 | std::cout << "main_manual successfully terminated" << std::endl; 57 | return 0; 58 | } 59 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_d.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['operator_26',['operator&',['../class_point.html#a62d73cfb7942e79ef3172fec0754ae2f',1,'Point']]], 4 | ['operator_2a',['operator*',['../class_point.html#a5450204da9f82121b28b1c5bd45dd62e',1,'Point::operator*(const FT m) const '],['../class_point.html#ad87318f5c20761b429dcc00e9406890f',1,'Point::operator*()'],['../class_point.html#a4a158816c0d0a89090b809dcce462f8a',1,'Point::operator*(const Point &p) const ']]], 5 | ['operator_2a_3d',['operator*=',['../class_point.html#a57d0c8d0cafccb4b397584914eabde89',1,'Point']]], 6 | ['operator_2b',['operator+',['../class_point.html#acf15ac33d35ed1f7cd74e3be18562db1',1,'Point::operator+(const Point &p) const '],['../class_point.html#ad375b9568ce290d4952e0076c9a2c8a8',1,'Point::operator+(FT &a) const '],['../class_point.html#a08f38899a121ac593a094f5e01e16e8b',1,'Point::operator+(FT a) const ']]], 7 | ['operator_2d',['operator-',['../class_point.html#a4ffc8f51d9384fea744817a4f2b214e1',1,'Point::operator-(const Point &p) const '],['../class_point.html#ab930edad2ef53bd9c2ed2963cabc8493',1,'Point::operator-(FT &a) const '],['../class_point.html#aa00bfd89f016938d2f75cd8975a603aa',1,'Point::operator-(FT a) const ']]], 8 | ['operator_2f',['operator/',['../class_point.html#abaf9a57cc8b7e87a24f72258a24121b6',1,'Point::operator/(const FT w) const '],['../class_point.html#a6cb34a6d80fc00ee548e027eac727a20',1,'Point::operator/()']]], 9 | ['operator_2f_3d',['operator/=',['../class_point.html#a42b587627e4a2e20ebe9afd5c4414509',1,'Point']]], 10 | ['operator_3c_3c',['operator<<',['../class_point.html#acf86dcb7cc6c3aa8b837e60ebe46ee69',1,'Point']]], 11 | ['operator_3d_3d',['operator==',['../class_point.html#a55fc503896454a0f7722c60386090bec',1,'Point']]], 12 | ['operator_5b_5d',['operator[]',['../class_point.html#aeec2def42bb24eac2433e43c56554aec',1,'Point::operator[](int i) const '],['../class_point.html#a3fa64e85ec86e0d4de528d5d16c8eaf4',1,'Point::operator[](int i)']]] 13 | ]; 14 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['find_5fdiameter_2eh',['Find_diameter.h',['../_find__diameter_8h.html',1,'']]], 4 | ['find_5fdiameter_5fappr',['find_diameter_appr',['../_find__diameter_8h.html#aa63070422b6dd5b7c8e82542657818cf',1,'find_diameter_appr(const int N, const int D, const std::vector< T > &v): Find_diameter.h'],['../_find__diameter_8h.html#aa14f4d3dbb3c78d14d91208acfc16596',1,'find_diameter_appr(const std::vector< T > &v_p, std::vector< size_t >::iterator &v_i_begin, std::vector< size_t >::iterator &v_i_end, const size_t D): Find_diameter.h']]], 5 | ['find_5fdiameter_5fexact',['find_diameter_exact',['../_find__diameter_8h.html#a775395eceb42659f7e77b321d06bf4c0',1,'find_diameter_exact(const int N, const int D, const std::vector< T > &v): Find_diameter.h'],['../_find__diameter_8h.html#aacfb9d217f6995cc3a2c2e7690f75bbd',1,'find_diameter_exact(const std::vector< T > &v_p, std::vector< size_t >::iterator &v_i_begin, std::vector< size_t >::iterator &v_i_end, const size_t D): Find_diameter.h']]], 6 | ['find_5fk_5fmax_2eh',['Find_k_max.h',['../_find__k__max_8h.html',1,'']]], 7 | ['find_5fmedian',['find_median',['../_mean__variance_8h.html#af586710bfe2200b28c525bbe7a4d8c8d',1,'find_median(const std::vector< T > &v_p, std::vector< size_t >::iterator &v_i_begin, std::vector< size_t >::iterator &v_i_end, const size_t middle, const size_t atDim, const size_t D): Mean_variance.h'],['../_mean__variance_8h.html#a9ef2439730e6e0e1bb1a7653a690f302',1,'find_median(std::vector< size_t >::iterator &v_i_begin, std::vector< size_t >::iterator &v_i_end, const size_t middle, std::vector< T > &t_dims): Mean_variance.h']]], 8 | ['ft',['FT',['../class_division___euclidean__space.html#a52960dbc1f49094093ceb175fe6bb0ac',1,'Division_Euclidean_space::FT()'],['../class_point.html#ab60ad51d74d6e98df4d20c6ca3d4d138',1,'Point::FT()'],['../class_r_k_d.html#ae8306819bca15c24af977ff2aa028447',1,'RKD::FT()']]] 9 | ]; 10 | -------------------------------------------------------------------------------- /source/Parameters.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file Parameters.h 3 | enum Rotation and Params struct. 4 | */ 5 | 6 | #ifndef PARAMETERS_H_ 7 | #define PARAMETERS_H_ 8 | 9 | /** 10 | * Enum for rotation. 11 | */ 12 | enum Rotation { 13 | /** 14 | * no rotation 15 | */ 16 | No, 17 | /** 18 | * rotation by using Householder matrices. 19 | */ 20 | Householder, 21 | }; 22 | 23 | /** @struct Params 24 | * @brief Struct of parameters. 25 | */ 26 | typedef struct Params { 27 | /** 28 | * max number of points per leaf allowed 29 | */ 30 | int points_per_leaf; 31 | /** 32 | * size of forest 33 | */ 34 | int trees_no; 35 | /** 36 | * number of dimensions to build a tree 37 | */ 38 | int t; 39 | /** 40 | * maximum number of leaves to check 41 | */ 42 | int max_leaf_check; 43 | /** 44 | * flag for rotation 45 | */ 46 | Rotation rotate_option; 47 | /** 48 | * flag for shuffling 49 | */ 50 | bool shuffle_enable; 51 | /** 52 | * for computing variances 53 | */ 54 | size_t sample_size; 55 | } 56 | /** 57 | * typedef for struct of Params 58 | */ 59 | Params; 60 | 61 | /** 62 | * Assign the data members of the struct 'parameters' 63 | * to the corresponding variables. 64 | * 65 | * @param parameters - struct of parameters 66 | * @param points_per_leaf - max number of points per leaf allowed 67 | * @param trees_no - size of forest 68 | * @param t - number of dimensions to build a tree 69 | * @param max_leaf_check - maximum number of leaves to check 70 | * @param rotate_option - flag for rotation 71 | * @param shuffle_enable - flag for shuffling 72 | * @param sample_size - for computing variances 73 | */ 74 | void assign(const Params& parameters, int& points_per_leaf, int& trees_no, int& t, 75 | int& max_leaf_check, Rotation& rotate_option, bool& shuffle_enable, 76 | size_t& sample_size) { 77 | points_per_leaf = parameters.points_per_leaf; 78 | trees_no = parameters.trees_no; 79 | t = parameters.t; 80 | max_leaf_check = parameters.max_leaf_check; 81 | rotate_option = parameters.rotate_option; 82 | shuffle_enable = parameters.shuffle_enable; 83 | sample_size = parameters.sample_size; 84 | } 85 | 86 | #endif /* PARAMETERS_H_ */ 87 | -------------------------------------------------------------------------------- /source/Find_k_max.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file Find_k_max.h 3 | Find the k greatest elements out of n. 4 | */ 5 | 6 | #ifndef FIND_K_MAX_H 7 | #define FIND_K_MAX_H 8 | 9 | 10 | /** 11 | * \brief Swap parameters. 12 | * 13 | * @param a - first parameter 14 | * @param b - second parameter 15 | */ 16 | void swap(float &a, float &b) { 17 | a = a + b; 18 | b = a - b; 19 | a = a - b; 20 | } 21 | 22 | /** 23 | * \brief Swap parameters. 24 | * 25 | * @param a - first parameter 26 | * @param b - second parameter 27 | */ 28 | void swap(size_t& a, size_t& b) { 29 | a = a + b; 30 | b = a - b; 31 | a = a - b; 32 | } 33 | 34 | /** 35 | * \brief Make min heap. 36 | * 37 | * @param a - the data 38 | * @param size - size of data 39 | * @param i - helping index 40 | * @param indices - indices of the data 41 | */ 42 | void minHeapify(float a[], int size, int i, size_t indices[]) { 43 | int l = 2 * i; 44 | int r = 2 * i + 1; 45 | int smallest = i; 46 | if (l < size && a[l] < a[smallest]) 47 | smallest = l; 48 | if (r < size && a[r] < a[smallest]) 49 | smallest = r; 50 | if (smallest != i) { 51 | swap(a[i], a[smallest]); 52 | swap(indices[i], indices[smallest]); 53 | minHeapify(a, size, smallest, indices); 54 | } 55 | 56 | } 57 | 58 | /** 59 | * \brief Build min heap. 60 | * 61 | * @param a - the data 62 | * @param size - size of data 63 | * @param indices - indices of the data 64 | */ 65 | void buildMinHeap(float a[], int size, size_t indices[]) { 66 | for (int i = size / 2; i >= 0; i--) 67 | minHeapify(a, size, i, indices); 68 | } 69 | 70 | /** 71 | * \brief Find the k max elements. 72 | * 73 | * @param a - the data 74 | * @param size - size of data 75 | * @param k - number of max elements 76 | * @param indices - indices of the data 77 | */ 78 | void kthLargest(float a[], int size, int k, size_t indices[]) { 79 | float minHeap[k]; 80 | int i; 81 | for (i = 0; i < k; i++) { 82 | minHeap[i] = a[i]; 83 | indices[i] = i; 84 | } 85 | buildMinHeap(minHeap, k, indices); 86 | for (i = k; i < size; i++) { 87 | if (a[i] > minHeap[0]) { 88 | minHeap[0] = a[i]; 89 | indices[0] = i; 90 | minHeapify(minHeap, k, 0, indices); 91 | } 92 | } 93 | } 94 | 95 | #endif 96 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_e.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['parameters_2eh',['Parameters.h',['../_parameters_8h.html',1,'']]], 4 | ['params',['Params',['../struct_params.html',1,'Params'],['../_parameters_8h.html#a359edf934813f4509a7a7d923d32b595',1,'Params(): Parameters.h']]], 5 | ['point',['Point',['../class_point.html',1,'Point< DivisionSpace >'],['../class_point.html#a025155bb88e5423c56deffa7b30f27eb',1,'Point::Point()'],['../class_point.html#afede6e1f6fe8c8896608238b03a140c8',1,'Point::Point(const int d, const FT c)'],['../class_point.html#ac5f70c92f58335897bf43b7aa8653b1b',1,'Point::Point(const int d, const FT c[])'],['../class_point.html#ad9bf4ed00b63a7142c679f3b2700c6f8',1,'Point::Point(const int d, const std::vector< FT > &c)']]], 6 | ['point_2eh',['Point.h',['../_point_8h.html',1,'']]], 7 | ['point_5fit',['Point_it',['../class_point.html#a34e26a6b5eb1c573a6aa740f833b3d48',1,'Point']]], 8 | ['points_5fper_5fleaf',['points_per_leaf',['../struct_params.html#a676f503718a6f0316b0167d20126d1cd',1,'Params']]], 9 | ['print',['print',['../class_auto__random__kd__forest.html#a5669f1115f0392d2aa8ddd3483c1c526',1,'Auto_random_kd_forest::print()'],['../class_point.html#ab9de195d343e5a0d6f8e059508ca57f2',1,'Point::print()'],['../class_random__kd__forest.html#a5fbf4bcdc91d8a4c9bd317bee813374e',1,'Random_kd_forest::print()']]], 10 | ['print_5ftrees',['print_trees',['../class_auto__random__kd__forest.html#a689c779fa4a31457b943886bb921a9dd',1,'Auto_random_kd_forest::print_trees()'],['../class_random__kd__forest.html#abc01e19d2f11a308b74fef3cfa0f2ba1',1,'Random_kd_forest::print_trees()']]], 11 | ['print_5fvector',['print_vector',['../_i_o_8h.html#ac484bc92e4892939526d6a87c2647eee',1,'IO.h']]], 12 | ['printleaves',['printLeaves',['../class_r_k_d.html#a0b48fa64200c64477ca39ffc6e4cd16d',1,'RKD']]], 13 | ['printleavespoints',['printLeavesPoints',['../class_r_k_d.html#ad0b2ce3dd740a480be05d7cc8e6d3192',1,'RKD']]], 14 | ['printnodes',['printNodes',['../class_r_k_d.html#a2ecd3d151f2d207983ac9e30d3dd8f11',1,'RKD']]], 15 | ['printpoints',['printPoints',['../class_division___euclidean__space.html#a5cfcf40995f805c2b4d217feee1978d5',1,'Division_Euclidean_space']]], 16 | ['prng_5finit',['prng_init',['../_householder_8h.html#a84476161f15dbd7d7bb2b6b7dcc99bb9',1,'Householder.h']]], 17 | ['prng_5fstate',['prng_state',['../structprng__state.html',1,'']]] 18 | ]; 19 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_c.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['nn',['nn',['../class_r_k_d.html#a7d086655cac596c0f21ca02dd7d1e467',1,'RKD::nn(size_t index, const std::vector< FT > &q_rot, const std::vector< FT > &q, const float &mul_factor, std::vector< std::pair< float, int > > &res, int &c, const int max_leaf_check, std::unordered_set< size_t > &vis)'],['../class_r_k_d.html#af7c1211875ef1a4c2abe71c66a1dd057',1,'RKD::nn(size_t index, const std::vector< FT > &q, const float &mul_factor, std::vector< std::pair< float, int > > &res, int &c, const int max_leaf_check, std::unordered_set< size_t > &vis)'],['../class_r_k_d.html#a1c76d17d8614202a6c966d6da44bb566',1,'RKD::nn(size_t index, const std::vector< FT > &q_rot, const std::vector< FT > &q, const float &mul_factor, std::vector< std::pair< float, int > > &res, int &c, const int max_leaf_check, size_t *vis, Min_heap &branch, const float &mindist, const size_t &tree_i, const std::vector< FT > &squared_coords, const std::vector< FT > &q_squared_coords, int q_index)'],['../class_r_k_d.html#a86e44ae7169202c7953bb06b73ef58c2',1,'RKD::nn(size_t index, const std::vector< FT > &q, const float &mul_factor, std::vector< std::pair< float, int > > &res, int &c, const int max_leaf_check, size_t *vis, Min_heap &branch, const float &mindist, const size_t &tree_i, const std::vector< FT > &squared_coords, const std::vector< FT > &q_squared_coords, int q_index)'],['../class_r_k_d.html#ade4a8792ccae896884955b133eb4c8f1',1,'RKD::nn(size_t index, const std::vector< FT > &q_rot, const std::vector< FT > &q, const float &r_epsilon, std::vector< std::pair< int, float > > &res, int &c, const int max_leaf_check, const float &r, std::unordered_set< size_t > &vis)'],['../class_r_k_d.html#aa6e30064c7376b5140708e7767ca08d9',1,'RKD::nn(size_t index, const std::vector< FT > &q, const float &r_epsilon, std::vector< std::pair< int, float > > &res, int &c, const int max_leaf_check, const float &r, std::unordered_set< size_t > &vis)']]], 4 | ['norm',['norm',['../class_point.html#ac89b61353701f8fd30b94762c853cdb8',1,'Point']]], 5 | ['normalize',['normalize',['../class_point.html#a9e7633bcb32e3cb39ea4667432fca3f9',1,'Point']]], 6 | ['normalized',['normalized',['../class_point.html#a1a89a3ab732d6cb04b278ac8416926db',1,'Point']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /Doxygen/html/search/all_c.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['nn',['nn',['../class_r_k_d.html#a7d086655cac596c0f21ca02dd7d1e467',1,'RKD::nn(size_t index, const std::vector< FT > &q_rot, const std::vector< FT > &q, const float &mul_factor, std::vector< std::pair< float, int > > &res, int &c, const int max_leaf_check, std::unordered_set< size_t > &vis)'],['../class_r_k_d.html#af7c1211875ef1a4c2abe71c66a1dd057',1,'RKD::nn(size_t index, const std::vector< FT > &q, const float &mul_factor, std::vector< std::pair< float, int > > &res, int &c, const int max_leaf_check, std::unordered_set< size_t > &vis)'],['../class_r_k_d.html#a1c76d17d8614202a6c966d6da44bb566',1,'RKD::nn(size_t index, const std::vector< FT > &q_rot, const std::vector< FT > &q, const float &mul_factor, std::vector< std::pair< float, int > > &res, int &c, const int max_leaf_check, size_t *vis, Min_heap &branch, const float &mindist, const size_t &tree_i, const std::vector< FT > &squared_coords, const std::vector< FT > &q_squared_coords, int q_index)'],['../class_r_k_d.html#a86e44ae7169202c7953bb06b73ef58c2',1,'RKD::nn(size_t index, const std::vector< FT > &q, const float &mul_factor, std::vector< std::pair< float, int > > &res, int &c, const int max_leaf_check, size_t *vis, Min_heap &branch, const float &mindist, const size_t &tree_i, const std::vector< FT > &squared_coords, const std::vector< FT > &q_squared_coords, int q_index)'],['../class_r_k_d.html#ade4a8792ccae896884955b133eb4c8f1',1,'RKD::nn(size_t index, const std::vector< FT > &q_rot, const std::vector< FT > &q, const float &r_epsilon, std::vector< std::pair< int, float > > &res, int &c, const int max_leaf_check, const float &r, std::unordered_set< size_t > &vis)'],['../class_r_k_d.html#aa6e30064c7376b5140708e7767ca08d9',1,'RKD::nn(size_t index, const std::vector< FT > &q, const float &r_epsilon, std::vector< std::pair< int, float > > &res, int &c, const int max_leaf_check, const float &r, std::unordered_set< size_t > &vis)']]], 4 | ['no',['No',['../_parameters_8h.html#a4940d1dc528122726d2c8c475657e1a9a996e257033c09daf66076efc1ebd3b1c',1,'Parameters.h']]], 5 | ['norm',['norm',['../class_point.html#ac89b61353701f8fd30b94762c853cdb8',1,'Point']]], 6 | ['normalize',['normalize',['../class_point.html#a9e7633bcb32e3cb39ea4667432fca3f9',1,'Point']]], 7 | ['normalized',['normalized',['../class_point.html#a1a89a3ab732d6cb04b278ac8416926db',1,'Point']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /Doxygen/html/search/functions_f.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['random',['random',['../_random__generator_8h.html#a054fe6e7aa3343d6fee7974f712d356f',1,'random(int n): Random_generator.h'],['../_random__generator_8h.html#acfd474db0c172a440d4f0fa873cde9d7',1,'random(T min, T max): Random_generator.h']]], 4 | ['random_5fkd_5fforest',['Random_kd_forest',['../class_random__kd__forest.html#a14d11522dcef8dd7f6e04977ad677f91',1,'Random_kd_forest']]], 5 | ['random_5fquery',['random_query',['../_random__generator_8h.html#ab5e264feb667e93553ab83c961b1dd79',1,'Random_generator.h']]], 6 | ['read_5findices',['read_indices',['../_i_o_8h.html#aa3795db46435ed89033207c382066d40',1,'IO.h']]], 7 | ['read_5fpoints',['read_points',['../_i_o_8h.html#a034711f3ecab57ce7b7b49abd357f17b',1,'read_points(std::vector< Point< Division_Euclidean_space< T >> > &v, int N, int D, const char *filename): IO.h'],['../_i_o_8h.html#a013f82382afa54c1192b83b62d62b53b',1,'read_points(std::vector< std::vector< T > > &v, int N, int D, const char *filename): IO.h']]], 8 | ['readdivisionspace',['readDivisionSpace',['../_i_o_8h.html#a95255c4f04b0fb2bac8869961bfccaf7',1,'readDivisionSpace(Division_Euclidean_space< T > &ds, char *filename): IO.h'],['../_i_o_8h.html#a61415cdbd902cb70994a215301fdaa83',1,'readDivisionSpace(Division_Euclidean_space< T > &ds, int N, int D, char *filename): IO.h']]], 9 | ['readdivisionspacefvecs',['readDivisionSpacefvecs',['../_i_o_8h.html#a182b0e15748a40c4817ceb800d39e84e',1,'IO.h']]], 10 | ['rkd',['RKD',['../class_r_k_d.html#a2ef33a5048e081307401e9109ef403f1',1,'RKD::RKD(const DivisionSpace *ds, size_t nodes_size, size_t leaves_size, size_t nmax, std::vector< float > *rot_v=0, const DivisionSpace *ds_original=0)'],['../class_r_k_d.html#a90306bdb48bd285fedaa438f2d9c3fbb',1,'RKD::RKD(const std::vector< FT > *p, const size_t D, size_t nodes_size, size_t leaves_size, size_t nmax, std::vector< float > *rot_v=0)']]], 11 | ['rng',['rng',['../_random__generator_8h.html#a0cdca4aeb79ab9def95c958fc8aa0273',1,'Random_generator.h']]], 12 | ['rotate',['rotate',['../_householder_8h.html#a9443f0ea8566eb173ae1ab9735fd52de',1,'rotate(const int N, const int D, std::vector< T > &transformed, const std::vector< T > &original, std::vector< float > &v): Householder.h'],['../_householder_8h.html#afcf66c0a2bb01688088dae85a08a74ed',1,'rotate(const int N, const int D, Division_Euclidean_space< T > &transformed, const std::vector< T > &original, std::vector< float > &v): Householder.h'],['../_householder_8h.html#a3b50b8df6ca5f6cf52c2109935a693e1',1,'rotate(const int N, const int D, Division_Euclidean_space< T > &transformed, const std::vector< T > &original, size_t *split_dims, const int t, std::vector< float > &v): Householder.h']]] 13 | ]; 14 | -------------------------------------------------------------------------------- /main/main_exp_par_auto.cpp: -------------------------------------------------------------------------------- 1 | /** \example main_exp_par_auto.cpp 2 | * This is an example for experimenting. 3 | */ 4 | 5 | #include 6 | #include "../source/Auto_random_kd_forest.h" 7 | 8 | void input_cmd(int argc, char *argv[], size_t& N, size_t& D, std::string& datafile, 9 | size_t& Q, std::string& queryfile, int& k, double& epsilon, 10 | int& file_option, std::string& matchfile, std::string& datatype); 11 | void print_cmd(char *argv[]); 12 | 13 | //./rkd_sam 100000 960 ~/parallel/rkd_forest/Datasets/mygist/mygist_base.txt 100 ~/parallel/rkd_forest/Datasets/mygist/mygist_query.txt 1 0.0 0 ~/parallel/rkd_forest/Datasets/mygist/mygist_match.txt float 14 | 15 | // ./rkd_sam 10000 128 ../../nicolo_paper/data/siftsmall_data.txt 100 ../../nicolo_paper/data/siftsmall_query.txt 2 0.0 0 ../../nicolo_paper/data/siftsmall_match.txt int 16 | int main(int argc, char *argv[]) { 17 | size_t N, D, Q; 18 | int k, file_option; 19 | double epsilon; 20 | std::string datafile, queryfile, matchfile, datatype; 21 | std::vector > > res; 22 | input_cmd(argc, argv, N, D, datafile, Q, queryfile, k, epsilon, file_option, matchfile, datatype); 23 | print_cmd(argv); 24 | 25 | if(datatype == "int") { 26 | Auto_random_kd_forest RKDf(N, D, datafile, Q, queryfile, k, epsilon, res, NULL, file_option); 27 | RKDf.check_miss(matchfile, Q, k, res); 28 | } else { 29 | Auto_random_kd_forest RKDf(N, D, datafile, Q, queryfile, k, epsilon, res, NULL, file_option); 30 | RKDf.check_miss(matchfile, Q, k, res); 31 | } 32 | 33 | std::cout << "Done" << std::endl; 34 | return 0; 35 | } 36 | 37 | void input_cmd(int argc, char *argv[], size_t& N, size_t& D, std::string& datafile, 38 | size_t& Q, std::string& queryfile, int& k, double& epsilon, 39 | int& file_option, std::string& matchfile, std::string& datatype) { 40 | if(argc != 11) { 41 | std::cout << "Wrong number of cmd arguments!\n"; 42 | std::cout << "Usage: " << argv[0] << " N D " 43 | "datafile Q queryfile k epsilon file_option matchfile datatype\n"; 44 | std::cout << "Exiting...\n"; 45 | exit(1); 46 | } 47 | 48 | N = atoi(argv[1]); 49 | D = atoi(argv[2]); 50 | datafile = argv[3]; 51 | Q = atoi(argv[4]); 52 | queryfile = argv[5]; 53 | k = atoi(argv[6]); 54 | epsilon = atof(argv[7]); 55 | file_option = atoi(argv[8]); 56 | matchfile = argv[9]; 57 | datatype = argv[10]; 58 | } 59 | 60 | void print_cmd(char *argv[]) { 61 | std::cout << "N = " << argv[1] << "\n"; 62 | std::cout << "D = " << argv[2] << "\n"; 63 | std::cout << "data_file = " << argv[3] << "\n"; 64 | std::cout << "Q = " << argv[4] << "\n"; 65 | std::cout << "query_file = " << argv[5] << "\n"; 66 | std::cout << "k = " << argv[6] << "\n"; 67 | std::cout << "epsilon = " << argv[7] << "\n"; 68 | std::cout << "file_option = " << argv[8] << "\n"; 69 | std::cout << "match_file = " << argv[9] << "\n"; 70 | std::cout << "data_type = " << argv[10] << "\n"; 71 | } 72 | -------------------------------------------------------------------------------- /Doxygen/html/dynsections.js: -------------------------------------------------------------------------------- 1 | function toggleVisibility(linkObj) 2 | { 3 | var base = $(linkObj).attr('id'); 4 | var summary = $('#'+base+'-summary'); 5 | var content = $('#'+base+'-content'); 6 | var trigger = $('#'+base+'-trigger'); 7 | var src=$(trigger).attr('src'); 8 | if (content.is(':visible')===true) { 9 | content.hide(); 10 | summary.show(); 11 | $(linkObj).addClass('closed').removeClass('opened'); 12 | $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); 13 | } else { 14 | content.show(); 15 | summary.hide(); 16 | $(linkObj).removeClass('closed').addClass('opened'); 17 | $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); 18 | } 19 | return false; 20 | } 21 | 22 | function updateStripes() 23 | { 24 | $('table.directory tr'). 25 | removeClass('even').filter(':visible:even').addClass('even'); 26 | } 27 | 28 | function toggleLevel(level) 29 | { 30 | $('table.directory tr').each(function() { 31 | var l = this.id.split('_').length-1; 32 | var i = $('#img'+this.id.substring(3)); 33 | var a = $('#arr'+this.id.substring(3)); 34 | if (l 2 | 3 | 4 | 5 | 6 | 7 | kd-GeRaF: Main Page 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | 30 | 31 | 32 |
25 |
kd-GeRaF 26 |  1.0 27 |
28 |
High-dimensional nearest neighbor
29 |
33 |
34 | 35 | 36 | 39 | 63 |
64 | 65 | 70 | 71 | 72 |
73 | 76 |
77 | 78 |
79 |
80 |
kd-GeRaF Documentation
81 |
82 |
83 |

This project provides approximate and exact nearest neighbor search for high dimensions.

84 |
Author
Georgios Samaras
85 |
Date
22/04/2015
86 |
Version
1.0
87 |
88 | 89 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /Doxygen/html/examples.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | kd-GeRaF: Examples 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | 30 | 31 | 32 |
25 |
kd-GeRaF 26 |  1.0 27 |
28 |
High-dimensional nearest neighbor
29 |
33 |
34 | 35 | 36 | 39 | 63 |
64 | 65 | 70 | 71 | 72 |
73 | 76 |
77 | 78 |
79 |
80 |
Examples
81 |
82 |
83 |
Here is a list of all examples:
93 |
94 | 95 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /Doxygen/html/search/search.css: -------------------------------------------------------------------------------- 1 | /*---------------- Search Box */ 2 | 3 | #FSearchBox { 4 | float: left; 5 | } 6 | 7 | #MSearchBox { 8 | white-space : nowrap; 9 | position: absolute; 10 | float: none; 11 | display: inline; 12 | margin-top: 8px; 13 | right: 0px; 14 | width: 170px; 15 | z-index: 102; 16 | background-color: white; 17 | } 18 | 19 | #MSearchBox .left 20 | { 21 | display:block; 22 | position:absolute; 23 | left:10px; 24 | width:20px; 25 | height:19px; 26 | background:url('search_l.png') no-repeat; 27 | background-position:right; 28 | } 29 | 30 | #MSearchSelect { 31 | display:block; 32 | position:absolute; 33 | width:20px; 34 | height:19px; 35 | } 36 | 37 | .left #MSearchSelect { 38 | left:4px; 39 | } 40 | 41 | .right #MSearchSelect { 42 | right:5px; 43 | } 44 | 45 | #MSearchField { 46 | display:block; 47 | position:absolute; 48 | height:19px; 49 | background:url('search_m.png') repeat-x; 50 | border:none; 51 | width:111px; 52 | margin-left:20px; 53 | padding-left:4px; 54 | color: #909090; 55 | outline: none; 56 | font: 9pt Arial, Verdana, sans-serif; 57 | } 58 | 59 | #FSearchBox #MSearchField { 60 | margin-left:15px; 61 | } 62 | 63 | #MSearchBox .right { 64 | display:block; 65 | position:absolute; 66 | right:10px; 67 | top:0px; 68 | width:20px; 69 | height:19px; 70 | background:url('search_r.png') no-repeat; 71 | background-position:left; 72 | } 73 | 74 | #MSearchClose { 75 | display: none; 76 | position: absolute; 77 | top: 4px; 78 | background : none; 79 | border: none; 80 | margin: 0px 4px 0px 0px; 81 | padding: 0px 0px; 82 | outline: none; 83 | } 84 | 85 | .left #MSearchClose { 86 | left: 6px; 87 | } 88 | 89 | .right #MSearchClose { 90 | right: 2px; 91 | } 92 | 93 | .MSearchBoxActive #MSearchField { 94 | color: #000000; 95 | } 96 | 97 | /*---------------- Search filter selection */ 98 | 99 | #MSearchSelectWindow { 100 | display: none; 101 | position: absolute; 102 | left: 0; top: 0; 103 | border: 1px solid #90A5CE; 104 | background-color: #F9FAFC; 105 | z-index: 1; 106 | padding-top: 4px; 107 | padding-bottom: 4px; 108 | -moz-border-radius: 4px; 109 | -webkit-border-top-left-radius: 4px; 110 | -webkit-border-top-right-radius: 4px; 111 | -webkit-border-bottom-left-radius: 4px; 112 | -webkit-border-bottom-right-radius: 4px; 113 | -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); 114 | } 115 | 116 | .SelectItem { 117 | font: 8pt Arial, Verdana, sans-serif; 118 | padding-left: 2px; 119 | padding-right: 12px; 120 | border: 0px; 121 | } 122 | 123 | span.SelectionMark { 124 | margin-right: 4px; 125 | font-family: monospace; 126 | outline-style: none; 127 | text-decoration: none; 128 | } 129 | 130 | a.SelectItem { 131 | display: block; 132 | outline-style: none; 133 | color: #000000; 134 | text-decoration: none; 135 | padding-left: 6px; 136 | padding-right: 12px; 137 | } 138 | 139 | a.SelectItem:focus, 140 | a.SelectItem:active { 141 | color: #000000; 142 | outline-style: none; 143 | text-decoration: none; 144 | } 145 | 146 | a.SelectItem:hover { 147 | color: #FFFFFF; 148 | background-color: #3D578C; 149 | outline-style: none; 150 | text-decoration: none; 151 | cursor: pointer; 152 | display: block; 153 | } 154 | 155 | /*---------------- Search results window */ 156 | 157 | iframe#MSearchResults { 158 | width: 60ex; 159 | height: 15em; 160 | } 161 | 162 | #MSearchResultsWindow { 163 | display: none; 164 | position: absolute; 165 | left: 0; top: 0; 166 | border: 1px solid #000; 167 | background-color: #EEF1F7; 168 | } 169 | 170 | /* ----------------------------------- */ 171 | 172 | 173 | #SRIndex { 174 | clear:both; 175 | padding-bottom: 15px; 176 | } 177 | 178 | .SREntry { 179 | font-size: 10pt; 180 | padding-left: 1ex; 181 | } 182 | 183 | .SRPage .SREntry { 184 | font-size: 8pt; 185 | padding: 1px 5px; 186 | } 187 | 188 | body.SRPage { 189 | margin: 5px 2px; 190 | } 191 | 192 | .SRChildren { 193 | padding-left: 3ex; padding-bottom: .5em 194 | } 195 | 196 | .SRPage .SRChildren { 197 | display: none; 198 | } 199 | 200 | .SRSymbol { 201 | font-weight: bold; 202 | color: #425E97; 203 | font-family: Arial, Verdana, sans-serif; 204 | text-decoration: none; 205 | outline: none; 206 | } 207 | 208 | a.SRScope { 209 | display: block; 210 | color: #425E97; 211 | font-family: Arial, Verdana, sans-serif; 212 | text-decoration: none; 213 | outline: none; 214 | } 215 | 216 | a.SRSymbol:focus, a.SRSymbol:active, 217 | a.SRScope:focus, a.SRScope:active { 218 | text-decoration: underline; 219 | } 220 | 221 | span.SRScope { 222 | padding-left: 4px; 223 | } 224 | 225 | .SRPage .SRStatus { 226 | padding: 2px 5px; 227 | font-size: 8pt; 228 | font-style: italic; 229 | } 230 | 231 | .SRResult { 232 | display: none; 233 | } 234 | 235 | DIV.searchresults { 236 | margin-left: 10px; 237 | margin-right: 10px; 238 | } 239 | 240 | /*---------------- External search page results */ 241 | 242 | .searchresult { 243 | background-color: #F0F3F8; 244 | } 245 | 246 | .pages b { 247 | color: white; 248 | padding: 5px 5px 3px 5px; 249 | background-image: url("../tab_a.png"); 250 | background-repeat: repeat-x; 251 | text-shadow: 0 1px 1px #000000; 252 | } 253 | 254 | .pages { 255 | line-height: 17px; 256 | margin-left: 4px; 257 | text-decoration: none; 258 | } 259 | 260 | .hl { 261 | font-weight: bold; 262 | } 263 | 264 | #searchresults { 265 | margin-bottom: 20px; 266 | } 267 | 268 | .searchpages { 269 | margin-top: 10px; 270 | } 271 | 272 | -------------------------------------------------------------------------------- /source/Find_diameter.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file Find_diameter.h 3 | This file is NOT used. 4 | */ 5 | 6 | #ifndef FIND_DIAMETER_H_ 7 | #define FIND_DIAMETER_H_ 8 | 9 | #include "Division_Euclidean_space.h" 10 | 11 | 12 | /** 13 | * \brief Find diameter of a set of points. 14 | * 15 | * @param N - number of points 16 | * @param D - dimension of points 17 | * @param v - vector of points 18 | * @return - diameter 19 | */ 20 | template 21 | float find_diameter_exact(const int N, const int D, 22 | const std::vector& v) { 23 | // Note that indexing is of the form: [i * D + j] 24 | int offset; 25 | size_t max = 0; 26 | float d; 27 | for (int n = 0; n < N; ++n) { 28 | offset = n * D; 29 | for (int i = n + 1; i < N; ++i) { 30 | // d(v[n], v[i]) 31 | d = squared_Eucl_distance(v, offset, offset + D, i * D + D); 32 | if (d > max) { 33 | max = d; 34 | } 35 | } 36 | } 37 | return sqrt(max); 38 | } 39 | 40 | /** 41 | * \brief Find diameter of a set of points. 42 | * 43 | * @param v_p - vector of points 44 | * @param v_i_begin - start of points 45 | * @param v_i_end - end of points 46 | * @param D - dimensions of points 47 | * @return - diameter 48 | */ 49 | template 50 | float find_diameter_exact(const std::vector& v_p, 51 | std::vector::iterator& v_i_begin, 52 | std::vector::iterator& v_i_end, 53 | const size_t D) { 54 | // Note that indexing is of the form: [i * D + j] 55 | size_t max = 0; 56 | float d; 57 | size_t offset1; 58 | for(std::vector::iterator it1 = v_i_begin; it1 != v_i_end; ++it1) { 59 | offset1 = *it1 * D; 60 | for(std::vector::iterator it2 = it1 + 1; it2 != v_i_end; ++it2) { 61 | // d(v[i], v[i + 1]) 62 | d = squared_Eucl_distance(v_p, offset1, offset1 + D, *it2 * D); 63 | if (d > max) { 64 | max = d; 65 | } 66 | } 67 | } 68 | return sqrt(max); 69 | } 70 | 71 | /** 72 | * \brief Approximately find diameter of a set of points. 73 | * 74 | * Pick random point x. Pick point y farthest from x. 75 | * Pick point z farthest from y. 76 | * The distance between y and z can than be used as the 77 | * diameter. 78 | * 79 | * The diameter is no smaller than this value and 80 | * no larger than twice this value. 81 | * Proof: 82 | * Let D = d(p,q) be the diameter. Then d(y,z) ≤ D 83 | * (since p,q is the maximum argument of d(*,*)), 84 | * and D = d(p,q) ≤ d(p,y) + d(y,q) ≤ 2d(y,z) 85 | * (triangle inequality and since z is the maximum 86 | * argument of d(y,*) = d(*,y)). 87 | * 88 | * @param N - number of points 89 | * @param D - dimension of points 90 | * @param v - vector of points 91 | * @return - diameter 92 | */ 93 | template 94 | float find_diameter_appr(const int N, const int D, 95 | const std::vector& v) { 96 | // Note that indexing is of the form: [i * D + j] 97 | int offset, offset_x = random(N) * D; 98 | size_t max = 0; 99 | int point_y_index; 100 | float d; 101 | for (int i = 0; i < N; ++i) { 102 | offset = i * D; 103 | // d(v[i], x) 104 | d = squared_Eucl_distance(v, offset, offset + D, offset_x); 105 | if (d > max) { 106 | max = d; 107 | point_y_index = i; 108 | } 109 | } 110 | int offset_y = point_y_index * D; 111 | max = 0; 112 | for (int i = 0; i < N; ++i) { 113 | offset = i * D; 114 | // d(v[i], y) 115 | d = squared_Eucl_distance(v, offset, offset + D, offset_y); 116 | if (d > max) { 117 | max = d; 118 | } 119 | } 120 | return sqrt(max); 121 | } 122 | 123 | /** 124 | * \brief Approximately find diameter of a set of points. 125 | * 126 | * Pick random point x. Pick point y farthest from x. 127 | * Pick point z farthest from y. 128 | * The distance between y and z can than be used as the 129 | * diameter. 130 | * 131 | * The diameter is no smaller than this value and 132 | * no larger than twice this value. 133 | * Proof: 134 | * Let D = d(p,q) be the diameter. Then d(y,z) ≤ D 135 | * (since p,q is the maximum argument of d(*,*)), 136 | * and D = d(p,q) ≤ d(p,y) + d(y,q) ≤ 2d(y,z) 137 | * (triangle inequality and since z is the maximum 138 | * argument of d(y,*) = d(*,y)). 139 | * 140 | * @param v_p - vector of points 141 | * @param v_i_begin - start of points 142 | * @param v_i_end - end of points 143 | * @param D - dimensions of points 144 | * @return - diameter 145 | */ 146 | template 147 | float find_diameter_appr(const std::vector& v_p, 148 | std::vector::iterator &v_i_begin, 149 | std::vector::iterator &v_i_end, 150 | const size_t D) { 151 | // Note that indexing is of vector is of the form: [i * D + j] 152 | // size = std::distance(itBegin, itEnd) for non-"Random Access" iterators 153 | size_t N = v_i_end - v_i_begin; 154 | size_t offset, offset_x = random(N) * D; 155 | float d, max = 0; 156 | size_t index_y = 0; 157 | for(std::vector::iterator it = v_i_begin; it != v_i_end; ++it) { 158 | offset = *it * D; 159 | d = squared_Eucl_distance(v_p, offset, offset + D, offset_x); 160 | if(d > max) { 161 | max = d; 162 | index_y = *it; 163 | } 164 | } 165 | max = 0; 166 | size_t offset_y = index_y * D; 167 | for(std::vector::iterator it = v_i_begin; it != v_i_end; ++it) { 168 | offset = *it * D; 169 | d = squared_Eucl_distance(v_p, offset, offset + D, offset_y); 170 | if(d > max) { 171 | max = d; 172 | } 173 | } 174 | return sqrt(max); 175 | } 176 | 177 | #endif /* FIND_DIAMETER_H_ */ 178 | -------------------------------------------------------------------------------- /Doxygen/html/structprng__state-members.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | kd-GeRaF: Member List 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | 30 | 31 | 32 |
25 |
kd-GeRaF 26 |  1.0 27 |
28 |
High-dimensional nearest neighbor
29 |
33 |
34 | 35 | 36 | 39 | 63 | 71 | 72 | 77 | 78 | 79 |
80 | 83 |
84 | 85 |
86 |
87 |
88 |
prng_state Member List
89 |
90 |
91 | 92 |

This is the complete list of members for prng_state, including all inherited members.

93 | 94 | 95 |
u64prng_state
96 | 97 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /Doxygen/html/globals_enum.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | kd-GeRaF: File Members 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | 30 | 31 | 32 |
25 |
kd-GeRaF 26 |  1.0 27 |
28 |
High-dimensional nearest neighbor
29 |
33 |
34 | 35 | 36 | 39 | 63 | 69 | 78 |
79 | 80 | 85 | 86 | 87 |
88 | 91 |
92 | 93 |
94 |   100 |
101 | 102 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /Doxygen/html/globals_type.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | kd-GeRaF: File Members 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | 30 | 31 | 32 |
25 |
kd-GeRaF 26 |  1.0 27 |
28 |
High-dimensional nearest neighbor
29 |
33 |
34 | 35 | 36 | 39 | 63 | 69 | 78 |
79 | 80 | 85 | 86 | 87 |
88 | 91 |
92 | 93 |
94 |   102 |
103 | 104 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /Doxygen/html/globals_eval.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | kd-GeRaF: File Members 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | 30 | 31 | 32 |
25 |
kd-GeRaF 26 |  1.0 27 |
28 |
High-dimensional nearest neighbor
29 |
33 |
34 | 35 | 36 | 39 | 63 | 69 | 78 |
79 | 80 | 85 | 86 | 87 |
88 | 91 |
92 | 93 |
94 |   102 |
103 | 104 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /Doxygen/html/functions_rela.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | kd-GeRaF: Class Members - Related Functions 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | 30 | 31 | 32 |
25 |
kd-GeRaF 26 |  1.0 27 |
28 |
High-dimensional nearest neighbor
29 |
33 |
34 | 35 | 36 | 39 | 63 | 71 | 80 |
81 | 82 | 87 | 88 | 89 |
90 | 93 |
94 | 95 |
96 |   107 |
108 | 109 | 114 | 115 | 116 | --------------------------------------------------------------------------------