15 #ifndef __MLPACK_METHODS_FASTMKS_FASTMKS_HPP
16 #define __MLPACK_METHODS_FASTMKS_FASTMKS_HPP
75 const bool naive =
false);
87 FastMKS(
const arma::mat& referenceSet,
90 const bool naive =
false);
103 FastMKS(
const arma::mat& referenceSet,
105 const bool single =
false,
106 const bool naive =
false);
120 FastMKS(
const arma::mat& referenceSet,
121 const arma::mat& querySet,
123 const bool single =
false,
124 const bool naive =
false);
138 FastMKS(
const arma::mat& referenceSet,
140 const bool single =
false,
141 const bool naive =
false);
156 FastMKS(
const arma::mat& referenceSet,
157 TreeType* referenceTree,
158 const arma::mat& querySet,
160 const bool single =
false,
161 const bool naive =
false);
180 void Search(
const size_t k,
181 arma::Mat<size_t>& indices,
182 arma::mat& products);
220 const size_t queryIndex,
222 const size_t neighbor,
223 const double distance);
230 #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.