#ifndef PCA_H #define PCA_H #include "Eigen" #include class PCA { public: PCA(const QVector> &source, double thd); void compute(); private: Eigen::MatrixXd X; // 输入矩阵 Eigen::MatrixXd C; // 协方差矩阵 Eigen::MatrixXd reduced_; double variance_remain_; int rows_; int cols_; }; #endif // PCA_H