33 #ifndef EIGEN_TRIANGULAR_SOLVER_MATRIX_BLAS_H
34 #define EIGEN_TRIANGULAR_SOLVER_MATRIX_BLAS_H
37 #include "../InternalHeaderCheck.h"
44 #define EIGEN_BLAS_TRSM_L(EIGTYPE, BLASTYPE, BLASFUNC) \
45 template <typename Index, int Mode, bool Conjugate, int TriStorageOrder> \
46 struct triangular_solve_matrix<EIGTYPE, Index, OnTheLeft, Mode, Conjugate, TriStorageOrder, ColMajor, 1> { \
48 IsLower = (Mode & Lower) == Lower, \
49 IsUnitDiag = (Mode & UnitDiag) ? 1 : 0, \
50 IsZeroDiag = (Mode & ZeroDiag) ? 1 : 0, \
51 conjA = ((TriStorageOrder == ColMajor) && Conjugate) ? 1 : 0 \
53 static void run(Index size, Index otherSize, const EIGTYPE* _tri, Index triStride, EIGTYPE* _other, \
54 Index otherIncr, Index otherStride, level3_blocking<EIGTYPE, EIGTYPE>& ) { \
55 if (size == 0 || otherSize == 0) return; \
56 EIGEN_ONLY_USED_FOR_DEBUG(otherIncr); \
57 eigen_assert(otherIncr == 1); \
58 BlasIndex m = convert_index<BlasIndex>(size), n = convert_index<BlasIndex>(otherSize), lda, ldb; \
59 char side = 'L', uplo, diag = 'N', transa; \
62 ldb = convert_index<BlasIndex>(otherStride); \
66 transa = (TriStorageOrder == RowMajor) ? ((Conjugate) ? 'C' : 'T') : 'N'; \
68 uplo = IsLower ? 'L' : 'U'; \
69 if (TriStorageOrder == RowMajor) uplo = (uplo == 'L') ? 'U' : 'L'; \
71 typedef Matrix<EIGTYPE, Dynamic, Dynamic, TriStorageOrder> MatrixTri; \
72 Map<const MatrixTri, 0, OuterStride<> > tri(_tri, size, size, OuterStride<>(triStride)); \
76 a_tmp = tri.conjugate(); \
78 lda = convert_index<BlasIndex>(a_tmp.outerStride()); \
81 lda = convert_index<BlasIndex>(triStride); \
83 if (IsUnitDiag) diag = 'U'; \
85 BLASFUNC(&side, &uplo, &transa, &diag, &m, &n, (const BLASTYPE*)&numext::real_ref(alpha), (const BLASTYPE*)a, \
86 &lda, (BLASTYPE*)_other, &ldb); \
103 #define EIGEN_BLAS_TRSM_R(EIGTYPE, BLASTYPE, BLASFUNC) \
104 template <typename Index, int Mode, bool Conjugate, int TriStorageOrder> \
105 struct triangular_solve_matrix<EIGTYPE, Index, OnTheRight, Mode, Conjugate, TriStorageOrder, ColMajor, 1> { \
107 IsLower = (Mode & Lower) == Lower, \
108 IsUnitDiag = (Mode & UnitDiag) ? 1 : 0, \
109 IsZeroDiag = (Mode & ZeroDiag) ? 1 : 0, \
110 conjA = ((TriStorageOrder == ColMajor) && Conjugate) ? 1 : 0 \
112 static void run(Index size, Index otherSize, const EIGTYPE* _tri, Index triStride, EIGTYPE* _other, \
113 Index otherIncr, Index otherStride, level3_blocking<EIGTYPE, EIGTYPE>& ) { \
114 if (size == 0 || otherSize == 0) return; \
115 EIGEN_ONLY_USED_FOR_DEBUG(otherIncr); \
116 eigen_assert(otherIncr == 1); \
117 BlasIndex m = convert_index<BlasIndex>(otherSize), n = convert_index<BlasIndex>(size), lda, ldb; \
118 char side = 'R', uplo, diag = 'N', transa; \
121 ldb = convert_index<BlasIndex>(otherStride); \
125 transa = (TriStorageOrder == RowMajor) ? ((Conjugate) ? 'C' : 'T') : 'N'; \
127 uplo = IsLower ? 'L' : 'U'; \
128 if (TriStorageOrder == RowMajor) uplo = (uplo == 'L') ? 'U' : 'L'; \
130 typedef Matrix<EIGTYPE, Dynamic, Dynamic, TriStorageOrder> MatrixTri; \
131 Map<const MatrixTri, 0, OuterStride<> > tri(_tri, size, size, OuterStride<>(triStride)); \
135 a_tmp = tri.conjugate(); \
137 lda = convert_index<BlasIndex>(a_tmp.outerStride()); \
140 lda = convert_index<BlasIndex>(triStride); \
142 if (IsUnitDiag) diag = 'U'; \
144 BLASFUNC(&side, &uplo, &transa, &diag, &m, &n, (const BLASTYPE*)&numext::real_ref(alpha), (const BLASTYPE*)a, \
145 &lda, (BLASTYPE*)_other, &ldb); \
#define EIGEN_BLAS_TRSM_R(EIGTYPE, BLASTYPE, BLASFUNC)
Definition: TriangularSolverMatrix_BLAS.h:103
#define EIGEN_BLAS_TRSM_L(EIGTYPE, BLASTYPE, BLASFUNC)
Definition: TriangularSolverMatrix_BLAS.h:44
int BLASFUNC() strsm(char *, char *, char *, char *, int *, int *, float *, float *, int *, float *, int *)
int BLASFUNC() ztrsm(char *, char *, char *, char *, int *, int *, double *, double *, int *, double *, int *)
int BLASFUNC() dtrsm(char *, char *, char *, char *, int *, int *, double *, double *, int *, double *, int *)
int BLASFUNC() ctrsm(char *, char *, char *, char *, int *, int *, float *, float *, int *, 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