23 #ifndef __MLPACK_METHODS_FASTMKS_FASTMKS_HPP
24 #define __MLPACK_METHODS_FASTMKS_FASTMKS_HPP
83 const bool naive =
false);
95 FastMKS(
const arma::mat& referenceSet,
98 const bool naive =
false);
111 FastMKS(
const arma::mat& referenceSet,
113 const bool single =
false,
114 const bool naive =
false);
128 FastMKS(
const arma::mat& referenceSet,
129 const arma::mat& querySet,
131 const bool single =
false,
132 const bool naive =
false);
146 FastMKS(
const arma::mat& referenceSet,
148 const bool single =
false,
149 const bool naive =
false);
164 FastMKS(
const arma::mat& referenceSet,
165 TreeType* referenceTree,
166 const arma::mat& querySet,
168 const bool single =
false,
169 const bool naive =
false);
188 void Search(
const size_t k,
189 arma::Mat<size_t>& indices,
190 arma::mat& products);
228 const size_t queryIndex,
230 const size_t neighbor,
231 const double distance);
238 #include "fastmks_impl.hpp"
FastMKS(const arma::mat &referenceSet, const bool single=false, const bool naive=false)
Create the FastMKS object using the reference set as the query set.
Linear algebra utility functions, generally performed on matrices or vectors.
void InsertNeighbor(arma::Mat< size_t > &indices, arma::mat &products, const size_t queryIndex, const size_t pos, const size_t neighbor, const double distance)
Utility function. Copied too many times from too many places.
const arma::mat & referenceSet
The reference dataset.
const metric::IPMetric< KernelType > & Metric() const
Get the inner-product metric induced by the given kernel.
bool treeOwner
If true, this object created the trees and is responsible for them.
TreeType * queryTree
The tree built on the query dataset.
TreeType * referenceTree
The tree built on the reference dataset.
const arma::mat & querySet
The query dataset.
metric::IPMetric< KernelType > & Metric()
Modify the inner-product metric induced by the given kernel.
bool single
If true, single-tree search is used.
void Search(const size_t k, arma::Mat< size_t > &indices, arma::mat &products)
Search for the maximum inner products of the query set (or if no query set was passed, the reference set is used).
bool naive
If true, naive (brute-force) search is used.
The statistic used in trees with FastMKS.
~FastMKS()
Destructor for the FastMKS object.
This class is meant to be used as a choice for the policy class RootPointPolicy of the CoverTree clas...
An implementation of fast exact max-kernel search.
A cover tree is a tree specifically designed to speed up nearest-neighbor computation in high-dimensi...
metric::IPMetric< KernelType > metric
The instantiated inner-product metric induced by the given kernel.
std::string ToString() const
Returns a string representation of this object.