33 #ifndef EIGEN_TRIANGULAR_SOLVER_MATRIX_BLAS_H
34 #define EIGEN_TRIANGULAR_SOLVER_MATRIX_BLAS_H
41 #define EIGEN_BLAS_TRSM_L(EIGTYPE, BLASTYPE, BLASPREFIX) \
42 template <typename Index, int Mode, bool Conjugate, int TriStorageOrder> \
43 struct triangular_solve_matrix<EIGTYPE,Index,OnTheLeft,Mode,Conjugate,TriStorageOrder,ColMajor> \
46 IsLower = (Mode&Lower) == Lower, \
47 IsUnitDiag = (Mode&UnitDiag) ? 1 : 0, \
48 IsZeroDiag = (Mode&ZeroDiag) ? 1 : 0, \
49 conjA = ((TriStorageOrder==ColMajor) && Conjugate) ? 1 : 0 \
52 Index size, Index otherSize, \
53 const EIGTYPE* _tri, Index triStride, \
54 EIGTYPE* _other, Index otherStride, level3_blocking<EIGTYPE,EIGTYPE>& ) \
56 BlasIndex m = convert_index<BlasIndex>(size), n = convert_index<BlasIndex>(otherSize), lda, ldb; \
57 char side = 'L', uplo, diag='N', transa; \
60 ldb = convert_index<BlasIndex>(otherStride);\
64 transa = (TriStorageOrder==RowMajor) ? ((Conjugate) ? 'C' : 'T') : 'N'; \
66 uplo = IsLower ? 'L' : 'U'; \
67 if (TriStorageOrder==RowMajor) uplo = (uplo == 'L') ? 'U' : 'L'; \
69 typedef Matrix<EIGTYPE, Dynamic, Dynamic, TriStorageOrder> MatrixTri; \
70 Map<const MatrixTri, 0, OuterStride<> > tri(_tri,size,size,OuterStride<>(triStride)); \
74 a_tmp = tri.conjugate(); \
76 lda = convert_index<BlasIndex>(a_tmp.outerStride()); \
79 lda = convert_index<BlasIndex>(triStride); \
81 if (IsUnitDiag) diag='U'; \
83 BLASPREFIX##trsm_(&side, &uplo, &transa, &diag, &m, &n, &numext::real_ref(alpha), (const BLASTYPE*)a, &lda, (BLASTYPE*)_other, &ldb); \
87 EIGEN_BLAS_TRSM_L(
double,
double, d)
88 EIGEN_BLAS_TRSM_L(dcomplex,
double, z)
89 EIGEN_BLAS_TRSM_L(
float,
float, s)
90 EIGEN_BLAS_TRSM_L(scomplex,
float, c)
94 #define EIGEN_BLAS_TRSM_R(EIGTYPE, BLASTYPE, BLASPREFIX) \
95 template <typename Index, int Mode, bool Conjugate, int TriStorageOrder> \
96 struct triangular_solve_matrix<EIGTYPE,Index,OnTheRight,Mode,Conjugate,TriStorageOrder,ColMajor> \
99 IsLower = (Mode&Lower) == Lower, \
100 IsUnitDiag = (Mode&UnitDiag) ? 1 : 0, \
101 IsZeroDiag = (Mode&ZeroDiag) ? 1 : 0, \
102 conjA = ((TriStorageOrder==ColMajor) && Conjugate) ? 1 : 0 \
105 Index size, Index otherSize, \
106 const EIGTYPE* _tri, Index triStride, \
107 EIGTYPE* _other, Index otherStride, level3_blocking<EIGTYPE,EIGTYPE>& ) \
109 BlasIndex m = convert_index<BlasIndex>(otherSize), n = convert_index<BlasIndex>(size), lda, ldb; \
110 char side = 'R', uplo, diag='N', transa; \
113 ldb = convert_index<BlasIndex>(otherStride);\
117 transa = (TriStorageOrder==RowMajor) ? ((Conjugate) ? 'C' : 'T') : 'N'; \
119 uplo = IsLower ? 'L' : 'U'; \
120 if (TriStorageOrder==RowMajor) uplo = (uplo == 'L') ? 'U' : 'L'; \
122 typedef Matrix<EIGTYPE, Dynamic, Dynamic, TriStorageOrder> MatrixTri; \
123 Map<const MatrixTri, 0, OuterStride<> > tri(_tri,size,size,OuterStride<>(triStride)); \
127 a_tmp = tri.conjugate(); \
129 lda = convert_index<BlasIndex>(a_tmp.outerStride()); \
132 lda = convert_index<BlasIndex>(triStride); \
134 if (IsUnitDiag) diag='U'; \
136 BLASPREFIX##trsm_(&side, &uplo, &transa, &diag, &m, &n, &numext::real_ref(alpha), (const BLASTYPE*)a, &lda, (BLASTYPE*)_other, &ldb); \
141 EIGEN_BLAS_TRSM_R(
double,
double, d)
142 EIGEN_BLAS_TRSM_R(dcomplex,
double, z)
143 EIGEN_BLAS_TRSM_R(
float,
float, s)
144 EIGEN_BLAS_TRSM_R(scomplex,
float, c)
Namespace containing all symbols from the Eigen library.
Definition: Core:287