Blaze 3.9
trmm.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_BLAS_TRMM_H_
36#define _BLAZE_MATH_BLAS_TRMM_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <blaze/math/Aliases.h>
51#include <blaze/system/BLAS.h>
52#include <blaze/util/Assert.h>
54
55
56namespace blaze {
57
58//=================================================================================================
59//
60// BLAS TRIANGULAR MATRIX MULTIPLICATION FUNCTIONS (TRMM)
61//
62//=================================================================================================
63
64//*************************************************************************************************
67#if BLAZE_BLAS_MODE
68
69template< typename MT1, bool SO1, typename MT2, bool SO2, typename ST >
70void trmm( DenseMatrix<MT1,SO1>& B, const DenseMatrix<MT2,SO2>& A,
71 CBLAS_SIDE side, CBLAS_UPLO uplo, ST alpha );
72
73#endif
75//*************************************************************************************************
76
77
78//*************************************************************************************************
79#if BLAZE_BLAS_MODE
101template< typename MT1 // Type of the target matrix
102 , bool SO1 // Storage order of the target matrix
103 , typename MT2 // Type of the left-hand side matrix operand
104 , bool SO2 // Storage order of the left-hand side matrix operand
105 , typename ST > // Type of the scalar factor
106inline void trmm( DenseMatrix<MT1,SO1>& B, const DenseMatrix<MT2,SO2>& A,
107 CBLAS_SIDE side, CBLAS_UPLO uplo, ST alpha )
108{
111
114
117
118 BLAZE_INTERNAL_ASSERT( (*A).rows() == (*A).columns(), "Non-square triangular matrix detected" );
119 BLAZE_INTERNAL_ASSERT( side == CblasLeft || side == CblasRight, "Invalid side argument detected" );
120 BLAZE_INTERNAL_ASSERT( uplo == CblasLower || uplo == CblasUpper, "Invalid uplo argument detected" );
121
122 const blas_int_t m ( numeric_cast<blas_int_t>( (*B).rows() ) );
123 const blas_int_t n ( numeric_cast<blas_int_t>( (*B).columns() ) );
124 const blas_int_t lda( numeric_cast<blas_int_t>( (*A).spacing() ) );
125 const blas_int_t ldb( numeric_cast<blas_int_t>( (*B).spacing() ) );
126
127 trmm( ( IsRowMajorMatrix_v<MT1> )?( CblasRowMajor ):( CblasColMajor ),
128 side,
129 ( SO1 == SO2 )?( uplo ):( ( uplo == CblasLower )?( CblasUpper ):( CblasLower ) ),
130 ( SO1 == SO2 )?( CblasNoTrans ):( CblasTrans ),
131 CblasNonUnit,
132 m, n, alpha, (*A).data(), lda, (*B).data(), ldb );
133}
134#endif
135//*************************************************************************************************
136
137} // namespace blaze
138
139#endif
Header file for auxiliary alias declarations.
Header file for run time assertion macros.
Constraint on the data type.
Constraint on the data type.
Header file for the IsRowMajorMatrix type trait.
Constraint on the data type.
Cast operators for numeric types.
Header file for the CBLAS trmm wrapper functions.
Constraint on the data type.
Header file for the DenseMatrix base class.
#define BLAZE_CONSTRAINT_MUST_BE_BLAS_COMPATIBLE_TYPE(T)
Constraint on the data type.
Definition: BLASCompatible.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.
Definition: Computation.h:81
#define BLAZE_CONSTRAINT_MUST_HAVE_MUTABLE_DATA_ACCESS(T)
Constraint on the data type.
Definition: MutableDataAccess.h:61
#define BLAZE_CONSTRAINT_MUST_HAVE_CONST_DATA_ACCESS(T)
Constraint on the data type.
Definition: ConstDataAccess.h:61
int32_t blas_int_t
Signed integer type used in the BLAS/LAPACK wrapper functions.
Definition: Types.h:64
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
System settings for the BLAS mode.