36 template <
class T,
class DataSource,
typename _DistanceType>
39 template <
class T,
class DataSource,
typename _DistanceType>
42 template <
typename Distance,
class DatasetAdaptor,
int DIM,
typename IndexType>
61 template <
int METRIC,
class T>
65 DataAdaptor(
size_t dataset_size,
int dimension,
const T *
const data_ptr)
66 : dataset_size_(dataset_size),
67 dimension_(dimension),
68 data_ptr_(data_ptr) {}
73 return data_ptr_[idx * dimension_ + dim];
81 size_t dataset_size_ = 0;
87 template <
int M,
typename fake =
void>
90 template <
typename fake>
95 template <
typename fake>
111 adaptor_.reset(
new DataAdaptor(dataset_size, dimension, data_ptr));
112 index_.reset(
new KDTree_t(dimension, *adaptor_.get()));
113 index_->buildIndex();
143 bool SetTensorData(
const Tensor &dataset_points);
153 std::pair<Tensor, Tensor> SearchKnn(
const Tensor &query_points,
int knn);
165 std::tuple<Tensor, Tensor, Tensor> SearchRadius(
const Tensor &query_points,
178 std::tuple<Tensor, Tensor, Tensor> SearchRadius(
const Tensor &query_points,
183 int GetDimension()
const;
187 size_t GetDatasetSize()
const;
191 Dtype GetDtype()
const;
195 std::unique_ptr<NanoFlannIndexHolderBase>
holder_;
const T *const data_ptr_
Definition: NanoFlannIndex.h:83
NanoFlannIndexHolder(size_t dataset_size, int dimension, const T *data_ptr)
Definition: NanoFlannIndex.h:108
Definition: NanoFlannIndex.h:40
size_t kdtree_get_point_count() const
Definition: NanoFlannIndex.h:70
virtual ~NanoFlannIndexHolderBase()
Definition: NanoFlannIndex.h:57
nanoflann::L1_Adaptor< T, DataAdaptor, T > adaptor_t
Definition: NanoFlannIndex.h:97
Definition: NanoFlannIndex.h:53
Base struct for Index holder.
Definition: NanoFlannIndex.h:56
Metric
Distance metric enum.
Definition: NanoFlannIndex.h:53
Definition: NanoFlannIndex.h:123
NanoFlann Index Holder.
Definition: NanoFlannIndex.h:62
Definition: NanoFlannIndex.h:53
T kdtree_get_pt(const size_t idx, const size_t dim) const
Definition: NanoFlannIndex.h:72
Adaptor Selector.
Definition: NanoFlannIndex.h:88
This class is the Adaptor for connecting Open3D Tensor and NanoFlann.
Definition: NanoFlannIndex.h:64
bool kdtree_get_bbox(BBOX &) const
Definition: NanoFlannIndex.h:77
Tensor dataset_points_
Definition: NanoFlannIndex.h:194
std::unique_ptr< DataAdaptor > adaptor_
Definition: NanoFlannIndex.h:117
std::unique_ptr< NanoFlannIndexHolderBase > holder_
Definition: NanoFlannIndex.h:195
Definition: NanoFlannIndex.h:43
nanoflann::KDTreeSingleIndexAdaptor< typename SelectNanoflannAdaptor< METRIC >::adaptor_t, DataAdaptor, -1, int64_t > KDTree_t
typedef for KDtree.
Definition: NanoFlannIndex.h:106
Definition: PinholeCameraIntrinsic.cpp:35
Definition: NanoFlannIndex.h:37
DataAdaptor(size_t dataset_size, int dimension, const T *const data_ptr)
Definition: NanoFlannIndex.h:65
Definition: NanoFlannIndex.h:53
std::unique_ptr< KDTree_t > index_
Definition: NanoFlannIndex.h:116
nanoflann::L2_Adaptor< T, DataAdaptor, T > adaptor_t
Definition: NanoFlannIndex.h:92
Definition: NanoFlannIndex.h:34