main.cc
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 #include <string>
00051 #include "disk_allnn.h"
00052
00053 int main (int argc, char *argv[]) {
00054 fx_module *fx_root=fx_init(argc, argv, NULL);
00055 mmapmm::MemoryManager<false>::allocator_= new mmapmm::MemoryManager<false>();
00056 mmapmm::MemoryManager<false>::allocator_->set_capacity(4294967296);
00057 std::string memfile=fx_param_str(fx_root, "memfile", "/scratch/gtg739c/temp_mem");
00058 mmapmm::MemoryManager<false>::allocator_->set_pool_name(memfile.c_str());
00059 mmapmm::MemoryManager<false>::allocator_->Init(fx_root);
00060 DiskAllNN disk_allnn;
00061 Matrix data_for_tree;
00062 std::string filename=fx_param_str_req(fx_root, "file");
00063 NOTIFY("Loading file...");
00064 data::LargeLoad(filename.c_str(), &data_for_tree);
00065 NOTIFY("File loaded...");
00066 disk_allnn.Init(data_for_tree, fx_root);
00067 GenVector<index_t> resulting_neighbors_tree;
00068 GenVector<double> resulting_distances_tree;
00069 NOTIFY("Computing Neighbors...");
00070 disk_allnn.ComputeNeighbors(&resulting_neighbors_tree, &resulting_distances_tree);
00071 NOTIFY("Neighbors Computed...");
00072 fx_done(fx_root);
00073 }