33 #ifndef EIGEN_JACOBISVD_LAPACKE_H 34 #define EIGEN_JACOBISVD_LAPACKE_H 40 #define EIGEN_LAPACKE_SVD(EIGTYPE, LAPACKE_TYPE, LAPACKE_RTYPE, LAPACKE_PREFIX, EIGCOLROW, LAPACKE_COLROW) \ 42 JacobiSVD<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic>, ColPivHouseholderQRPreconditioner>& \ 43 JacobiSVD<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic>, ColPivHouseholderQRPreconditioner>::compute(const Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic>& matrix, unsigned int computationOptions) \ 45 typedef Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic> MatrixType; \ 48 allocate(matrix.rows(), matrix.cols(), computationOptions); \ 51 m_nonzeroSingularValues = m_diagSize; \ 53 lapack_int lda = internal::convert_index<lapack_int>(matrix.outerStride()), ldu, ldvt; \ 54 lapack_int matrix_order = LAPACKE_COLROW; \ 56 LAPACKE_TYPE *u, *vt, dummy; \ 57 jobu = (m_computeFullU) ? 'A' : (m_computeThinU) ? 'S' : 'N'; \ 58 jobvt = (m_computeFullV) ? 'A' : (m_computeThinV) ? 'S' : 'N'; \ 60 ldu = internal::convert_index<lapack_int>(m_matrixU.outerStride()); \ 61 u = (LAPACKE_TYPE*)m_matrixU.data(); \ 62 } else { ldu=1; u=&dummy; }\ 64 ldvt = (m_computeFullV) ? internal::convert_index<lapack_int>(m_cols) : (m_computeThinV) ? internal::convert_index<lapack_int>(m_diagSize) : 1; \ 66 localV.resize(ldvt, m_cols); \ 67 vt = (LAPACKE_TYPE*)localV.data(); \ 68 } else { ldvt=1; vt=&dummy; }\ 69 Matrix<LAPACKE_RTYPE, Dynamic, Dynamic> superb; superb.resize(m_diagSize, 1); \ 70 MatrixType m_temp; m_temp = matrix; \ 71 LAPACKE_##LAPACKE_PREFIX##gesvd( matrix_order, jobu, jobvt, internal::convert_index<lapack_int>(m_rows), internal::convert_index<lapack_int>(m_cols), (LAPACKE_TYPE*)m_temp.data(), lda, (LAPACKE_RTYPE*)m_singularValues.data(), u, ldu, vt, ldvt, superb.data()); \ 72 if (computeV()) m_matrixV = localV.adjoint(); \ 74 m_isInitialized = true; \ 90 #endif // EIGEN_JACOBISVD_LAPACKE_H #define lapack_complex_float
std::complex< float > scomplex
std::complex< double > dcomplex
#define EIGEN_LAPACKE_SVD(EIGTYPE, LAPACKE_TYPE, LAPACKE_RTYPE, LAPACKE_PREFIX, EIGCOLROW, LAPACKE_COLROW)
#define lapack_complex_double