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>
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); \
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); \
#define EIGEN_BLAS_SYMV_SPECIALIZATION(EIGTYPE, BLASTYPE, BLASFUNC)
Definition: SelfadjointMatrixVector_BLAS.h:74
#define EIGEN_BLAS_SYMV_SPECIALIZE(Scalar)
Definition: SelfadjointMatrixVector_BLAS.h:53
int BLASFUNC() dsymv(char *, int *, double *, double *, int *, double *, int *, double *, double *, int *)
int BLASFUNC() chemv(char *, int *, float *, float *, int *, float *, int *, float *, float *, int *)
int BLASFUNC() zhemv(char *, int *, double *, double *, int *, double *, int *, double *, double *, int *)
int BLASFUNC() ssymv(char *, int *, float *, float *, int *, float *, int *, float *, float *, int *)
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
std::complex< double > dcomplex
Definition: MKL_support.h:128
std::complex< float > scomplex
Definition: MKL_support.h:129
Definition: Eigen_Colamd.h:49
Definition: SelfadjointMatrixVector_BLAS.h:51
Definition: SelfadjointMatrixVector.h:34