|
STK++ 1.0
|
00001 00002 // * ProjectedVariance.cpp 00003 // * 00004 // * Created on: 26 juil. 2011 00005 // * Author: aude 00006 // */ 00007 // 00008 //#include "../include/STK_ProjectedVariance.h" 00009 // 00010 //#include "../../Algebra/include/STK_Svd.h" 00011 //#include "../../Algebra/include/STK_LinAlgebra1D.h" 00012 //#include "../../Algebra/include/STK_LinAlgebra2D.h" 00013 // 00014 //#include "../../STKernel/include/STK_Misc.h" 00015 //#include "../../STKernel/include/STK_ITContainer1D.h" 00016 // 00017 //#include <cmath> 00018 // 00019 //#include <iostream> 00020 //#include <vector> 00021 // 00022 // 00023 // 00024 // 00025 //namespace STK 00026 //{ 00028 // * Constructor. 00029 // * @param data the input data set 00030 // */ 00031 //ProjectedVariance::ProjectedVariance(Matrix const* p_data) 00032 // : ILinearReduct(p_data) 00033 //{ 00034 // 00035 //} 00036 // 00038 // * Destructor 00039 // */ 00040 //ProjectedVariance::~ProjectedVariance() 00041 //{} 00042 // 00043 // 00044 //void ProjectedVariance::run( Integer const& dim) 00045 //{ 00046 // dim_ = dim; 00047 // 00048 // svdData(); 00049 // 00050 // computeAxis(); 00051 // 00052 // maximizeIndex(); 00053 // 00054 // dataReduced(); 00055 //} 00056 // 00057 // 00058 //void ProjectedVariance::run( Vector const* weights, Integer const& dim) 00059 //{ 00060 // dim_ = dim; 00061 // 00062 // p_weights_ = weights; 00063 // 00064 // svdWData(); 00065 // 00066 // computeAxis(); 00067 // 00068 // wmaximizeIndex(); 00069 // 00070 // dataReduced(); 00071 //} 00072 // 00073 // 00074 //void ProjectedVariance::svdData() 00075 //{ 00076 // svdData_ = Svd(*p_data_); 00077 //} 00078 // 00079 //void ProjectedVariance::svdWData() 00080 //{ 00081 // svdData_ = Svd(*p_data_); 00082 // Matrix const* p_w_data; 00083 // for(int i=0;i<svdData_.nrowU_;i++) 00084 // { 00085 // for(int j=0;j<svdData_.ncolU_;j++) 00086 // { 00087 // (*p_w_data)(i,j) = (*p_data_)(i,j) * sqrt((*p_weights_)[i]); 00088 // } 00089 // } 00090 // svdData_ = Svd(*p_w_data); 00091 //} 00092 // 00093 // 00094 //void ProjectedVariance::computeAxis() 00095 //{ 00096 // for(int i=0;i<svdData_.ncolV_;i++) 00097 // { 00098 // for(int j=0;j<dim_;j++) 00099 // { 00100 // axis_(i,j) = svdData_.V_(i,j); 00101 // } 00102 // } 00103 //} 00104 // 00105 // 00106 // 00107 //void ProjectedVariance::dataReduced() 00108 //{ 00109 // /** We determine the dim_ first vectors of the final matrix of data (after the dimension reduction) **/ 00110 // for(int i=0;i<dim_;i++) 00111 // { 00112 // /** We look down each row of the matrix p_data_ **/ 00113 // //for(int j=0;j<p_data_->sizeHo();j++) 00114 // for(int j=0;j<svdData_.nrowU_;j++) 00115 // { 00116 // (*p_reduced_)(j,i) = 0; 00117 // /** We look down each column of the matrix p_data and in parallel each column of the matrix V **/ 00118 // //for(int k=0;k<p_data_->sizeVe();k++) 00119 // for(int k=0;k<svdData_.ncolU_;k++) 00120 // { 00121 // (*p_reduced_)(j,i) = (*p_reduced_)(j,i) + (*p_data_)(j,k) * axis_(i,k); 00122 // } 00123 // } 00124 // } 00125 //} 00126 // 00127 // 00128 // 00129 // 00130 //void ProjectedVariance::maximizeIndex() 00131 //{ 00132 // for(int i=0;i<dim_;i++) 00133 // { 00134 // index_values_[i] = svdData_.D_(i,i) * svdData_.D_(i,i); 00135 // } 00136 //} 00137 // 00138 // 00139 // 00140 //void ProjectedVariance::wmaximizeIndex() 00141 //{ 00142 // for(int i=0;i<dim_;i++) 00143 // { 00144 // index_values_[i] = svdData_.D_(i,i) * svdData_.D_(i,i); 00145 // } 00146 //} 00147 // 00148 // 00149 //} // namespace STK