33 #ifndef EIGEN_SAEIGENSOLVER_MKL_H
34 #define EIGEN_SAEIGENSOLVER_MKL_H
36 #include "Eigen/src/Core/util/MKL_support.h"
42 #define EIGEN_MKL_EIG_SELFADJ(EIGTYPE, MKLTYPE, MKLRTYPE, MKLNAME, EIGCOLROW, MKLCOLROW ) \
44 SelfAdjointEigenSolver<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >& \
45 SelfAdjointEigenSolver<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >::compute(const Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW>& 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 = matrix.cols(), lda, matrix_order, info; \
53 m_eivalues.resize(n,1); \
54 m_subdiag.resize(n-1); \
59 m_eivalues.coeffRef(0,0) = numext::real(matrix.coeff(0,0)); \
60 if(computeEigenvectors) m_eivec.setOnes(n,n); \
62 m_isInitialized = true; \
63 m_eigenvectorsOk = computeEigenvectors; \
67 lda = matrix.outerStride(); \
68 matrix_order=MKLCOLROW; \
69 char jobz, uplo='L'; \
70 jobz = computeEigenvectors ? 'V' : 'N'; \
72 info = LAPACKE_##MKLNAME( matrix_order, jobz, uplo, n, (MKLTYPE*)m_eivec.data(), lda, (MKLRTYPE*)m_eivalues.data() ); \
73 m_info = (info==0) ? Success : NoConvergence; \
74 m_isInitialized = true; \
75 m_eigenvectorsOk = computeEigenvectors; \
80 EIGEN_MKL_EIG_SELFADJ(
double,
double,
double, dsyev,
ColMajor, LAPACK_COL_MAJOR)
81 EIGEN_MKL_EIG_SELFADJ(
float,
float,
float, ssyev,
ColMajor, LAPACK_COL_MAJOR)
82 EIGEN_MKL_EIG_SELFADJ(dcomplex, MKL_Complex16,
double, zheev, ColMajor, LAPACK_COL_MAJOR)
83 EIGEN_MKL_EIG_SELFADJ(scomplex, MKL_Complex8,
float, cheev, ColMajor, LAPACK_COL_MAJOR)
85 EIGEN_MKL_EIG_SELFADJ(
double,
double,
double, dsyev,
RowMajor, LAPACK_ROW_MAJOR)
86 EIGEN_MKL_EIG_SELFADJ(
float,
float,
float, ssyev, RowMajor, LAPACK_ROW_MAJOR)
87 EIGEN_MKL_EIG_SELFADJ(dcomplex, MKL_Complex16,
double, zheev, RowMajor, LAPACK_ROW_MAJOR)
88 EIGEN_MKL_EIG_SELFADJ(scomplex, MKL_Complex8,
float, cheev, RowMajor, LAPACK_ROW_MAJOR)
92 #endif // EIGEN_SAEIGENSOLVER_H
Definition: Constants.h:264
Definition: Constants.h:266