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); \ 91 EIGEN_BLAS_TRSM_L(
double,
double, dtrsm)
92 EIGEN_BLAS_TRSM_L(dcomplex, MKL_Complex16, ztrsm)
93 EIGEN_BLAS_TRSM_L(
float,
float, strsm)
94 EIGEN_BLAS_TRSM_L(scomplex, MKL_Complex8, ctrsm)
96 EIGEN_BLAS_TRSM_L(
double,
double, dtrsm_)
97 EIGEN_BLAS_TRSM_L(dcomplex,
double, ztrsm_)
98 EIGEN_BLAS_TRSM_L(
float,
float, strsm_)
99 EIGEN_BLAS_TRSM_L(scomplex,
float, ctrsm_)
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); \ 151 EIGEN_BLAS_TRSM_R(
double,
double, dtrsm)
152 EIGEN_BLAS_TRSM_R(dcomplex, MKL_Complex16, ztrsm)
153 EIGEN_BLAS_TRSM_R(
float,
float, strsm)
154 EIGEN_BLAS_TRSM_R(scomplex, MKL_Complex8, ctrsm)
156 EIGEN_BLAS_TRSM_R(
double,
double, dtrsm_)
157 EIGEN_BLAS_TRSM_R(dcomplex,
double, ztrsm_)
158 EIGEN_BLAS_TRSM_R(
float,
float, strsm_)
159 EIGEN_BLAS_TRSM_R(scomplex,
float, ctrsm_)
166 #endif // EIGEN_TRIANGULAR_SOLVER_MATRIX_BLAS_H Namespace containing all symbols from the Eigen library.
Definition: B01_Experimental.dox:1