33 #ifndef EIGEN_SAEIGENSOLVER_LAPACKE_H
34 #define EIGEN_SAEIGENSOLVER_LAPACKE_H
40 #define EIGEN_LAPACKE_EIG_SELFADJ(EIGTYPE, LAPACKE_TYPE, LAPACKE_RTYPE, LAPACKE_NAME, EIGCOLROW, LAPACKE_COLROW ) \
41 template<> template<typename InputType> inline \
42 SelfAdjointEigenSolver<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >& \
43 SelfAdjointEigenSolver<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >::compute(const EigenBase<InputType>& matrix, int options) \
45 eigen_assert(matrix.cols() == matrix.rows()); \
46 eigen_assert((options&~(EigVecMask|GenEigMask))==0 \
47 && (options&EigVecMask)!=EigVecMask \
48 && "invalid option parameter"); \
49 bool computeEigenvectors = (options&ComputeEigenvectors)==ComputeEigenvectors; \
50 lapack_int n = internal::convert_index<lapack_int>(matrix.cols()), lda, matrix_order, info; \
51 m_eivalues.resize(n,1); \
52 m_subdiag.resize(n-1); \
57 m_eivalues.coeffRef(0,0) = numext::real(m_eivec.coeff(0,0)); \
58 if(computeEigenvectors) m_eivec.setOnes(n,n); \
60 m_isInitialized = true; \
61 m_eigenvectorsOk = computeEigenvectors; \
65 lda = internal::convert_index<lapack_int>(m_eivec.outerStride()); \
66 matrix_order=LAPACKE_COLROW; \
67 char jobz, uplo='L'; \
68 jobz = computeEigenvectors ? 'V' : 'N'; \
70 info = LAPACKE_##LAPACKE_NAME( matrix_order, jobz, uplo, n, (LAPACKE_TYPE*)m_eivec.data(), lda, (LAPACKE_RTYPE*)m_eivalues.data() ); \
71 m_info = (info==0) ? Success : NoConvergence; \
72 m_isInitialized = true; \
73 m_eigenvectorsOk = computeEigenvectors; \
78 EIGEN_LAPACKE_EIG_SELFADJ(
double,
double,
double, dsyev,
ColMajor, LAPACK_COL_MAJOR)
79 EIGEN_LAPACKE_EIG_SELFADJ(
float,
float,
float, ssyev,
ColMajor, LAPACK_COL_MAJOR)
80 EIGEN_LAPACKE_EIG_SELFADJ(dcomplex, lapack_complex_double,
double, zheev, ColMajor, LAPACK_COL_MAJOR)
81 EIGEN_LAPACKE_EIG_SELFADJ(scomplex, lapack_complex_float,
float, cheev, ColMajor, LAPACK_COL_MAJOR)
83 EIGEN_LAPACKE_EIG_SELFADJ(
double,
double,
double, dsyev,
RowMajor, LAPACK_ROW_MAJOR)
84 EIGEN_LAPACKE_EIG_SELFADJ(
float,
float,
float, ssyev, RowMajor, LAPACK_ROW_MAJOR)
85 EIGEN_LAPACKE_EIG_SELFADJ(dcomplex, lapack_complex_double,
double, zheev, RowMajor, LAPACK_ROW_MAJOR)
86 EIGEN_LAPACKE_EIG_SELFADJ(scomplex, lapack_complex_float,
float, cheev, RowMajor, LAPACK_ROW_MAJOR)
90 #endif // EIGEN_SAEIGENSOLVER_H
Definition: Constants.h:320
Definition: Constants.h:322