DataTransferKit - Multiphysics Solution Transfer Services
2.0
|
#include <DTK_nanoflann.hpp>
Classes | |
struct | BranchStruct |
Public Member Functions | |
KDTreeSingleIndexAdaptor (const int dimensionality, const DatasetAdaptor &inputData, const KDTreeSingleIndexAdaptorParams ¶ms=KDTreeSingleIndexAdaptorParams()) | |
~KDTreeSingleIndexAdaptor () | |
void | freeIndex () |
void | buildIndex () |
size_t | size () const |
size_t | veclen () const |
size_t | usedMemory () const |
void | saveIndex (FILE *stream) |
void | loadIndex (FILE *stream) |
Query methods | |
template<typename RESULTSET > | |
void | findNeighbors (RESULTSET &result, const ElementType *vec, const SearchParams &searchParams) const |
void | knnSearch (const ElementType *query_point, const size_t num_closest, IndexType *out_indices, DistanceType *out_distances_sq, const int nChecks_IGNORED=10) const |
size_t | radiusSearch (const ElementType *query_point, const DistanceType radius, Teuchos::Array< std::pair< IndexType, DistanceType >> &IndicesDists, const SearchParams &searchParams) const |
Protected Types | |
typedef array_or_vector_selector< DIM, Interval >::container_t | BoundingBox |
typedef array_or_vector_selector< DIM, DistanceType >::container_t | distance_vector_t |
Protected Attributes | |
Teuchos::Array< IndexType > | vind |
const DatasetAdaptor & | dataset |
The source of our data. More... | |
int | dim |
Dimensionality of each data point. More... | |
NodePtr | root_node |
PooledAllocator | pool |
kd-tree index
Contains the k-d trees and other information for indexing a set of points for nearest-neighbor matching.
The class "DatasetAdaptor" must provide the following interface (can be non-virtual, inlined methods):
IndexType | Will be typically size_t or int |
Definition at line 891 of file DTK_nanoflann.hpp.
|
protected |
Define "BoundingBox" as a fixed-size or variable-size container depending on "DIM"
Definition at line 954 of file DTK_nanoflann.hpp.
|
protected |
Define "distance_vector_t" as a fixed-size or variable-size container depending on "DIM"
Definition at line 959 of file DTK_nanoflann.hpp.
|
inline |
KDTree constructor
Params: inputData = dataset with the input features params = parameters passed to the kdtree algorithm (see http://code.google.com/p/nanoflann/ for help choosing the parameters)
Definition at line 1014 of file DTK_nanoflann.hpp.
|
inline |
Standard destructor
Definition at line 1041 of file DTK_nanoflann.hpp.
|
inline |
Frees the previously-built index. Automatically called within buildIndex().
Definition at line 1045 of file DTK_nanoflann.hpp.
|
inline |
Builds the index
Definition at line 1054 of file DTK_nanoflann.hpp.
|
inline |
Returns size of index.
Definition at line 1065 of file DTK_nanoflann.hpp.
|
inline |
Returns the length of an index feature.
Definition at line 1070 of file DTK_nanoflann.hpp.
|
inline |
Computes the inde memory usage Returns: memory used by the index
Definition at line 1076 of file DTK_nanoflann.hpp.
|
inline |
Find set of nearest neighbors to vec[0:dim-1]. Their indices are stored inside the result object.
Params: result = the result object in which the indices of the nearest-neighbors are stored vec = the vector for which to search the nearest neighbors
RESULTSET | Should be any ResultSet<DistanceType> |
Definition at line 1100 of file DTK_nanoflann.hpp.
|
inline |
Find the "num_closest" nearest neighbors to the query_point[0:dim-1]. Their indices are stored inside the result object.
Definition at line 1126 of file DTK_nanoflann.hpp.
|
inline |
Find all the neighbors to query_point[0:dim-1] within a maximum radius. The output is given as a vector of pairs, of which the first element is a point index and the second the corresponding distance. Previous contents of IndicesDists are cleared.
If searchParams.sorted==true, the output list is sorted by ascending distances.
For a better performance, it is advisable to do a .reserve() on the vector if you have any wild guess about the number of expected matches.
Definition at line 1155 of file DTK_nanoflann.hpp.
|
inline |
Stores the index in a binary file. IMPORTANT NOTE: The set of data points is NOT stored in the file, so when loading the index object it must be constructed associated to the same source of data points used while building it. See the example: examples/saveload_example.cpp
Definition at line 1588 of file DTK_nanoflann.hpp.
|
inline |
Loads a previous index from a binary file. IMPORTANT NOTE: The set of data points is NOT stored in the file, so the index object must be constructed associated to the same source of data points used while building the index. See the example: examples/saveload_example.cpp
Definition at line 1604 of file DTK_nanoflann.hpp.
|
protected |
Array of indices to vectors in the dataset.
Definition at line 901 of file DTK_nanoflann.hpp.
|
protected |
The source of our data.
The dataset used by this index
Definition at line 908 of file DTK_nanoflann.hpp.
|
protected |
Dimensionality of each data point.
Definition at line 913 of file DTK_nanoflann.hpp.
|
protected |
Array of k-d trees used to find neighbours.
Definition at line 988 of file DTK_nanoflann.hpp.
|
protected |
Pooled memory allocator.
Using a pooled memory allocator is more efficient than allocating memory directly when there is a large number small of memory allocations.
Definition at line 1001 of file DTK_nanoflann.hpp.