mlpack
Functions
range_search_main.cpp File Reference
#include <mlpack/prereqs.hpp>
#include <mlpack/core/util/io.hpp>
#include <mlpack/core/util/mlpack_main.hpp>
#include <mlpack/core/metrics/lmetric.hpp>
#include <mlpack/core/tree/cover_tree.hpp>
#include "range_search.hpp"
#include "rs_model.hpp"
Include dependency graph for range_search_main.cpp:
This graph shows which files directly or indirectly include this file:

Functions

 BINDING_NAME ("Range Search")
 
 BINDING_SHORT_DESC ("An implementation of range search with single-tree and dual-tree " "algorithms. Given a set of reference points and a set of query points and" " a range, this can find the set of reference points within the desired " "range for each query point, and any trees built during the computation can" " be saved for reuse with future range searches.")
 
 BINDING_LONG_DESC ("This program implements range search with a Euclidean distance metric. " "For a given query point, a given range, and a given set of reference " "points, the program will return all of the reference points with distance " "to the query point in the given range. This is performed for an entire " "set of query points. You may specify a separate set of reference and query" " points, or only a reference set -- which is then used as both the " "reference and query set. The given range is taken to be inclusive (that " "is, points with a distance exactly equal to the minimum and maximum of the" " range are included in the results).")
 
 BINDING_EXAMPLE ("For example, the following will calculate the points within the range [2, " "5] of each point in "+PRINT_DATASET("input")+" and store the" " distances in"+PRINT_DATASET("distances")+" and the neighbors in "+PRINT_DATASET("neighbors")+"\"+PRINT_CALL("range_search", "min", 2, "max", 5, "distances_file", "input", "distances_file", "distances", "neighbors_file", "neighbors")+"\" "The output files are organized such that line i corresponds to the points " "found for query point i. Because sometimes 0 points may be found in the " "given range, lines of the output files may be empty. The points are not " "ordered in any specific manner." "\" "Because the number of points returned for each query point may differ, the" " resultant CSV-like files may not be loadable by many programs. However, " "at this time a better way to store this non-square result is not known. " "As a result, any output files will be written as CSVs in this manner, " "regardless of the given extension.")
 
 BINDING_SEE_ALSO ("@knn", "#knn")
 
 BINDING_SEE_ALSO ("Range searching on Wikipedia", "https://en.wikipedia.org/wiki/Range_searching")
 
 BINDING_SEE_ALSO ("Tree-independent dual-tree algorithms (pdf)", "http://proceedings.mlr.press/v28/curtin13.pdf")
 
 BINDING_SEE_ALSO ("mlpack::range::RangeSearch C++ class documentation", "@doxygen/classmlpack_1_1range_1_1RangeSearch.html")
 
 PARAM_MATRIX_IN ("reference", "Matrix containing the reference dataset.", "r")
 
 PARAM_STRING_OUT ("distances_file", "File to output distances into.", "d")
 
 PARAM_STRING_OUT ("neighbors_file", "File to output neighbors into.", "n")
 
 PARAM_MODEL_IN (RSModel, "input_model", "File containing pre-trained range " "search model.", "m")
 
 PARAM_MODEL_OUT (RSModel, "output_model", "If specified, the range search model " "will be saved to the given file.", "M")
 
 PARAM_MATRIX_IN ("query", "File containing query points (optional).", "q")
 
 PARAM_DOUBLE_IN ("max", "Upper bound in range (if not specified, +inf will be " "used.", "U", 0.0)
 
 PARAM_DOUBLE_IN ("min", "Lower bound in range.", "L", 0.0)
 
 PARAM_STRING_IN ("tree_type", "Type of tree to use: 'kd', 'vp', 'rp', 'max-rp', " "'ub', 'cover', 'r', 'r-star', 'x', 'ball', 'hilbert-r', 'r-plus', " "'r-plus-plus', 'oct'.", "t", "kd")
 
 PARAM_INT_IN ("leaf_size", "Leaf size for tree building (used for kd-trees, " "vp trees, random projection trees, UB trees, R trees, R* trees, X trees, " "Hilbert R trees, R+ trees, R++ trees, and octrees).", "l", 20)
 
 PARAM_FLAG ("random_basis", "Before tree-building, project the data onto a " "random orthogonal basis.", "R")
 
 PARAM_INT_IN ("seed", "Random seed (if 0, std::time(NULL) is used).", "s", 0)
 
 PARAM_FLAG ("naive", "If true, O(n^2) naive mode is used for computation.", "N")
 
 PARAM_FLAG ("single_mode", "If true, single-tree search is used (as opposed to " "dual-tree search).", "S")
 

Detailed Description

Author
Ryan Curtin
Matthew Amidon

Implementation of the RangeSearch executable. Allows some number of standard options.

mlpack is free software; you may redistribute it and/or modify it under the terms of the 3-clause BSD license. You should have received a copy of the 3-clause BSD license along with mlpack. If not, see http://www.opensource.org/licenses/BSD-3-Clause for more information.