mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix compilation of MKL support.
This commit is contained in:
8
Eigen/src/Eigenvalues/ComplexSchur_MKL.h
Normal file → Executable file
8
Eigen/src/Eigenvalues/ComplexSchur_MKL.h
Normal file → Executable file
@@ -40,9 +40,9 @@ namespace Eigen {
|
||||
/** \internal Specialization for the data types supported by MKL */
|
||||
|
||||
#define EIGEN_MKL_SCHUR_COMPLEX(EIGTYPE, MKLTYPE, MKLPREFIX, MKLPREFIX_U, EIGCOLROW, MKLCOLROW) \
|
||||
template<> inline \
|
||||
template<> template<typename InputType> inline \
|
||||
ComplexSchur<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >& \
|
||||
ComplexSchur<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >::compute(const Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW>& matrix, bool computeU) \
|
||||
ComplexSchur<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >::compute(const EigenBase<InputType>& matrix, bool computeU) \
|
||||
{ \
|
||||
typedef Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> MatrixType; \
|
||||
typedef MatrixType::RealScalar RealScalar; \
|
||||
@@ -53,7 +53,7 @@ ComplexSchur<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >::compute(const Matri
|
||||
m_matUisUptodate = false; \
|
||||
if(matrix.cols() == 1) \
|
||||
{ \
|
||||
m_matT = matrix.cast<ComplexScalar>(); \
|
||||
m_matT = matrix.template cast<ComplexScalar>(); \
|
||||
if(computeU) m_matU = ComplexMatrixType::Identity(1,1); \
|
||||
m_info = Success; \
|
||||
m_isInitialized = true; \
|
||||
@@ -61,7 +61,6 @@ ComplexSchur<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >::compute(const Matri
|
||||
return *this; \
|
||||
} \
|
||||
lapack_int n = matrix.cols(), sdim, info; \
|
||||
lapack_int lda = matrix.outerStride(); \
|
||||
lapack_int matrix_order = MKLCOLROW; \
|
||||
char jobvs, sort='N'; \
|
||||
LAPACK_##MKLPREFIX_U##_SELECT1 select = 0; \
|
||||
@@ -69,6 +68,7 @@ ComplexSchur<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >::compute(const Matri
|
||||
m_matU.resize(n, n); \
|
||||
lapack_int ldvs = m_matU.outerStride(); \
|
||||
m_matT = matrix; \
|
||||
lapack_int lda = m_matT.outerStride(); \
|
||||
Matrix<EIGTYPE, Dynamic, Dynamic> w; \
|
||||
w.resize(n, 1);\
|
||||
info = LAPACKE_##MKLPREFIX##gees( matrix_order, jobvs, sort, select, n, (MKLTYPE*)m_matT.data(), lda, &sdim, (MKLTYPE*)w.data(), (MKLTYPE*)m_matU.data(), ldvs ); \
|
||||
|
||||
6
Eigen/src/Eigenvalues/RealSchur_MKL.h
Normal file → Executable file
6
Eigen/src/Eigenvalues/RealSchur_MKL.h
Normal file → Executable file
@@ -40,14 +40,13 @@ namespace Eigen {
|
||||
/** \internal Specialization for the data types supported by MKL */
|
||||
|
||||
#define EIGEN_MKL_SCHUR_REAL(EIGTYPE, MKLTYPE, MKLPREFIX, MKLPREFIX_U, EIGCOLROW, MKLCOLROW) \
|
||||
template<> inline \
|
||||
template<> template<typename InputType> inline \
|
||||
RealSchur<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >& \
|
||||
RealSchur<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >::compute(const Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW>& matrix, bool computeU) \
|
||||
RealSchur<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >::compute(const EigenBase<InputType>& matrix, bool computeU) \
|
||||
{ \
|
||||
eigen_assert(matrix.cols() == matrix.rows()); \
|
||||
\
|
||||
lapack_int n = matrix.cols(), sdim, info; \
|
||||
lapack_int lda = matrix.outerStride(); \
|
||||
lapack_int matrix_order = MKLCOLROW; \
|
||||
char jobvs, sort='N'; \
|
||||
LAPACK_##MKLPREFIX_U##_SELECT2 select = 0; \
|
||||
@@ -55,6 +54,7 @@ RealSchur<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >::compute(const Matrix<E
|
||||
m_matU.resize(n, n); \
|
||||
lapack_int ldvs = m_matU.outerStride(); \
|
||||
m_matT = matrix; \
|
||||
lapack_int lda = m_matT.outerStride(); \
|
||||
Matrix<EIGTYPE, Dynamic, Dynamic> wr, wi; \
|
||||
wr.resize(n, 1); wi.resize(n, 1); \
|
||||
info = LAPACKE_##MKLPREFIX##gees( matrix_order, jobvs, sort, select, n, (MKLTYPE*)m_matT.data(), lda, &sdim, (MKLTYPE*)wr.data(), (MKLTYPE*)wi.data(), (MKLTYPE*)m_matU.data(), ldvs ); \
|
||||
|
||||
8
Eigen/src/Eigenvalues/SelfAdjointEigenSolver_MKL.h
Normal file → Executable file
8
Eigen/src/Eigenvalues/SelfAdjointEigenSolver_MKL.h
Normal file → Executable file
@@ -40,9 +40,9 @@ namespace Eigen {
|
||||
/** \internal Specialization for the data types supported by MKL */
|
||||
|
||||
#define EIGEN_MKL_EIG_SELFADJ(EIGTYPE, MKLTYPE, MKLRTYPE, MKLNAME, EIGCOLROW, MKLCOLROW ) \
|
||||
template<> inline \
|
||||
template<> template<typename InputType> inline \
|
||||
SelfAdjointEigenSolver<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >& \
|
||||
SelfAdjointEigenSolver<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >::compute(const Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW>& matrix, int options) \
|
||||
SelfAdjointEigenSolver<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >::compute(const EigenBase<InputType>& matrix, int options) \
|
||||
{ \
|
||||
eigen_assert(matrix.cols() == matrix.rows()); \
|
||||
eigen_assert((options&~(EigVecMask|GenEigMask))==0 \
|
||||
@@ -56,7 +56,7 @@ SelfAdjointEigenSolver<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >::compute(c
|
||||
\
|
||||
if(n==1) \
|
||||
{ \
|
||||
m_eivalues.coeffRef(0,0) = numext::real(matrix.coeff(0,0)); \
|
||||
m_eivalues.coeffRef(0,0) = numext::real(m_eivec.coeff(0,0)); \
|
||||
if(computeEigenvectors) m_eivec.setOnes(n,n); \
|
||||
m_info = Success; \
|
||||
m_isInitialized = true; \
|
||||
@@ -64,7 +64,7 @@ SelfAdjointEigenSolver<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >::compute(c
|
||||
return *this; \
|
||||
} \
|
||||
\
|
||||
lda = matrix.outerStride(); \
|
||||
lda = m_eivec.outerStride(); \
|
||||
matrix_order=MKLCOLROW; \
|
||||
char jobz, uplo='L'/*, range='A'*/; \
|
||||
jobz = computeEigenvectors ? 'V' : 'N'; \
|
||||
|
||||
Reference in New Issue
Block a user