Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

template<class ArrayT>
void Impala::Core::Matrix::MatSvd ( ArrayT *  a,
ArrayT *&  u,
ArrayT *&  s,
ArrayT *&  v 
) [inline]

Definition at line 18 of file MatSvdLapack.h.

References info().

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 }

Here is the call graph for this function:


Generated on Fri Mar 19 11:16:15 2010 for ImpalaSrc by  doxygen 1.5.1