uvgVPCCenc 1.0.0
uvgVPCCenc is an open-source real-time V-PCC encoder library written in C++ from scratch.
|
#include <nanoflann.hpp>
Classes | |
struct | Interval |
struct | Node |
Public Types | |
using | ElementType = typename Distance::ElementType |
using | DistanceType = typename Distance::DistanceType |
using | Offset = typename decltype(vAcc_)::size_type |
using | Size = typename decltype(vAcc_)::size_type |
using | Dimension = int32_t |
using | NodePtr = Node * |
using | NodeConstPtr = const Node * |
using | BoundingBox = typename array_or_vector< DIM, Interval >::type |
using | distance_vector_t = typename array_or_vector< DIM, DistanceType >::type |
Public Member Functions | |
void | freeIndex (Derived &obj) |
Size | size (const Derived &obj) const |
Size | veclen (const Derived &obj) |
ElementType | dataset_get (const Derived &obj, IndexType element, Dimension component) const |
Helper accessor to the dataset points: | |
Size | usedMemory (Derived &obj) |
void | computeMinMax (const Derived &obj, Offset ind, Size count, Dimension element, ElementType &min_elem, ElementType &max_elem) |
NodePtr | divideTree (Derived &obj, const Offset left, const Offset right, BoundingBox &bbox) |
NodePtr | divideTreeConcurrent (Derived &obj, const Offset left, const Offset right, BoundingBox &bbox, std::atomic< unsigned int > &thread_count, std::mutex &mutex) |
void | middleSplit_ (const Derived &obj, const Offset ind, const Size count, Offset &index, Dimension &cutfeat, DistanceType &cutval, const BoundingBox &bbox) |
void | planeSplit (const Derived &obj, const Offset ind, const Size count, const Dimension cutfeat, const DistanceType &cutval, Offset &lim1, Offset &lim2) |
DistanceType | computeInitialDistances (const Derived &obj, const ElementType *vec, distance_vector_t &dists) const |
void | saveIndex (const Derived &obj, std::ostream &stream) const |
void | loadIndex (Derived &obj, std::istream &stream) |
Static Public Member Functions | |
static void | save_tree (const Derived &obj, std::ostream &stream, const NodeConstPtr tree) |
static void | load_tree (Derived &obj, std::istream &stream, NodePtr &tree) |
Public Attributes | |
std::vector< IndexType > | vAcc_ |
NodePtr | root_node_ = nullptr |
Size | leaf_max_size_ = 0 |
Size | n_thread_build_ = 1 |
Number of thread for concurrent tree build. | |
Size | size_ = 0 |
Number of current points in the dataset. | |
Size | size_at_index_build_ = 0 |
Number of points in the dataset when the index was built. | |
Dimension | dim_ = 0 |
Dimensionality of each data point. | |
BoundingBox | root_bbox_ |
PooledAllocator | pool_ |
kd-tree base-class
Contains the member functions common to the classes KDTreeSingleIndexAdaptor and KDTreeSingleIndexDynamicAdaptor_.
Derived | The name of the class which inherits this class. |
DatasetAdaptor | The user-provided adaptor, which must be ensured to have a lifetime equal or longer than the instance of this class. |
Distance | The distance metric to use, these are all classes derived from nanoflann::Metric |
DIM | Dimensionality of data points (e.g. 3 for 3D points) |
IndexType | Type of the arguments with which the data can be accessed (e.g. float, double, int64_t, T*) |
using nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::BoundingBox = typename array_or_vector<DIM, Interval>::type |
Define "BoundingBox" as a fixed-size or variable-size container depending on "DIM"
using nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::Dimension = int32_t |
using nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::distance_vector_t = typename array_or_vector<DIM, DistanceType>::type |
Define "distance_vector_t" as a fixed-size or variable-size container depending on "DIM"
using nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::DistanceType = typename Distance::DistanceType |
using nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::ElementType = typename Distance::ElementType |
using nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::NodeConstPtr = const Node* |
using nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::NodePtr = Node* |
using nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::Offset = typename decltype(vAcc_)::size_type |
using nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::Size = typename decltype(vAcc_)::size_type |
|
inline |
|
inline |
|
inline |
Helper accessor to the dataset points:
|
inline |
Create a tree node that subdivides the list of vecs from vind[first] to vind[last]. The routine is called recursively on each sublist.
left | index of the first vector |
right | index of the last vector |
|
inline |
Create a tree node that subdivides the list of vecs from vind[first] to vind[last] concurrently. The routine is called recursively on each sublist.
left | index of the first vector |
right | index of the last vector |
thread_count | count of std::async threads |
mutex | mutex for mempool allocation |
|
inline |
Frees the previously-built index. Automatically called within buildIndex().
|
inlinestatic |
|
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
|
inline |
|
inline |
Subdivide the list of points by a plane perpendicular on the axis corresponding to the 'cutfeat' dimension at 'cutval' position.
On return: dataset[ind[0..lim1-1]][cutfeat]<cutval dataset[ind[lim1..lim2-1]][cutfeat]==cutval dataset[ind[lim2..count]][cutfeat]>cutval
|
inlinestatic |
|
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
|
inline |
Returns number of points in dataset
|
inline |
Computes the inde memory usage Returns: memory used by the index
|
inline |
Returns the length of each point in the dataset
Dimension nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::dim_ = 0 |
Dimensionality of each data point.
Size nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::leaf_max_size_ = 0 |
Size nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::n_thread_build_ = 1 |
Number of thread for concurrent tree build.
PooledAllocator nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::pool_ |
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.
BoundingBox nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::root_bbox_ |
The KD-tree used to find neighbours
NodePtr nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::root_node_ = nullptr |
Size nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::size_ = 0 |
Number of current points in the dataset.
Size nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::size_at_index_build_ = 0 |
Number of points in the dataset when the index was built.
std::vector<IndexType> nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::vAcc_ |
Array of indices to vectors in the dataset_.