33 #ifndef EIGEN_SELFADJOINT_MATRIX_VECTOR_MKL_H 34 #define EIGEN_SELFADJOINT_MATRIX_VECTOR_MKL_H 46 template<
typename Scalar,
typename Index,
int StorageOrder,
int UpLo,
bool ConjugateLhs,
bool ConjugateRhs>
47 struct selfadjoint_matrix_vector_product_symv :
48 selfadjoint_matrix_vector_product<Scalar,Index,StorageOrder,UpLo,ConjugateLhs,ConjugateRhs,BuiltIn> {};
50 #define EIGEN_MKL_SYMV_SPECIALIZE(Scalar) \ 51 template<typename Index, int StorageOrder, int UpLo, bool ConjugateLhs, bool ConjugateRhs> \ 52 struct selfadjoint_matrix_vector_product<Scalar,Index,StorageOrder,UpLo,ConjugateLhs,ConjugateRhs,Specialized> { \ 54 Index size, const Scalar* lhs, Index lhsStride, \ 55 const Scalar* _rhs, Index rhsIncr, Scalar* res, Scalar alpha) { \ 57 IsColMajor = StorageOrder==ColMajor \ 59 if (IsColMajor == ConjugateLhs) {\ 60 selfadjoint_matrix_vector_product<Scalar,Index,StorageOrder,UpLo,ConjugateLhs,ConjugateRhs,BuiltIn>::run( \ 61 size, lhs, lhsStride, _rhs, rhsIncr, res, alpha); \ 63 selfadjoint_matrix_vector_product_symv<Scalar,Index,StorageOrder,UpLo,ConjugateLhs,ConjugateRhs>::run( \ 64 size, lhs, lhsStride, _rhs, rhsIncr, res, alpha); \ 69 EIGEN_MKL_SYMV_SPECIALIZE(
double)
70 EIGEN_MKL_SYMV_SPECIALIZE(
float)
71 EIGEN_MKL_SYMV_SPECIALIZE(dcomplex)
72 EIGEN_MKL_SYMV_SPECIALIZE(scomplex)
74 #define EIGEN_MKL_SYMV_SPECIALIZATION(EIGTYPE,MKLTYPE,MKLFUNC) \ 75 template<typename Index, int StorageOrder, int UpLo, bool ConjugateLhs, bool ConjugateRhs> \ 76 struct selfadjoint_matrix_vector_product_symv<EIGTYPE,Index,StorageOrder,UpLo,ConjugateLhs,ConjugateRhs> \ 78 typedef Matrix<EIGTYPE,Dynamic,1,ColMajor> SYMVVector;\ 81 Index size, const EIGTYPE* lhs, Index lhsStride, \ 82 const EIGTYPE* _rhs, Index rhsIncr, EIGTYPE* res, EIGTYPE alpha) \ 85 IsRowMajor = StorageOrder==RowMajor ? 1 : 0, \ 86 IsLower = UpLo == Lower ? 1 : 0 \ 88 MKL_INT n=size, lda=lhsStride, incx=rhsIncr, incy=1; \ 89 MKLTYPE alpha_, beta_; \ 90 const EIGTYPE *x_ptr, myone(1); \ 91 char uplo=(IsRowMajor) ? (IsLower ? 'U' : 'L') : (IsLower ? 'L' : 'U'); \ 92 assign_scalar_eig2mkl(alpha_, alpha); \ 93 assign_scalar_eig2mkl(beta_, myone); \ 96 Map<const SYMVVector, 0, InnerStride<> > map_x(_rhs,size,1,InnerStride<>(incx)); \ 97 x_tmp=map_x.conjugate(); \ 101 MKLFUNC(&uplo, &n, &alpha_, (const MKLTYPE*)lhs, &lda, (const MKLTYPE*)x_ptr, &incx, &beta_, (MKLTYPE*)res, &incy); \ 105 EIGEN_MKL_SYMV_SPECIALIZATION(
double,
double, dsymv)
106 EIGEN_MKL_SYMV_SPECIALIZATION(
float,
float, ssymv)
107 EIGEN_MKL_SYMV_SPECIALIZATION(dcomplex, MKL_Complex16, zhemv)
108 EIGEN_MKL_SYMV_SPECIALIZATION(scomplex, MKL_Complex8, chemv)
114 #endif // EIGEN_SELFADJOINT_MATRIX_VECTOR_MKL_H
Definition: Eigen_Colamd.h:50