33 #ifndef EIGEN_SELFADJOINT_MATRIX_VECTOR_BLAS_H 34 #define EIGEN_SELFADJOINT_MATRIX_VECTOR_BLAS_H 37 #include "../InternalHeaderCheck.h" 49 template <
typename Scalar,
typename Index,
int StorageOrder,
int UpLo,
bool ConjugateLhs,
bool ConjugateRhs>
50 struct selfadjoint_matrix_vector_product_symv
51 : selfadjoint_matrix_vector_product<Scalar, Index, StorageOrder, UpLo, ConjugateLhs, ConjugateRhs, BuiltIn> {};
53 #define EIGEN_BLAS_SYMV_SPECIALIZE(Scalar) \ 54 template <typename Index, int StorageOrder, int UpLo, bool ConjugateLhs, bool ConjugateRhs> \ 55 struct selfadjoint_matrix_vector_product<Scalar, Index, StorageOrder, UpLo, ConjugateLhs, ConjugateRhs, \ 57 static void run(Index size, const Scalar* lhs, Index lhsStride, const Scalar* _rhs, Scalar* res, Scalar alpha) { \ 58 enum { IsColMajor = StorageOrder == ColMajor }; \ 59 if (IsColMajor == ConjugateLhs) { \ 60 selfadjoint_matrix_vector_product<Scalar, Index, StorageOrder, UpLo, ConjugateLhs, ConjugateRhs, \ 61 BuiltIn>::run(size, lhs, lhsStride, _rhs, res, alpha); \ 63 selfadjoint_matrix_vector_product_symv<Scalar, Index, StorageOrder, UpLo, ConjugateLhs, ConjugateRhs>::run( \ 64 size, lhs, lhsStride, _rhs, res, alpha); \ 69 EIGEN_BLAS_SYMV_SPECIALIZE(
double)
70 EIGEN_BLAS_SYMV_SPECIALIZE(
float)
71 EIGEN_BLAS_SYMV_SPECIALIZE(dcomplex)
72 EIGEN_BLAS_SYMV_SPECIALIZE(scomplex)
74 #define EIGEN_BLAS_SYMV_SPECIALIZATION(EIGTYPE, BLASTYPE, BLASFUNC) \ 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> { \ 77 typedef Matrix<EIGTYPE, Dynamic, 1, ColMajor> SYMVVector; \ 79 static void run(Index size, const EIGTYPE* lhs, Index lhsStride, const EIGTYPE* _rhs, EIGTYPE* res, \ 81 if (size == 0) return; \ 82 enum { IsRowMajor = StorageOrder == RowMajor ? 1 : 0, IsLower = UpLo == Lower ? 1 : 0 }; \ 83 BlasIndex n = convert_index<BlasIndex>(size), lda = convert_index<BlasIndex>(lhsStride), incx = 1, incy = 1; \ 85 const EIGTYPE* x_ptr; \ 86 char uplo = (IsRowMajor) ? (IsLower ? 'U' : 'L') : (IsLower ? 'L' : 'U'); \ 89 Map<const SYMVVector, 0> map_x(_rhs, size, 1); \ 90 x_tmp = map_x.conjugate(); \ 91 x_ptr = x_tmp.data(); \ 94 BLASFUNC(&uplo, &n, (const BLASTYPE*)&numext::real_ref(alpha), (const BLASTYPE*)lhs, &lda, \ 95 (const BLASTYPE*)x_ptr, &incx, (const BLASTYPE*)&numext::real_ref(beta), (BLASTYPE*)res, &incy); \ 100 EIGEN_BLAS_SYMV_SPECIALIZATION(
double,
double, dsymv)
101 EIGEN_BLAS_SYMV_SPECIALIZATION(
float,
float, ssymv)
102 EIGEN_BLAS_SYMV_SPECIALIZATION(dcomplex, MKL_Complex16, zhemv)
103 EIGEN_BLAS_SYMV_SPECIALIZATION(scomplex, MKL_Complex8, chemv)
105 EIGEN_BLAS_SYMV_SPECIALIZATION(
double,
double, dsymv_)
106 EIGEN_BLAS_SYMV_SPECIALIZATION(
float,
float, ssymv_)
107 EIGEN_BLAS_SYMV_SPECIALIZATION(dcomplex,
double, zhemv_)
108 EIGEN_BLAS_SYMV_SPECIALIZATION(scomplex,
float, chemv_)
115 #endif // EIGEN_SELFADJOINT_MATRIX_VECTOR_BLAS_H Namespace containing all symbols from the Eigen library.
Definition: B01_Experimental.dox:1