26 #include "WPrincipalComponentAnalysis.h"
56 for(
int index = 0; index < count; index++ )
59 if( lambda.imag() != 0.0 )
65 size_t vectorSize =
static_cast<size_t>( vector.size() );
66 for(
size_t dimension = 0; dimension < vectorSize && dimension < newPosition.
size(); dimension++ )
68 complex<double> value = vector[dimension];
69 newPosition[dimension] = value.real();
85 for(
size_t dimension = 0; dimension <
m_eigenValues.size(); dimension++ )
WPosition getMean()
Returns the mean coordinate of the input point data set.
MatrixXd getCovariance()
Returns the covariance matrix corresponding to the input point data set.
void analyzeData(const vector< WPosition > &dataSet)
Analyzes the dimension covariances of a point data set.
size_t size() const
The number of entries.
This only is a 3d double vector.
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.