33 #ifndef EIGEN_SAEIGENSOLVER_LAPACKE_H
34 #define EIGEN_SAEIGENSOLVER_LAPACKE_H
43 #define EIGEN_LAPACKE_EIG_SELFADJ_2(EIGTYPE, LAPACKE_TYPE, LAPACKE_RTYPE, LAPACKE_NAME, EIGCOLROW) \
45 template <typename InputType> \
46 inline SelfAdjointEigenSolver<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >& \
47 SelfAdjointEigenSolver<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >::compute(const EigenBase<InputType>& matrix, \
49 eigen_assert(matrix.cols() == matrix.rows()); \
50 eigen_assert((options & ~(EigVecMask | GenEigMask)) == 0 && (options & EigVecMask) != EigVecMask && \
51 "invalid option parameter"); \
52 bool computeEigenvectors = (options & ComputeEigenvectors) == ComputeEigenvectors; \
53 lapack_int n = internal::convert_index<lapack_int>(matrix.cols()), lda, info; \
54 m_eivalues.resize(n, 1); \
55 m_subdiag.resize(n - 1); \
59 m_eivalues.coeffRef(0, 0) = numext::real(m_eivec.coeff(0, 0)); \
60 if (computeEigenvectors) m_eivec.setOnes(n, n); \
62 m_isInitialized = true; \
63 m_eigenvectorsOk = computeEigenvectors; \
67 lda = internal::convert_index<lapack_int>(m_eivec.outerStride()); \
68 char jobz, uplo = 'L'
; \
69 jobz = computeEigenvectors ? 'V' : 'N'; \
71 info = LAPACKE_##LAPACKE_NAME(LAPACK_COL_MAJOR, jobz, uplo, n, (LAPACKE_TYPE*)m_eivec.data(), lda, \
72 (LAPACKE_RTYPE*)m_eivalues.data()); \
73 m_info = (info == 0) ? Success : NoConvergence; \
74 m_isInitialized = true; \
75 m_eigenvectorsOk = computeEigenvectors; \
79 #define EIGEN_LAPACKE_EIG_SELFADJ(EIGTYPE, LAPACKE_TYPE, LAPACKE_RTYPE, LAPACKE_NAME) \
80 EIGEN_LAPACKE_EIG_SELFADJ_2(EIGTYPE, LAPACKE_TYPE, LAPACKE_RTYPE, LAPACKE_NAME, ColMajor) \
81 EIGEN_LAPACKE_EIG_SELFADJ_2(EIGTYPE, LAPACKE_TYPE, LAPACKE_RTYPE, LAPACKE_NAME, RowMajor)
#define EIGEN_LAPACKE_EIG_SELFADJ(EIGTYPE, LAPACKE_TYPE, LAPACKE_RTYPE, LAPACKE_NAME)
Definition: SelfAdjointEigenSolver_LAPACKE.h:79
#define lapack_complex_double
Definition: lapacke.h:94
#define lapack_complex_float
Definition: lapacke.h:79
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
std::complex< double > dcomplex
Definition: MKL_support.h:128
std::complex< float > scomplex
Definition: MKL_support.h:129