yat  0.8.3pre
PCA.h
00001 #ifndef _theplu_yat_utility_pca_ 
00002 #define _theplu_yat_utility_pca_ 
00003 
00004 // $Id: PCA.h 2382 2010-12-21 13:16:58Z 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 Matrix&);
00059  
00066     const Vector& eigenvalues(void) const;
00067 
00074     const Matrix& eigenvectors(void) const;
00075 
00083     Matrix projection(const Matrix&) const;
00084 
00085   private:
00086 
00094     void process(void);
00095 
00101     void row_center(Matrix& A_center);
00102 
00103     utility::Matrix A_; 
00104     utility::Vector eigenvalues_;
00105     utility::Matrix eigenvectors_;
00106     utility::Vector meanvalues_;
00107   };
00108 
00109 }}} // of namespace utility, yat, and theplu
00110 
00111 #endif

Generated on Thu Dec 20 2012 03:12:58 for yat by  doxygen 1.8.0-20120409