47template <
typename T,
size_t N>
54 throw std::runtime_error(
"Angle distribution requires dimension >= 2");
68 for (
size_t i = 0;
i <
points.size(); ++
i)
82 std::array<T, N>
v1,
v2;
83 for (
size_t d = 0;
d <
N; ++
d)
91 for (
size_t d = 0;
d <
N; ++
d)
150template <
typename T,
size_t N>
160 T min_dist = std::numeric_limits<T>::max();
162 for (
size_t d = 0;
d <
N; ++
d)
216template <
typename T,
size_t N>
229 for (
size_t i = 0;
i <
points.size(); ++
i)
239 std::array<T, N>
query;
240 for (
size_t d = 0;
d <
N; ++
d)
243 index.findNeighbors(
result_set,
query.data(), nanoflann::SearchParameters());
293template <
typename T,
size_t N>
303 for (
size_t i = 0;
i <
points.size(); ++
i)
308 for (
size_t d = 0;
d <
N; ++
d)
358template <
typename T,
size_t N>
370 for (
size_t i = 0;
i <
points.size(); ++
i)
380 std::array<T, N>
query;
381 for (
size_t d = 0;
d <
N; ++
d)
384 index.findNeighbors(
result_set,
query.data(), nanoflann::SearchParameters());
433template <
typename T,
size_t N>
477 {
return std::pow(
M_PI,
N / 2.0) / std::tgamma(
N / 2.0 + 1.0) * std::pow(
radius,
N); };
Definition dbscan_clustering.hpp:11
std::vector< Point< T, N > > random(size_t count, const std::array< std::pair< T, T >, N > &axis_ranges, std::optional< unsigned int > seed=std::nullopt)
Generates a specified number of uniformly distributed random points in N-dimensional space.
Definition random.hpp:66
T length_squared(const Point< T, N > &a)
Definition point.hpp:206
std::pair< std::vector< T >, std::vector< T > > radial_distribution(const std::vector< Point< T, N > > &points, const std::array< std::pair< T, T >, N > &axis_ranges, T bin_width, T max_distance)
Compute the normalized radial distribution function g(r).
Definition metrics.hpp:434
std::vector< T > first_neighbor_distance_squared(std::vector< Point< T, N > > &points)
Computes the squared distance to the nearest neighbor for each point.
Definition metrics.hpp:217
std::vector< T > distance_to_boundary(const std::vector< Point< T, N > > &points, const std::array< std::pair< T, T >, N > &axis_ranges)
Compute the distance of each point to the domain boundary.
Definition metrics.hpp:151
T distance(const Point< T, N > &a, const Point< T, N > &b)
Definition point.hpp:231
std::vector< std::vector< size_t > > nearest_neighbors_indices(const std::vector< Point< T, N > > &points, size_t k_neighbors=8)
Finds the nearest neighbors for each point in a set.
Definition metrics.hpp:359
nanoflann::KDTreeSingleIndexAdaptor< nanoflann::L2_Simple_Adaptor< T, PointCloudAdaptor< T, N > >, PointCloudAdaptor< T, N >, N > KDTree
Definition nanoflann_adaptator.hpp:35
std::vector< T > local_density_knn(const std::vector< Point< T, N > > &points, size_t k=8)
Compute local point density based on k-nearest neighbors in N dimensions.
Definition metrics.hpp:294
T dot(const Point< T, N > &a, const Point< T, N > &b)
Definition point.hpp:198
std::pair< std::vector< T >, std::vector< T > > angle_distribution_neighbors(const std::vector< Point< T, N > > &points, T bin_width, size_t k_neighbors=8)
Compute the angular distribution function (ADF) using nearest neighbors.
Definition metrics.hpp:48
Definition nanoflann_adaptator.hpp:13
A fixed-size N-dimensional point/vector class.
Definition point.hpp:39