33#ifndef EIGEN_SAEIGENSOLVER_LAPACKE_H
34#define EIGEN_SAEIGENSOLVER_LAPACKE_H
40#define EIGEN_LAPACKE_EIG_SELFADJ_2(EIGTYPE, LAPACKE_TYPE, LAPACKE_RTYPE, LAPACKE_NAME, EIGCOLROW ) \
41template<> template<typename InputType> inline \
42SelfAdjointEigenSolver<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >& \
43SelfAdjointEigenSolver<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, 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 char jobz, uplo='L'
; \
67 jobz = computeEigenvectors ? 'V' : 'N'; \
69 info = LAPACKE_##LAPACKE_NAME( LAPACK_COL_MAJOR, jobz, uplo, n, (LAPACKE_TYPE*)m_eivec.data(), lda, (LAPACKE_RTYPE*)m_eivalues.data() ); \
70 m_info = (info==0) ? Success : NoConvergence; \
71 m_isInitialized = true; \
72 m_eigenvectorsOk = computeEigenvectors; \
76#define EIGEN_LAPACKE_EIG_SELFADJ(EIGTYPE, LAPACKE_TYPE, LAPACKE_RTYPE, LAPACKE_NAME ) \
77 EIGEN_LAPACKE_EIG_SELFADJ_2(EIGTYPE, LAPACKE_TYPE, LAPACKE_RTYPE, LAPACKE_NAME, ColMajor ) \
78 EIGEN_LAPACKE_EIG_SELFADJ_2(EIGTYPE, LAPACKE_TYPE, LAPACKE_RTYPE, LAPACKE_NAME, RowMajor )
80EIGEN_LAPACKE_EIG_SELFADJ(
double,
double,
double, dsyev)
81EIGEN_LAPACKE_EIG_SELFADJ(
float,
float,
float, ssyev)
82EIGEN_LAPACKE_EIG_SELFADJ(dcomplex, lapack_complex_double,
double, zheev)
83EIGEN_LAPACKE_EIG_SELFADJ(scomplex, lapack_complex_float,
float, cheev)
Namespace containing all symbols from the Eigen library.
Definition: Core:141