PointSampler library (C++)
Loading...
Searching...
No Matches
utils.hpp File Reference

Go to the source code of this file.

Namespaces

namespace  ps
 

Functions

template<typename T , size_t N>
bool ps::save_points_to_csv (const std::string &filename, const std::vector< Point< T, N > > &points, bool write_header=true)
 Save a set of N-dimensional points to a CSV file.
 
template<typename T >
bool ps::save_vector_to_csv (const std::string &filename, const std::vector< T > &values, bool write_header=true, const std::string &header_name="value")
 Save a 1D vector of values to a CSV file.
 
template<typename T , size_t N>
std::vector< Point< T, N+1 > > ps::add_dimension (const std::vector< Point< T, N > > &points, const std::vector< T > &new_dimension)
 Add a new dimension to a set of points.
 
template<typename T , size_t N>
std::vector< std::vector< Point< T, N > > > ps::extract_clusters (const std::vector< Point< T, N > > &points, const std::vector< int > &labels)
 Extract clusters of points given DBSCAN (or any clustering) labels.
 
template<typename T , size_t N>
std::vector< Point< T, N > > ps::merge_by_dimension (const std::array< std::vector< T >, N > &components)
 Reconstructs a list of N-dimensional points from N separate coordinate vectors.
 
template<typename T , size_t N>
void ps::normalize_points (std::vector< Point< T, N > > &points)
 Normalize the coordinates of a set of points along each axis to the range [0, 1].
 
template<typename T , size_t N>
std::array< std::vector< T >, Nps::split_by_dimension (const std::vector< Point< T, N > > &points)
 Rearranges a list of N-dimensional points into N separate coordinate vectors.