00001 #ifndef _theplu_yat_utility_pca_ 00002 #define _theplu_yat_utility_pca_ 00003 00004 // $Id: PCA.h 1797 2009-02-12 18:07:10Z 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 00013 This file is part of the yat library, http://dev.thep.lu.se/yat 00014 00015 The yat library is free software; you can redistribute it and/or 00016 modify it under the terms of the GNU General Public License as 00017 published by the Free Software Foundation; either version 3 of the 00018 License, or (at your option) any later version. 00019 00020 The yat library is distributed in the hope that it will be useful, 00021 but WITHOUT ANY WARRANTY; without even the implied warranty of 00022 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00023 General Public License for more details. 00024 00025 You should have received a copy of the GNU General Public License 00026 along with yat. If not, see <http://www.gnu.org/licenses/>. 00027 */ 00028 00029 #include "Matrix.h" 00030 #include "Vector.h" 00031 00032 namespace theplu { 00033 namespace yat { 00034 namespace utility { 00035 00049 class PCA 00050 { 00051 public: 00056 explicit PCA(const utility::Matrix&); 00057 00065 // void process_transposed_problem(void); 00066 00073 const utility::Vector& eigenvalues(void) const; 00074 00081 const utility::Matrix& eigenvectors(void) const; 00082 00090 utility::Matrix projection( const utility::Matrix& ) const; 00091 00096 // utility::matrix projection_transposed( const utility::matrix& ) const; 00097 00098 00099 private: 00100 00109 void process(void); 00110 00116 void row_center( utility::Matrix& A_center ); 00117 00118 utility::Matrix A_; 00119 utility::Vector eigenvalues_; 00120 utility::Matrix eigenvectors_; 00121 utility::Vector meanvalues_; 00122 }; 00123 00124 }}} // of namespace utility, yat, and theplu 00125 00126 #endif