00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MARSYAS_PCA_H
00020 #define MARSYAS_PCA_H
00021
00022 #include "MarSystem.h"
00023
00024 #include <string>
00025
00026 namespace Marsyas
00027 {
00043 class PCA: public MarSystem
00044 {
00045 private:
00046 void addControls();
00047 void myUpdate(MarControlPtr sender);
00048
00049 realvec in_data_;
00050 realvec corr_matrix_;
00051 realvec temp_matrix_;
00052 mrs_real* evals_;
00053 mrs_real* interm_;
00054 mrs_natural dims_;
00055 mrs_natural npc_;
00056 realvec npcs_;
00057
00058 realvec means_;
00059 realvec stds_;
00060
00061 public:
00062 PCA(std::string name);
00063 PCA(const PCA& a);
00064 ~PCA();
00065 MarSystem* clone() const;
00066
00067 void myProcess(realvec& in, realvec& out);
00068 void tred2(realvec &a, mrs_natural m, mrs_real *d, mrs_real *e);
00069 void tqli(mrs_real d[], mrs_real e[], mrs_natural m, realvec &z);
00070
00071 };
00072
00073 }
00074
00075 #endif