10 #include <nanoflann.hpp>
22 #define HOST_DEVICE __host__ __device__
29 return x * 73856096 ^ y * 193649663 ^ z * 83492791;
41 template <
class TVecf>
43 const TVecf& pos,
const typename TVecf::Scalar_t& inv_voxel_size) {
44 TVecf ref_coord = pos * inv_voxel_size;
47 voxel_index =
floor(ref_coord).template cast<int>();
56 Adaptor(
size_t num_points,
const T*
const data)
57 : num_points(num_points), data(data) {}
62 return data[3 * idx + dim];
75 template <
int METRIC,
class T>
80 typedef nanoflann::L2_Adaptor<T, Adaptor<T>>
Adaptor_t;
85 typedef nanoflann::L1_Adaptor<T, Adaptor<T>>
Adaptor_t;
Adaptor for nanoflann.
Definition: NeighborSearchCommon.h:54
Adaptor(size_t num_points, const T *const data)
Definition: NeighborSearchCommon.h:56
size_t kdtree_get_point_count() const
Definition: NeighborSearchCommon.h:59
bool kdtree_get_bbox(BBOX &) const
Definition: NeighborSearchCommon.h:66
T kdtree_get_pt(const size_t idx, int dim) const
Definition: NeighborSearchCommon.h:61
#define HOST_DEVICE
Definition: NeighborSearchCommon.h:24
HOST_DEVICE size_t SpatialHash(int x, int y, int z)
Spatial hashing function for integer coordinates.
Definition: NeighborSearchCommon.h:28
Metric
Supported metrics.
Definition: NeighborSearchCommon.h:19
@ Linf
Definition: NeighborSearchCommon.h:19
@ L1
Definition: NeighborSearchCommon.h:19
@ L2
Definition: NeighborSearchCommon.h:19
HOST_DEVICE utility::MiniVec< int, 3 > ComputeVoxelIndex(const TVecf &pos, const typename TVecf::Scalar_t &inv_voxel_size)
Definition: NeighborSearchCommon.h:42
FN_SPECIFIERS MiniVec< float, N > floor(const MiniVec< float, N > &a)
Definition: MiniVec.h:75
Definition: PinholeCameraIntrinsic.cpp:16
nanoflann::L1_Adaptor< T, Adaptor< T > > Adaptor_t
Definition: NeighborSearchCommon.h:85
nanoflann::L2_Adaptor< T, Adaptor< T > > Adaptor_t
Definition: NeighborSearchCommon.h:80
Definition: NeighborSearchCommon.h:76