12#ifndef MLPACK_METHODS_CF_LMETRIC_SEARCH_HPP
13#define MLPACK_METHODS_CF_LMETRIC_SEARCH_HPP
52 LMetricSearch(
const arma::mat& referenceSet) : neighborSearch(referenceSet)
64 void Search(
const arma::mat& query,
const size_t k,
65 arma::Mat<size_t>& neighbors, arma::mat& similarities)
67 neighborSearch.
Search(query, k, neighbors, similarities);
71 similarities = 1.0 / (1.0 + similarities);
Nearest neighbor search with L_p distance.
void Search(const arma::mat &query, const size_t k, arma::Mat< size_t > &neighbors, arma::mat &similarities)
Given a set of query points, find the nearest k neighbors, and return similarites.
neighbor::NeighborSearch< neighbor::NearestNeighborSort, metric::LMetric< TPower, true > > NeighborSearchType
LMetricSearch(const arma::mat &referenceSet)
The L_p metric for arbitrary integer p, with an option to take the root.
void Search(const MatType &querySet, const size_t k, arma::Mat< size_t > &neighbors, arma::mat &distances)
For each point in the query set, compute the nearest neighbors and store the output in the given matr...
NearestNS NearestNeighborSort
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.