template<class ArrayT>
Definition at line 18 of file MatSvdLapack.h. Referenced by MatPseudoInverse(). 00019 { 00020 char job = 'A'; // this specifies that all rows/columns should be computed 00021 int rows = a->H(); 00022 int cols = a->W(); 00023 double* aData; 00024 double* uData; 00025 double* sData; 00026 double* vData; // mind the transpose! 00027 int lwork = 1; 00028 double* workData; 00029 int info; 00030 int bla = dgesvd_(&job, &job, &rows, &cols, aData, 00031 &rows, sData, uData, &rows, vData, 00032 &cols, workData, &lwork, &info); 00033 00034 //error checking... 00035 if(info < 0) 00036 { 00037 std::cerr << "[MatSvd] illegal value@" << info << ": " << aData[-info-1] << std::endl; 00038 return; 00039 } 00040 if(info < 0) 00041 { 00042 std::cerr << "[MatSvd] did not converge" << std::endl; 00043 return; 00044 } 00045 00046 u = new ArrayT(uData); 00047 s = new ArrayT(sData); 00048 v = new ArrayT(vData); // mind the transpose! 00049 }
|