main.cc

00001 /* MLPACK 0.2
00002  *
00003  * Copyright (c) 2008, 2009 Alexander Gray,
00004  *                          Garry Boyer,
00005  *                          Ryan Riegel,
00006  *                          Nikolaos Vasiloglou,
00007  *                          Dongryeol Lee,
00008  *                          Chip Mappus, 
00009  *                          Nishant Mehta,
00010  *                          Hua Ouyang,
00011  *                          Parikshit Ram,
00012  *                          Long Tran,
00013  *                          Wee Chin Wong
00014  *
00015  * Copyright (c) 2008, 2009 Georgia Institute of Technology
00016  *
00017  * This program is free software; you can redistribute it and/or
00018  * modify it under the terms of the GNU General Public License as
00019  * published by the Free Software Foundation; either version 2 of the
00020  * License, or (at your option) any later version.
00021  *
00022  * This program is distributed in the hope that it will be useful, but
00023  * WITHOUT ANY WARRANTY; without even the implied warranty of
00024  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00025  * General Public License for more details.
00026  *
00027  * You should have received a copy of the GNU General Public License
00028  * along with this program; if not, write to the Free Software
00029  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00030  * 02110-1301, USA.
00031  */
00032 /*
00033  * =====================================================================================
00034  *
00035  *       Filename:  main.cc
00036  *
00037  *    Description:  
00038  *
00039  *        Version:  1.0
00040  *        Created:  07/14/2008 07:15:55 PM EDT
00041  *       Revision:  none
00042  *       Compiler:  gcc
00043  *
00044  *         Author:  Nikolaos Vasiloglou (NV), nvasil@ieee.org
00045  *        Company:  Georgia Tech Fastlab-ESP Lab
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 }
Generated on Mon Jan 24 12:04:37 2011 for FASTlib by  doxygen 1.6.3