Mantid
|
#include <NearestNeighbours.h>
Public Types | |
using | NearestNeighbourResults = std::vector< std::tuple< VectorType, size_t, double > > |
using | VectorType = Eigen::Matrix< double, N, 1 > |
Public Member Functions | |
NearestNeighbourResults | findNearest (const VectorType &pos, const size_t k=1, const double error=0.0) |
Find the k nearest neighbours to a given point. More... | |
NearestNeighbours (const NearestNeighbours &)=delete | |
NearestNeighbours (const std::vector< VectorType > &points) | |
Create a nearest neighbour search object. More... | |
~NearestNeighbours () | |
Private Member Functions | |
NearestNeighbourResults | makeResults (const size_t k, const std::unique_ptr< ANNidx[]> nnIndexList, const std::unique_ptr< ANNdist[]> nnDistList) |
Helper function to create a instance of NearestNeighbourResults. More... | |
Private Attributes | |
std::unique_ptr< NNDataPoints > | m_dataPoints |
handle to the list of data points to search through More... | |
std::unique_ptr< ANNkd_tree > | m_kdTree |
handle to the ANN KD-tree used for searching More... | |
Definition at line 84 of file NearestNeighbours.h.
using Mantid::Kernel::NearestNeighbours< N >::NearestNeighbourResults = std::vector<std::tuple<VectorType, size_t, double> > |
Definition at line 89 of file NearestNeighbours.h.
using Mantid::Kernel::NearestNeighbours< N >::VectorType = Eigen::Matrix<double, N, 1> |
Definition at line 88 of file NearestNeighbours.h.
|
inline |
Create a nearest neighbour search object.
points | :: vector of Eigen::Vectors to search through |
Definition at line 95 of file NearestNeighbours.h.
|
inline |
Definition at line 108 of file NearestNeighbours.h.
|
delete |
|
inline |
Find the k nearest neighbours to a given point.
This is a thin wrapper around the ANN library annkSearch method
pos | :: the position to find th k nearest neighbours of |
k | :: the number of neighbours to find |
error | :: error term for finding approximate nearest neighbours. if zero then exact neighbours will be found. (default = 0.0). |
Definition at line 122 of file NearestNeighbours.h.
References error.
Referenced by Mantid::MDAlgorithms::IntegrateEllipsoidsTwoStep::exec().
|
inlineprivate |
Helper function to create a instance of NearestNeighbourResults.
k | :: the number of neighbours searched for |
nnIndexList | :: the ordered list of indicies matching the closest k neighbours |
nnDistList | :: the ordered list of distances matching the closest k neighbours |
Definition at line 148 of file NearestNeighbours.h.
|
private |
handle to the list of data points to search through
Definition at line 164 of file NearestNeighbours.h.
|
private |
handle to the ANN KD-tree used for searching
Definition at line 166 of file NearestNeighbours.h.