33 #ifndef EIGEN_GENERAL_MATRIX_MATRIX_TRIANGULAR_BLAS_H 34 #define EIGEN_GENERAL_MATRIX_MATRIX_TRIANGULAR_BLAS_H 37 #include "../InternalHeaderCheck.h" 43 template <
typename Index,
typename Scalar,
int AStorageOrder,
bool ConjugateA,
int ResStorageOrder,
int UpLo>
44 struct general_matrix_matrix_rankupdate
45 : general_matrix_matrix_triangular_product<Index, Scalar, AStorageOrder, ConjugateA, Scalar, AStorageOrder,
46 ConjugateA, ResStorageOrder, 1, UpLo, BuiltIn> {};
49 #define EIGEN_BLAS_RANKUPDATE_SPECIALIZE(Scalar) \ 50 template <typename Index, int LhsStorageOrder, bool ConjugateLhs, int RhsStorageOrder, bool ConjugateRhs, int UpLo> \ 51 struct general_matrix_matrix_triangular_product<Index, Scalar, LhsStorageOrder, ConjugateLhs, Scalar, \ 52 RhsStorageOrder, ConjugateRhs, ColMajor, 1, UpLo, Specialized> { \ 53 static EIGEN_STRONG_INLINE void run(Index size, Index depth, const Scalar* lhs, Index lhsStride, \ 54 const Scalar* rhs, Index rhsStride, Scalar* res, Index resIncr, \ 55 Index resStride, Scalar alpha, level3_blocking<Scalar, Scalar>& blocking) { \ 56 if (lhs == rhs && ((UpLo & (Lower | Upper)) == UpLo)) { \ 57 general_matrix_matrix_rankupdate<Index, Scalar, LhsStorageOrder, ConjugateLhs, ColMajor, UpLo>::run( \ 58 size, depth, lhs, lhsStride, rhs, rhsStride, res, resStride, alpha, blocking); \ 60 general_matrix_matrix_triangular_product<Index, Scalar, LhsStorageOrder, ConjugateLhs, Scalar, \ 61 RhsStorageOrder, ConjugateRhs, ColMajor, 1, UpLo, \ 62 BuiltIn>::run(size, depth, lhs, lhsStride, rhs, rhsStride, res, \ 63 resIncr, resStride, alpha, blocking); \ 68 EIGEN_BLAS_RANKUPDATE_SPECIALIZE(
double)
69 EIGEN_BLAS_RANKUPDATE_SPECIALIZE(
float)
75 #define EIGEN_BLAS_RANKUPDATE_R(EIGTYPE, BLASTYPE, BLASFUNC) \ 76 template <typename Index, int AStorageOrder, bool ConjugateA, int UpLo> \ 77 struct general_matrix_matrix_rankupdate<Index, EIGTYPE, AStorageOrder, ConjugateA, ColMajor, UpLo> { \ 79 IsLower = (UpLo & Lower) == Lower, \ 80 LowUp = IsLower ? Lower : Upper, \ 81 conjA = ((AStorageOrder == ColMajor) && ConjugateA) ? 1 : 0 \ 83 static EIGEN_STRONG_INLINE void run(Index size, Index depth, const EIGTYPE* lhs, Index lhsStride, \ 84 const EIGTYPE* , Index , EIGTYPE* res, Index resStride, \ 85 EIGTYPE alpha, level3_blocking<EIGTYPE, EIGTYPE>& ) { \ 87 if (size == 0 || depth == 0) return; \ 88 BlasIndex lda = convert_index<BlasIndex>(lhsStride), ldc = convert_index<BlasIndex>(resStride), \ 89 n = convert_index<BlasIndex>(size), k = convert_index<BlasIndex>(depth); \ 90 char uplo = ((IsLower) ? 'L' : 'U'), trans = ((AStorageOrder == RowMajor) ? 'T' : 'N'); \ 92 BLASFUNC(&uplo, &trans, &n, &k, (const BLASTYPE*)&numext::real_ref(alpha), lhs, &lda, \ 93 (const BLASTYPE*)&numext::real_ref(beta), res, &ldc); \ 98 #define EIGEN_BLAS_RANKUPDATE_C(EIGTYPE, BLASTYPE, RTYPE, BLASFUNC) \ 99 template <typename Index, int AStorageOrder, bool ConjugateA, int UpLo> \ 100 struct general_matrix_matrix_rankupdate<Index, EIGTYPE, AStorageOrder, ConjugateA, ColMajor, UpLo> { \ 102 IsLower = (UpLo & Lower) == Lower, \ 103 LowUp = IsLower ? Lower : Upper, \ 104 conjA = (((AStorageOrder == ColMajor) && ConjugateA) || ((AStorageOrder == RowMajor) && !ConjugateA)) ? 1 : 0 \ 106 static EIGEN_STRONG_INLINE void run(Index size, Index depth, const EIGTYPE* lhs, Index lhsStride, \ 107 const EIGTYPE* , Index , EIGTYPE* res, Index resStride, \ 108 EIGTYPE alpha, level3_blocking<EIGTYPE, EIGTYPE>& ) { \ 109 typedef Matrix<EIGTYPE, Dynamic, Dynamic, AStorageOrder> MatrixType; \ 110 if (size == 0 || depth == 0) return; \ 111 BlasIndex lda = convert_index<BlasIndex>(lhsStride), ldc = convert_index<BlasIndex>(resStride), \ 112 n = convert_index<BlasIndex>(size), k = convert_index<BlasIndex>(depth); \ 113 char uplo = ((IsLower) ? 'L' : 'U'), trans = ((AStorageOrder == RowMajor) ? 'C' : 'N'); \ 114 RTYPE alpha_, beta_; \ 115 const EIGTYPE* a_ptr; \ 117 alpha_ = alpha.real(); \ 122 Map<const MatrixType, 0, OuterStride<> > mapA(lhs, n, k, OuterStride<>(lhsStride)); \ 123 a = mapA.conjugate(); \ 124 lda = a.outerStride(); \ 128 BLASFUNC(&uplo, &trans, &n, &k, &alpha_, (BLASTYPE*)a_ptr, &lda, &beta_, (BLASTYPE*)res, &ldc); \ 133 EIGEN_BLAS_RANKUPDATE_R(
double,
double, dsyrk)
134 EIGEN_BLAS_RANKUPDATE_R(
float,
float, ssyrk)
136 EIGEN_BLAS_RANKUPDATE_R(
double,
double, dsyrk_)
137 EIGEN_BLAS_RANKUPDATE_R(
float,
float, ssyrk_)
148 #endif // EIGEN_GENERAL_MATRIX_MATRIX_TRIANGULAR_BLAS_H Namespace containing all symbols from the Eigen library.
Definition: B01_Experimental.dox:1