Blaze 3.9
trmv.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_BLAS_TRMV_H_
36#define _BLAZE_MATH_BLAS_TRMV_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <blaze/math/Aliases.h>
52#include <blaze/system/BLAS.h>
53#include <blaze/util/Assert.h>
55
56
57namespace blaze {
58
59//=================================================================================================
60//
61// BLAS TRIANGULAR MATRIX/VECTOR MULTIPLICATION FUNCTIONS (TRMV)
62//
63//=================================================================================================
64
65//*************************************************************************************************
68#if BLAZE_BLAS_MODE
69
70template< typename VT, typename MT, bool SO >
71void trmv( DenseVector<VT,false>& x, const DenseMatrix<MT,SO>& A, CBLAS_UPLO uplo );
72
73template< typename VT, typename MT, bool SO >
74void trmv( DenseVector<VT,true>& x, const DenseMatrix<MT,SO>& A, CBLAS_UPLO uplo );
75
76#endif
78//*************************************************************************************************
79
80
81//*************************************************************************************************
82#if BLAZE_BLAS_MODE
101template< typename VT // Type of the target vector
102 , typename MT // Type of the matrix operand
103 , bool SO > // Storage order of the matrix operand
104inline void trmv( DenseVector<VT,false>& x, const DenseMatrix<MT,SO>& A, CBLAS_UPLO uplo )
105{
108
111
114
115 BLAZE_INTERNAL_ASSERT( (*A).rows() == (*A).columns(), "Non-square triangular matrix detected" );
116 BLAZE_INTERNAL_ASSERT( uplo == CblasLower || uplo == CblasUpper, "Invalid uplo argument detected" );
117
118 const blas_int_t n ( numeric_cast<blas_int_t>( (*A).rows() ) );
119 const blas_int_t lda( numeric_cast<blas_int_t>( (*A).spacing() ) );
120
121 trmv( ( IsRowMajorMatrix_v<MT> )?( CblasRowMajor ):( CblasColMajor ),
122 uplo, CblasNoTrans, CblasNonUnit, n, (*A).data(), lda, (*x).data(), 1 );
123}
124#endif
125//*************************************************************************************************
126
127
128//*************************************************************************************************
129#if BLAZE_BLAS_MODE
148template< typename VT // Type of the target vector
149 , typename MT // Type of the matrix operand
150 , bool SO > // Storage order of the matrix operand
151inline void trmv( DenseVector<VT,true>& x, const DenseMatrix<MT,SO>& A, CBLAS_UPLO uplo )
152{
155
158
161
162 BLAZE_INTERNAL_ASSERT( (*A).rows() == (*A).columns(), "Non-square triangular matrix detected" );
163 BLAZE_INTERNAL_ASSERT( uplo == CblasLower || uplo == CblasUpper, "Invalid uplo argument detected" );
164
165 const blas_int_t n ( numeric_cast<blas_int_t>( (*A).rows() ) );
166 const blas_int_t lda( numeric_cast<blas_int_t>( (*A).spacing() ) );
167
168 trmv( ( IsRowMajorMatrix_v<MT> )?( CblasRowMajor ):( CblasColMajor ),
169 uplo, CblasTrans, CblasNonUnit, n, (*A).data(), lda, (*x).data(), 1 );
170}
171#endif
172//*************************************************************************************************
173
174} // namespace blaze
175
176#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 trmv wrapper functions.
Constraint on the data type.
Header file for the DenseMatrix base class.
Header file for the DenseVector 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.