Warning, file /include/eigen3/Eigen/src/SVD/JacobiSVD_LAPACKE.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 #ifndef EIGEN_JACOBISVD_LAPACKE_H
0034 #define EIGEN_JACOBISVD_LAPACKE_H
0035
0036 namespace Eigen {
0037
0038
0039
0040 #define EIGEN_LAPACKE_SVD(EIGTYPE, LAPACKE_TYPE, LAPACKE_RTYPE, LAPACKE_PREFIX, EIGCOLROW, LAPACKE_COLROW) \
0041 template<> inline \
0042 JacobiSVD<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic>, ColPivHouseholderQRPreconditioner>& \
0043 JacobiSVD<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic>, ColPivHouseholderQRPreconditioner>::compute(const Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic>& matrix, unsigned int computationOptions) \
0044 { \
0045 typedef Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic> MatrixType; \
0046 \
0047 \
0048 allocate(matrix.rows(), matrix.cols(), computationOptions); \
0049 \
0050 \
0051 m_nonzeroSingularValues = m_diagSize; \
0052 \
0053 lapack_int lda = internal::convert_index<lapack_int>(matrix.outerStride()), ldu, ldvt; \
0054 lapack_int matrix_order = LAPACKE_COLROW; \
0055 char jobu, jobvt; \
0056 LAPACKE_TYPE *u, *vt, dummy; \
0057 jobu = (m_computeFullU) ? 'A' : (m_computeThinU) ? 'S' : 'N'; \
0058 jobvt = (m_computeFullV) ? 'A' : (m_computeThinV) ? 'S' : 'N'; \
0059 if (computeU()) { \
0060 ldu = internal::convert_index<lapack_int>(m_matrixU.outerStride()); \
0061 u = (LAPACKE_TYPE*)m_matrixU.data(); \
0062 } else { ldu=1; u=&dummy; }\
0063 MatrixType localV; \
0064 lapack_int vt_rows = (m_computeFullV) ? internal::convert_index<lapack_int>(m_cols) : (m_computeThinV) ? internal::convert_index<lapack_int>(m_diagSize) : 1; \
0065 if (computeV()) { \
0066 localV.resize(vt_rows, m_cols); \
0067 ldvt = internal::convert_index<lapack_int>(localV.outerStride()); \
0068 vt = (LAPACKE_TYPE*)localV.data(); \
0069 } else { ldvt=1; vt=&dummy; }\
0070 Matrix<LAPACKE_RTYPE, Dynamic, Dynamic> superb; superb.resize(m_diagSize, 1); \
0071 MatrixType m_temp; m_temp = matrix; \
0072 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()); \
0073 if (computeV()) m_matrixV = localV.adjoint(); \
0074 \
0075 m_isInitialized = true; \
0076 return *this; \
0077 }
0078
0079 EIGEN_LAPACKE_SVD(double, double, double, d, ColMajor, LAPACK_COL_MAJOR)
0080 EIGEN_LAPACKE_SVD(float, float, float , s, ColMajor, LAPACK_COL_MAJOR)
0081 EIGEN_LAPACKE_SVD(dcomplex, lapack_complex_double, double, z, ColMajor, LAPACK_COL_MAJOR)
0082 EIGEN_LAPACKE_SVD(scomplex, lapack_complex_float, float , c, ColMajor, LAPACK_COL_MAJOR)
0083
0084 EIGEN_LAPACKE_SVD(double, double, double, d, RowMajor, LAPACK_ROW_MAJOR)
0085 EIGEN_LAPACKE_SVD(float, float, float , s, RowMajor, LAPACK_ROW_MAJOR)
0086 EIGEN_LAPACKE_SVD(dcomplex, lapack_complex_double, double, z, RowMajor, LAPACK_ROW_MAJOR)
0087 EIGEN_LAPACKE_SVD(scomplex, lapack_complex_float, float , c, RowMajor, LAPACK_ROW_MAJOR)
0088
0089 }
0090
0091 #endif