33 #ifndef EIGEN_LLT_MKL_H
34 #define EIGEN_LLT_MKL_H
36 #include "Eigen/src/Core/util/MKL_support.h"
43 template<
typename Scalar>
struct mkl_llt;
45 #define EIGEN_MKL_LLT(EIGTYPE, MKLTYPE, MKLPREFIX) \
46 template<> struct mkl_llt<EIGTYPE> \
48 template<typename MatrixType> \
49 static inline typename MatrixType::Index potrf(MatrixType& m, char uplo) \
51 lapack_int matrix_order; \
52 lapack_int size, lda, info, StorageOrder; \
54 eigen_assert(m.rows()==m.cols()); \
57 StorageOrder = MatrixType::Flags&RowMajorBit?RowMajor:ColMajor; \
58 matrix_order = StorageOrder==RowMajor ? LAPACK_ROW_MAJOR : LAPACK_COL_MAJOR; \
59 a = &(m.coeffRef(0,0)); \
60 lda = m.outerStride(); \
62 info = LAPACKE_##MKLPREFIX##potrf( matrix_order, uplo, size, (MKLTYPE*)a, lda ); \
63 info = (info==0) ? -1 : info>0 ? info-1 : size; \
67 template<> struct llt_inplace<EIGTYPE, Lower> \
69 template<typename MatrixType> \
70 static typename MatrixType::Index blocked(MatrixType& m) \
72 return mkl_llt<EIGTYPE>::potrf(m, 'L'); \
74 template<typename MatrixType, typename VectorType> \
75 static typename MatrixType::Index rankUpdate(MatrixType& mat, const VectorType& vec, const typename MatrixType::RealScalar& sigma) \
76 { return Eigen::internal::llt_rank_update_lower(mat, vec, sigma); } \
78 template<> struct llt_inplace<EIGTYPE, Upper> \
80 template<typename MatrixType> \
81 static typename MatrixType::Index blocked(MatrixType& m) \
83 return mkl_llt<EIGTYPE>::potrf(m, 'U'); \
85 template<typename MatrixType, typename VectorType> \
86 static typename MatrixType::Index rankUpdate(MatrixType& mat, const VectorType& vec, const typename MatrixType::RealScalar& sigma) \
88 Transpose<MatrixType> matt(mat); \
89 return llt_inplace<EIGTYPE, Lower>::rankUpdate(matt, vec.conjugate(), sigma); \
93 EIGEN_MKL_LLT(
double,
double, d)
94 EIGEN_MKL_LLT(
float,
float, s)
95 EIGEN_MKL_LLT(dcomplex, MKL_Complex16, z)
96 EIGEN_MKL_LLT(scomplex, MKL_Complex8, c)
102 #endif // EIGEN_LLT_MKL_H
Definition: Eigen_Colamd.h:50