11#ifndef TLAPACK_BLAS_TRMM_HH
12#define TLAPACK_BLAS_TRMM_HH
68 class T = type_t<matrixB_t>,
69 disable_if_allow_optblas_t<pair<matrixA_t, T>,
71 pair<alpha_t, T> > = 0>
86 const idx_t m = nrows(
B);
87 const idx_t n = ncols(
B);
93 trans != Op::ConjTrans);
98 if (
side == Side::Left) {
99 if (
trans == Op::NoTrans) {
101 if (
uplo == Uplo::Upper) {
102 for (idx_t j = 0; j < n; ++j) {
103 for (idx_t
k = 0;
k < m; ++
k) {
105 for (idx_t i = 0; i <
k; ++i)
113 for (idx_t j = 0; j < n; ++j) {
114 for (idx_t
k = m - 1;
k != idx_t(-1); --
k) {
118 for (idx_t i =
k + 1; i < m; ++i)
124 else if (
trans == Op::Trans) {
126 if (
uplo == Uplo::Upper) {
127 for (idx_t j = 0; j < n; ++j) {
128 for (idx_t i = m - 1; i != idx_t(-1); --i) {
132 for (idx_t
k = 0;
k < i; ++
k)
139 for (idx_t j = 0; j < n; ++j) {
140 for (idx_t i = 0; i < m; ++i) {
144 for (idx_t
k = i + 1;
k < m; ++
k)
153 if (
uplo == Uplo::Upper) {
154 for (idx_t j = 0; j < n; ++j) {
155 for (idx_t i = m - 1; i != idx_t(-1); --i) {
159 for (idx_t
k = 0;
k < i; ++
k)
166 for (idx_t j = 0; j < n; ++j) {
167 for (idx_t i = 0; i < m; ++i) {
171 for (idx_t
k = i + 1;
k < m; ++
k)
181 if (
trans == Op::NoTrans) {
182 if (
uplo == Uplo::Upper) {
183 for (idx_t j = n - 1; j != idx_t(-1); --j) {
187 for (idx_t i = 0; i < m; ++i)
190 for (idx_t
k = 0;
k < j; ++
k) {
192 for (idx_t i = 0; i < m; ++i)
198 for (idx_t j = 0; j < n; ++j) {
202 for (idx_t i = 0; i < m; ++i)
205 for (idx_t
k = j + 1;
k < n; ++
k) {
207 for (idx_t i = 0; i < m; ++i)
213 else if (
trans == Op::Trans) {
214 if (
uplo == Uplo::Upper) {
215 for (idx_t
k = 0;
k < n; ++
k) {
216 for (idx_t j = 0; j <
k; ++j) {
218 for (idx_t i = 0; i < m; ++i)
224 for (idx_t i = 0; i < m; ++i)
230 for (idx_t
k = n - 1;
k != idx_t(-1); --
k) {
231 for (idx_t j =
k + 1; j < n; ++j) {
233 for (idx_t i = 0; i < m; ++i)
239 for (idx_t i = 0; i < m; ++i)
246 if (
uplo == Uplo::Upper) {
247 for (idx_t
k = 0;
k < n; ++
k) {
248 for (idx_t j = 0; j <
k; ++j) {
250 for (idx_t i = 0; i < m; ++i)
257 for (idx_t i = 0; i < m; ++i)
263 for (idx_t
k = n - 1;
k != idx_t(-1); --
k) {
264 for (idx_t j =
k + 1; j < n; ++j) {
266 for (idx_t i = 0; i < m; ++i)
273 for (idx_t i = 0; i < m; ++i)
282#ifdef TLAPACK_USE_LAPACKPP
303 class T = type_t<matrixB_t>,
304 enable_if_allow_optblas_t<pair<matrixA_t, T>,
306 pair<alpha_t, T> > = 0>
316 auto A_ = legacy_matrix(A);
317 auto B_ = legacy_matrix(B);
320 constexpr Layout L = layout<matrixB_t>;
321 const auto& m = B_.m;
322 const auto& n = B_.n;
325 if (alpha == alpha_t(0))
327 -5,
"Infs and NaNs in A or B will not propagate to B on output");
329 return ::blas::trmm((::blas::Layout)L, (::blas::Side)side,
330 (::blas::Uplo)uplo, (::blas::Op)trans,
331 (::blas::Diag)diag, m, n, alpha, A_.ptr, A_.ldim,
Diag
Definition types.hpp:197
Side
Definition types.hpp:271
Op
Definition types.hpp:227
Uplo
Definition types.hpp:50
constexpr T conj(const T &x) noexcept
Extends std::conj() to real datatypes.
Definition utils.hpp:100
#define TLAPACK_SCALAR
Macro for tlapack::concepts::Scalar compatible with C++17.
Definition concepts.hpp:915
#define TLAPACK_LEGACY_MATRIX
Macro for tlapack::concepts::LegacyMatrix compatible with C++17.
Definition concepts.hpp:951
#define TLAPACK_MATRIX
Macro for tlapack::concepts::Matrix compatible with C++17.
Definition concepts.hpp:896
constexpr auto diag(T &A, int diagIdx=0) noexcept
Get the Diagonal of an Eigen Matrix.
Definition eigen.hpp:576
void trmm(Side side, Uplo uplo, Op trans, Diag diag, const alpha_t &alpha, const matrixA_t &A, matrixB_t &B)
Triangular matrix-matrix multiply:
Definition trmm.hpp:72
#define tlapack_check_false(cond)
Throw an error if cond is true.
Definition exceptionHandling.hpp:113
#define tlapack_warning(info, detailedInfo)
Warning handler.
Definition exceptionHandling.hpp:156
Concept for types that represent tlapack::Diag.
Concept for types that represent tlapack::Op.
Concept for types that represent tlapack::Side.
Concept for types that represent tlapack::Uplo.
typename traits::real_type_traits< Types..., int >::type real_type
The common real type of the list of types.
Definition scalar_type_traits.hpp:113