25 #ifndef WPRINCIPALCOMPONENTANALYSIS_H
26 #define WPRINCIPALCOMPONENTANALYSIS_H
29 #include <Eigen/Dense>
30 #include "WCovarianceSolver.h"
31 #include "core/common/math/linearAlgebra/WVectorFixed.h"
32 #include "core/common/math/linearAlgebra/WPosition.h"
38 using Eigen::EigenSolver;
39 using Eigen::MatrixXcd;
40 using Eigen::VectorXcd;
69 void analyzeData(
const vector<WPosition>& inputData );
104 void swapEigenVectors(
size_t eigenVectorIndex1,
size_t eigenVectorIndex2 );
Calculates covariances of a point data set.
This only is a 3d double vector.
This is a class that analyzes the point distribution of point couds using the Principal Component Ana...
void extractEigenData()
Does the actual Eigen Value and Vector Analysis.
size_t m_dimensions
Dimension count used in the input data.
void sortByVarianceDescending()
Sorts the Point distribution direction by the descending strength.
vector< double > getEigenValues()
Returns Eigen Values (equals how much the directions of getDirections() are distributed).
vector< WVector3d > m_eigenVectors
Main point distribution directions.
virtual ~WPrincipalComponentAnalysis()
Destroys the Principal Component Analysis instance.
WPosition getMean()
Returns the mean coordinate of all input points.
vector< double > m_eigenValues
Lambda values for A*x-Lambda*x=0.
void swapEigenVectors(size_t eigenVectorIndex1, size_t eigenVectorIndex2)
Replaces two Eigen Vectors and its Variances by each other.
bool m_isValidPCA
Indicator whether calculation is still valid.
WCovarianceSolver m_covarianceSolver
Instance to analyze the covariances of the point data between each dimension pair.
size_t m_inputPointCount
Point count of the input data.
vector< WVector3d > getEigenVectors()
Returns the point distribution directions.
WPrincipalComponentAnalysis()
Creates the Principal Component Analysis instance.
EigenSolver< MatrixXd > m_eigenSolver
Instance for solving Eigen Values and Vectors.
void analyzeData(const vector< WPosition > &inputData)
Analyzes a point data set using the Principal Component Analysis algorithm.