14#ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS
15 #include <lagrange/legacy/compute_pointcloud_pca.h>
18#include <lagrange/utils/span.h>
36template <
typename Scalar>
73template <
typename Scalar>
::nonstd::span< T, Extent > span
A bounds-safe view for sequences of objects.
Definition span.h:27
Main namespace for Lagrange.
PointcloudPCAOutput< Scalar > compute_pointcloud_pca(span< const Scalar > points, ComputePointcloudPCAOptions options={})
Finds the principal components for a pointcloud.
Definition compute_pointcloud_pca.cpp:23
Definition compute_pointcloud_pca.h:23
bool shift_centroid
when true : covariance = (P - centroid) ^ T(P - centroid) when false : covariance = (P) ^ T(P)
Definition compute_pointcloud_pca.h:28
bool normalize
should we divide the result by number of points?
Definition compute_pointcloud_pca.h:33
Definition compute_pointcloud_pca.h:38
std::array< Scalar, 3 > center
The point around which the covariance matrix is evaluated.
Definition compute_pointcloud_pca.h:40
std::array< std::array< Scalar, 3 >, 3 > eigenvectors
The 3 components, sorted by weight magnitudes.
Definition compute_pointcloud_pca.h:43
std::array< Scalar, 3 > eigenvalues
Each entry is a weight for the corresponding principal component.
Definition compute_pointcloud_pca.h:46