33 #ifndef EIGEN_TRIANGULAR_SOLVER_MATRIX_BLAS_H
34 #define EIGEN_TRIANGULAR_SOLVER_MATRIX_BLAS_H
36 #include "../InternalHeaderCheck.h"
43 #define EIGEN_BLAS_TRSM_L(EIGTYPE, BLASTYPE, BLASFUNC) \
44 template <typename Index, int Mode, bool Conjugate, int TriStorageOrder> \
45 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 \
54 Index size, Index otherSize, \
55 const EIGTYPE* _tri, Index triStride, \
56 EIGTYPE* _other, Index otherIncr, Index otherStride, level3_blocking<EIGTYPE,EIGTYPE>& ) \
58 EIGEN_ONLY_USED_FOR_DEBUG(otherIncr); \
59 eigen_assert(otherIncr == 1); \
60 BlasIndex m = convert_index<BlasIndex>(size), n = convert_index<BlasIndex>(otherSize), lda, ldb; \
61 char side = 'L', uplo, diag='N', transa; \
64 ldb = convert_index<BlasIndex>(otherStride);\
68 transa = (TriStorageOrder==RowMajor) ? ((Conjugate) ? 'C' : 'T') : 'N'; \
70 uplo = IsLower ? 'L' : 'U'; \
71 if (TriStorageOrder==RowMajor) uplo = (uplo == 'L') ? 'U' : 'L'; \
73 typedef Matrix<EIGTYPE, Dynamic, Dynamic, TriStorageOrder> MatrixTri; \
74 Map<const MatrixTri, 0, OuterStride<> > tri(_tri,size,size,OuterStride<>(triStride)); \
78 a_tmp = tri.conjugate(); \
80 lda = convert_index<BlasIndex>(a_tmp.outerStride()); \
83 lda = convert_index<BlasIndex>(triStride); \
85 if (IsUnitDiag) diag='U'; \
87 BLASFUNC(&side, &uplo, &transa, &diag, &m, &n, (const BLASTYPE*)&numext::real_ref(alpha), (const BLASTYPE*)a, &lda, (BLASTYPE*)_other, &ldb); \
104 #define EIGEN_BLAS_TRSM_R(EIGTYPE, BLASTYPE, BLASFUNC) \
105 template <typename Index, int Mode, bool Conjugate, int TriStorageOrder> \
106 struct triangular_solve_matrix<EIGTYPE,Index,OnTheRight,Mode,Conjugate,TriStorageOrder,ColMajor,1> \
109 IsLower = (Mode&Lower) == Lower, \
110 IsUnitDiag = (Mode&UnitDiag) ? 1 : 0, \
111 IsZeroDiag = (Mode&ZeroDiag) ? 1 : 0, \
112 conjA = ((TriStorageOrder==ColMajor) && Conjugate) ? 1 : 0 \
115 Index size, Index otherSize, \
116 const EIGTYPE* _tri, Index triStride, \
117 EIGTYPE* _other, Index otherIncr, Index otherStride, level3_blocking<EIGTYPE,EIGTYPE>& ) \
119 EIGEN_ONLY_USED_FOR_DEBUG(otherIncr); \
120 eigen_assert(otherIncr == 1); \
121 BlasIndex m = convert_index<BlasIndex>(otherSize), n = convert_index<BlasIndex>(size), lda, ldb; \
122 char side = 'R', uplo, diag='N', transa; \
125 ldb = convert_index<BlasIndex>(otherStride);\
129 transa = (TriStorageOrder==RowMajor) ? ((Conjugate) ? 'C' : 'T') : 'N'; \
131 uplo = IsLower ? 'L' : 'U'; \
132 if (TriStorageOrder==RowMajor) uplo = (uplo == 'L') ? 'U' : 'L'; \
134 typedef Matrix<EIGTYPE, Dynamic, Dynamic, TriStorageOrder> MatrixTri; \
135 Map<const MatrixTri, 0, OuterStride<> > tri(_tri,size,size,OuterStride<>(triStride)); \
139 a_tmp = tri.conjugate(); \
141 lda = convert_index<BlasIndex>(a_tmp.outerStride()); \
144 lda = convert_index<BlasIndex>(triStride); \
146 if (IsUnitDiag) diag='U'; \
148 BLASFUNC(&side, &uplo, &transa, &diag, &m, &n, (const BLASTYPE*)&numext::real_ref(alpha), (const BLASTYPE*)a, &lda, (BLASTYPE*)_other, &ldb); \
#define EIGEN_BLAS_TRSM_R(EIGTYPE, BLASTYPE, BLASFUNC)
#define EIGEN_BLAS_TRSM_L(EIGTYPE, BLASTYPE, BLASFUNC)
int BLASFUNC() ctrsm(const char *, const char *, const char *, const char *, const int *, const int *, const float *, const float *, const int *, float *, const int *)
int BLASFUNC() dtrsm(const char *, const char *, const char *, const char *, const int *, const int *, const double *, const double *, const int *, double *, const int *)
int BLASFUNC() ztrsm(const char *, const char *, const char *, const char *, const int *, const int *, const double *, const double *, const int *, double *, const int *)
int BLASFUNC() strsm(const char *, const char *, const char *, const char *, const int *, const int *, const float *, const float *, const int *, float *, const int *)
std::complex< double > dcomplex
std::complex< float > scomplex