17 #ifndef __MLPACK_METHODS_RANGE_SEARCH_RS_MODEL_HPP 18 #define __MLPACK_METHODS_RANGE_SEARCH_RS_MODEL_HPP 51 template<
template<
typename TreeMetricType,
52 typename TreeStatType,
53 typename TreeMatType>
class TreeType>
76 RSModel(
const int treeType = TreeTypes::KD_TREE,
77 const bool randomBasis =
false);
85 template<
typename Archive>
86 void Serialize(Archive& ar,
const unsigned int );
89 const arma::mat&
Dataset()
const;
127 const size_t leafSize,
129 const bool singleMode);
141 void Search(arma::mat&& querySet,
143 std::vector<std::vector<size_t>>& neighbors,
144 std::vector<std::vector<double>>& distances);
156 std::vector<std::vector<size_t>>& neighbors,
157 std::vector<std::vector<double>>& distances);
176 #include "rs_model_impl.hpp" The RangeSearch class is a template class for performing range searches.
void BuildModel(arma::mat &&referenceSet, const size_t leafSize, const bool naive, const bool singleMode)
Build the reference tree on the given dataset with the given parameters.
void Serialize(Archive &ar, const unsigned int)
Serialize the range search model.
RSType< tree::RStarTree > * rStarTreeRS
R* tree based range search object (NULL if not in use).
RSType< tree::RTree > * rTreeRS
R tree based range search object (NULL if not in use).
const arma::mat & Dataset() const
Expose the dataset.
Linear algebra utility functions, generally performed on matrices or vectors.
int & TreeType()
Modify the type of tree (don't do this after the model has been built).
std::string TreeName() const
Return a string representing the name of the tree.
arma::mat q
Random projection matrix.
bool & RandomBasis()
Modify whether a random basis is used (don't do this after the model has been built).
bool SingleMode() const
Get whether the model is in single-tree search mode.
size_t LeafSize() const
Get the leaf size (applicable to everything but the cover tree).
void CleanMemory()
Clean up memory.
RSType< tree::StandardCoverTree > * coverTreeRS
Cover tree based range search object (NULL if not in use).
bool randomBasis
If true, we randomly project the data into a new basis before search.
Simple real-valued range.
int TreeType() const
Get the type of tree.
bool Naive() const
Get whether the model is in naive search mode.
RSModel(const int treeType=TreeTypes::KD_TREE, const bool randomBasis=false)
Initialize the RSModel with the given type and whether or not a random basis should be used...
bool RandomBasis() const
Get whether a random basis is used.
~RSModel()
Clean memory, if necessary.
size_t & LeafSize()
Modify the leaf size (applicable to everything but the cover tree).
void Search(arma::mat &&querySet, const math::Range &range, std::vector< std::vector< size_t >> &neighbors, std::vector< std::vector< double >> &distances)
Perform range search.
RSType< tree::KDTree > * kdTreeRS
kd-tree based range search object (NULL if not in use).
RSType< tree::BallTree > * ballTreeRS
Ball tree based range search object (NULL if not in use).