ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
NNSIndex.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <vector>
11 
13 
14 namespace cloudViewer {
15 namespace core {
16 namespace nns {
17 
21 class NNSIndex {
22 public:
24  NNSIndex() {}
25  virtual ~NNSIndex() {}
26  NNSIndex(const NNSIndex &) = delete;
27  NNSIndex &operator=(const NNSIndex &) = delete;
28 
29 public:
35  virtual bool SetTensorData(const Tensor &dataset_points,
36  const Dtype &index_dtype) = 0;
37 
43  virtual bool SetTensorData(const Tensor &dataset_points,
44  double radius,
45  const Dtype &index_dtype) = 0;
46 
55  virtual std::pair<Tensor, Tensor> SearchKnn(const Tensor &query_points,
56  int knn) const = 0;
57 
68  virtual std::tuple<Tensor, Tensor, Tensor> SearchRadius(
69  const Tensor &query_points,
70  const Tensor &radii,
71  bool sort) const = 0;
72 
83  virtual std::tuple<Tensor, Tensor, Tensor> SearchRadius(
84  const Tensor &query_points, double radius, bool sort) const = 0;
85 
96  virtual std::tuple<Tensor, Tensor, Tensor> SearchHybrid(
97  const Tensor &query_points, double radius, int max_knn) const = 0;
98 
101  int GetDimension() const;
102 
105  size_t GetDatasetSize() const;
106 
109  Dtype GetDtype() const;
110 
113  Device GetDevice() const;
114 
117  Dtype GetIndexDtype() const;
118 
119 protected:
122 };
123 } // namespace nns
124 } // namespace core
125 } // namespace cloudViewer
NNSIndex()
Default Constructor.
Definition: NNSIndex.h:24
NNSIndex(const NNSIndex &)=delete
virtual std::tuple< Tensor, Tensor, Tensor > SearchHybrid(const Tensor &query_points, double radius, int max_knn) const =0
virtual bool SetTensorData(const Tensor &dataset_points, const Dtype &index_dtype)=0
virtual std::tuple< Tensor, Tensor, Tensor > SearchRadius(const Tensor &query_points, double radius, bool sort) const =0
NNSIndex & operator=(const NNSIndex &)=delete
virtual std::pair< Tensor, Tensor > SearchKnn(const Tensor &query_points, int knn) const =0
virtual std::tuple< Tensor, Tensor, Tensor > SearchRadius(const Tensor &query_points, const Tensor &radii, bool sort) const =0
virtual bool SetTensorData(const Tensor &dataset_points, double radius, const Dtype &index_dtype)=0
Generic file read and write utility for python interface.
std::vector< PointCoordinateType > radii
Definition: qM3C2Tools.cpp:42