00001 #ifndef _theplu_yat_utility_pca_ 00002 #define _theplu_yat_utility_pca_ 00003 00004 // $Id: PCA.h 2378 2010-12-21 00:30:48Z peter $ 00005 00006 /* 00007 Copyright (C) 2003 Daniel Dalevi 00008 Copyright (C) 2004 Jari Häkkinen 00009 Copyright (C) 2005 Jari Häkkinen, Peter Johansson 00010 Copyright (C) 2006 Jari Häkkinen 00011 Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson 00012 Copyright (C) 2010 Peter Johansson 00013 00014 This file is part of the yat library, http://dev.thep.lu.se/yat 00015 00016 The yat library is free software; you can redistribute it and/or 00017 modify it under the terms of the GNU General Public License as 00018 published by the Free Software Foundation; either version 3 of the 00019 License, or (at your option) any later version. 00020 00021 The yat library is distributed in the hope that it will be useful, 00022 but WITHOUT ANY WARRANTY; without even the implied warranty of 00023 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00024 General Public License for more details. 00025 00026 You should have received a copy of the GNU General Public License 00027 along with yat. If not, see <http://www.gnu.org/licenses/>. 00028 */ 00029 00030 #include "Matrix.h" 00031 #include "Vector.h" 00032 00033 namespace theplu { 00034 namespace yat { 00035 namespace utility { 00036 00051 class PCA 00052 { 00053 public: 00058 explicit PCA(const utility::Matrix&); 00059 00067 // void process_transposed_problem(void); 00068 00075 const utility::Vector& eigenvalues(void) const; 00076 00083 const utility::Matrix& eigenvectors(void) const; 00084 00092 utility::Matrix projection( const utility::Matrix& ) const; 00093 00098 // utility::matrix projection_transposed( const utility::matrix& ) const; 00099 00100 00101 private: 00102 00110 void process(void); 00111 00117 void row_center( utility::Matrix& A_center ); 00118 00119 utility::Matrix A_; 00120 utility::Vector eigenvalues_; 00121 utility::Matrix eigenvectors_; 00122 utility::Vector meanvalues_; 00123 }; 00124 00125 }}} // of namespace utility, yat, and theplu 00126 00127 #endif