43#include "../ext/scalar_relational.hpp"
45#ifndef GLM_ENABLE_EXPERIMENTAL
46# error "GLM: GLM_GTX_pca is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
47#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
48# pragma message("GLM: GLM_GTX_pca extension included")
58 template<length_t D,
typename T, qualifier Q>
65 template<length_t D,
typename T, qualifier Q>
70 template<length_t D,
typename T, qualifier Q,
typename I>
75 template<length_t D,
typename T, qualifier Q,
typename I>
86 template<length_t D,
typename T, qualifier Q>
89 mat<D, D, T, Q>
const& covarMat,
90 vec<D, T, Q>& outEigenvalues,
91 mat<D, D, T, Q>& outEigenvectors
96 template<
typename T, qualifier Q>
97 GLM_FUNC_DISCARD_DECL
void sortEigenvalues(vec<2, T, Q>& eigenvalues, mat<2, 2, T, Q>& eigenvectors);
101 template<
typename T, qualifier Q>
102 GLM_FUNC_DISCARD_DECL
void sortEigenvalues(vec<3, T, Q>& eigenvalues, mat<3, 3, T, Q>& eigenvectors);
106 template<
typename T, qualifier Q>
107 GLM_FUNC_DISCARD_DECL
void sortEigenvalues(vec<4, T, Q>& eigenvalues, mat<4, 4, T, Q>& eigenvectors);
GLM_FUNC_DECL GLM_CONSTEXPR genType e()
Return e constant.
GLM_INLINE mat< D, D, T, Q > computeCovarianceMatrix(vec< D, T, Q > const *v, size_t n)
Compute a covariance matrix form an array of relative coordinates v (e.g., relative to the center of ...
GLM_FUNC_DISCARD_DECL void sortEigenvalues(vec< 2, T, Q > &eigenvalues, mat< 2, 2, T, Q > &eigenvectors)
Sorts a group of Eigenvalues&Eigenvectors, for largest Eigenvalue to smallest Eigenvalue.
GLM_FUNC_DECL unsigned int findEigenvaluesSymReal(mat< D, D, T, Q > const &covarMat, vec< D, T, Q > &outEigenvalues, mat< D, D, T, Q > &outEigenvectors)
Assuming the provided covariance matrix covarMat is symmetric and real-valued, this function find the...