1#ifndef POINT_CLOUD_HIERARCHY_H
2#define POINT_CLOUD_HIERARCHY_H
4#include <deal.II/base/point.h>
9#include <unordered_map>
14using namespace dealii;
40 template <
int spacedim>
42 const std::vector<Point<spacedim>>& input_points,
43 const std::vector<double>& input_density,
44 const std::string& output_dir);
83 const std::vector<std::vector<size_t>>&
getChildIndices(
int level)
const;
114 template <
int spacedim>
115 std::tuple<std::vector<std::array<double, spacedim>>, std::vector<double>, std::vector<int>>
117 const std::vector<std::array<double, spacedim>>& points,
118 const std::vector<double>& densities,
Class to manage a hierarchy of point clouds with different resolutions The hierarchy is organized wit...
std::vector< std::vector< std::vector< size_t > > > parent_indices_
int getPointCount(int level) const
Get the number of points at a specific level.
const std::vector< std::vector< size_t > > & getParentIndices(int level) const
Get the parent indices for points at level L-1.
int getNumLevels() const
Get the number of levels in the last generated hierarchy.
void setMaxPoints(int max_points)
Set the maximum number of points for level 1.
std::tuple< std::vector< std::array< double, spacedim > >, std::vector< double >, std::vector< int > > kmeansClustering(const std::vector< std::array< double, spacedim > > &points, const std::vector< double > &densities, size_t k)
Performs parallel k-means clustering on a set of points with parent-child tracking.
int getPointsForLevel(int base_points, int level) const
Calculate number of points for a given level.
int generateHierarchy(const std::vector< Point< spacedim > > &input_points, const std::vector< double > &input_density, const std::string &output_dir)
Generate hierarchy of point clouds from input points.
std::vector< int > level_point_counts_
const std::vector< std::vector< size_t > > & getChildIndices(int level) const
Get the child indices for points at level L.
void ensureDirectoryExists(const std::string &path) const
Ensure directory exists, create if it doesn't.
void setMinPoints(int min_points)
Set the minimum number of points for coarsest level.
std::vector< std::vector< std::vector< size_t > > > child_indices_