18 bool NearestNeighborSearch::SetIndex() {
25 #ifdef BUILD_CUDA_MODULE
30 "-DBUILD_CUDA_MODULE=OFF. Please recompile CloudViewer with "
31 "-DBUILD_CUDA_MODULE=ON.");
44 #ifdef BUILD_CUDA_MODULE
50 "FixedRadiusIndex with GPU tensor is disabled since "
51 "-DBUILD_CUDA_MODULE=OFF. Please recompile CloudViewer with "
52 "-DBUILD_CUDA_MODULE=ON.");
64 #ifdef BUILD_CUDA_MODULE
70 "-DBUILD_CUDA_MODULE=OFF. Please recompile CloudViewer with "
71 "-DBUILD_CUDA_MODULE=ON.");
80 const Tensor& query_points,
int knn) {
85 return knn_index_->SearchKnn(query_points, knn);
99 const Tensor& query_points,
double radius,
bool sort) {
120 AssertNotCUDA(query_points);
131 const Tensor& query_points,
133 const int max_knn)
const {
153 void NearestNeighborSearch::AssertNotCUDA(
const Tensor& t)
const {
156 "TODO: NearestNeighborSearch does not support CUDA tensor "
#define AssertTensorDevice(tensor,...)
#define AssertTensorDtype(tensor,...)
Device GetDevice() const override
FixedRadiusIndex for nearest neighbor range search.
std::tuple< Tensor, Tensor, Tensor > FixedRadiusSearch(const Tensor &query_points, double radius, bool sort=true)
std::unique_ptr< nns::KnnIndex > knn_index_
bool HybridIndex(utility::optional< double > radius={})
std::unique_ptr< nns::FixedRadiusIndex > fixed_radius_index_
const Tensor dataset_points_
bool FixedRadiusIndex(utility::optional< double > radius={})
std::tuple< Tensor, Tensor, Tensor > HybridSearch(const Tensor &query_points, const double radius, const int max_knn) const
std::unique_ptr< NanoFlannIndex > nanoflann_index_
std::tuple< Tensor, Tensor, Tensor > MultiRadiusSearch(const Tensor &query_points, const Tensor &radii)
std::pair< Tensor, Tensor > KnnSearch(const Tensor &query_points, int knn)
constexpr bool has_value() const noexcept
constexpr T const & value() const &
Generic file read and write utility for python interface.