33 #ifndef EIGEN_SELFADJOINT_MATRIX_VECTOR_BLAS_H
34 #define EIGEN_SELFADJOINT_MATRIX_VECTOR_BLAS_H
36 #include "../InternalHeaderCheck.h"
48 template<
typename Scalar,
typename Index,
int StorageOrder,
int UpLo,
bool ConjugateLhs,
bool ConjugateRhs>
49 struct selfadjoint_matrix_vector_product_symv :
50 selfadjoint_matrix_vector_product<Scalar,Index,StorageOrder,UpLo,ConjugateLhs,ConjugateRhs,BuiltIn> {};
52 #define EIGEN_BLAS_SYMV_SPECIALIZE(Scalar) \
53 template<typename Index, int StorageOrder, int UpLo, bool ConjugateLhs, bool ConjugateRhs> \
54 struct selfadjoint_matrix_vector_product<Scalar,Index,StorageOrder,UpLo,ConjugateLhs,ConjugateRhs,Specialized> { \
56 Index size, const Scalar* lhs, Index lhsStride, \
57 const Scalar* _rhs, Scalar* res, Scalar alpha) { \
59 IsColMajor = StorageOrder==ColMajor \
61 if (IsColMajor == ConjugateLhs) {\
62 selfadjoint_matrix_vector_product<Scalar,Index,StorageOrder,UpLo,ConjugateLhs,ConjugateRhs,BuiltIn>::run( \
63 size, lhs, lhsStride, _rhs, res, alpha); \
65 selfadjoint_matrix_vector_product_symv<Scalar,Index,StorageOrder,UpLo,ConjugateLhs,ConjugateRhs>::run( \
66 size, lhs, lhsStride, _rhs, res, alpha); \
76 #define EIGEN_BLAS_SYMV_SPECIALIZATION(EIGTYPE,BLASTYPE,BLASFUNC) \
77 template<typename Index, int StorageOrder, int UpLo, bool ConjugateLhs, bool ConjugateRhs> \
78 struct selfadjoint_matrix_vector_product_symv<EIGTYPE,Index,StorageOrder,UpLo,ConjugateLhs,ConjugateRhs> \
80 typedef Matrix<EIGTYPE,Dynamic,1,ColMajor> SYMVVector;\
83 Index size, const EIGTYPE* lhs, Index lhsStride, \
84 const EIGTYPE* _rhs, EIGTYPE* res, EIGTYPE alpha) \
87 IsRowMajor = StorageOrder==RowMajor ? 1 : 0, \
88 IsLower = UpLo == Lower ? 1 : 0 \
90 BlasIndex n=convert_index<BlasIndex>(size), lda=convert_index<BlasIndex>(lhsStride), incx=1, incy=1; \
92 const EIGTYPE *x_ptr; \
93 char uplo=(IsRowMajor) ? (IsLower ? 'U' : 'L') : (IsLower ? 'L' : 'U'); \
96 Map<const SYMVVector, 0 > map_x(_rhs,size,1); \
97 x_tmp=map_x.conjugate(); \
100 BLASFUNC(&uplo, &n, (const BLASTYPE*)&numext::real_ref(alpha), (const BLASTYPE*)lhs, &lda, (const BLASTYPE*)x_ptr, &incx, (const BLASTYPE*)&numext::real_ref(beta), (BLASTYPE*)res, &incy); \
#define EIGEN_BLAS_SYMV_SPECIALIZATION(EIGTYPE, BLASTYPE, BLASFUNC)
#define EIGEN_BLAS_SYMV_SPECIALIZE(Scalar)
int BLASFUNC() ssymv(const char *, const int *, const float *, const float *, const int *, const float *, const int *, const float *, float *, const int *)
int BLASFUNC() zhemv(const char *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *)
int BLASFUNC() dsymv(const char *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *)
int BLASFUNC() chemv(const char *, const int *, const float *, const float *, const int *, const float *, const int *, const float *, float *, const int *)
std::complex< double > dcomplex
std::complex< float > scomplex