33 #ifndef EIGEN_SAEIGENSOLVER_LAPACKE_H
34 #define EIGEN_SAEIGENSOLVER_LAPACKE_H
42 #define EIGEN_LAPACKE_EIG_SELFADJ_2(EIGTYPE, LAPACKE_TYPE, LAPACKE_RTYPE, LAPACKE_NAME, EIGCOLROW ) \
43 template<> template<typename InputType> inline \
44 SelfAdjointEigenSolver<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >& \
45 SelfAdjointEigenSolver<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >::compute(const EigenBase<InputType>& matrix, int options) \
47 eigen_assert(matrix.cols() == matrix.rows()); \
48 eigen_assert((options&~(EigVecMask|GenEigMask))==0 \
49 && (options&EigVecMask)!=EigVecMask \
50 && "invalid option parameter"); \
51 bool computeEigenvectors = (options&ComputeEigenvectors)==ComputeEigenvectors; \
52 lapack_int n = internal::convert_index<lapack_int>(matrix.cols()), lda, info; \
53 m_eivalues.resize(n,1); \
54 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, (LAPACKE_RTYPE*)m_eivalues.data() ); \
72 m_info = (info==0) ? Success : NoConvergence; \
73 m_isInitialized = true; \
74 m_eigenvectorsOk = computeEigenvectors; \
78 #define EIGEN_LAPACKE_EIG_SELFADJ(EIGTYPE, LAPACKE_TYPE, LAPACKE_RTYPE, LAPACKE_NAME ) \
79 EIGEN_LAPACKE_EIG_SELFADJ_2(EIGTYPE, LAPACKE_TYPE, LAPACKE_RTYPE, LAPACKE_NAME, ColMajor ) \
80 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)
#define lapack_complex_double
#define lapack_complex_float
std::complex< double > dcomplex
std::complex< float > scomplex