Blaze 3.9
gemv.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_BLAS_GEMV_H_
36#define _BLAZE_MATH_BLAS_GEMV_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <blaze/math/Aliases.h>
54
55
56namespace blaze {
57
58//=================================================================================================
59//
60// BLAS GENERAL MATRIX/VECTOR MULTIPLICATION FUNCTIONS (GEMV)
61//
62//=================================================================================================
63
64//*************************************************************************************************
67#if BLAZE_BLAS_MODE
68
69template< typename VT1, typename MT1, bool SO, typename VT2, typename ST >
70void gemv( DenseVector<VT1,false>& y, const DenseMatrix<MT1,SO>& A,
71 const DenseVector<VT2,false>& x, ST alpha, ST beta );
72
73template< typename VT1, typename VT2, typename MT1, bool SO, typename ST >
74void gemv( DenseVector<VT1,true>& y, const DenseVector<VT2,true>& x,
75 const DenseMatrix<MT1,SO>& A, ST alpha, ST beta );
76
77#endif
79//*************************************************************************************************
80
81
82//*************************************************************************************************
83#if BLAZE_BLAS_MODE
104template< typename VT1 // Type of the left-hand side target vector
105 , typename MT1 // Type of the left-hand side matrix operand
106 , bool SO // Storage order of the left-hand side matrix operand
107 , typename VT2 // Type of the right-hand side vector operand
108 , typename ST > // Type of the scalar factors
109inline void gemv( DenseVector<VT1,false>& y, const DenseMatrix<MT1,SO>& A,
110 const DenseVector<VT2,false>& x, ST alpha, ST beta )
111{
115
119
123
124 const blas_int_t m ( numeric_cast<blas_int_t>( (*A).rows() ) );
125 const blas_int_t n ( numeric_cast<blas_int_t>( (*A).columns() ) );
126 const blas_int_t lda( numeric_cast<blas_int_t>( (*A).spacing() ) );
127
128 gemv( ( SO )?( CblasColMajor ):( CblasRowMajor ), CblasNoTrans, m, n, alpha,
129 (*A).data(), lda, (*x).data(), 1, beta, (*y).data(), 1 );
130}
131#endif
132//*************************************************************************************************
133
134
135//*************************************************************************************************
136#if BLAZE_BLAS_MODE
157template< typename VT1 // Type of the left-hand side target vector
158 , typename VT2 // Type of the left-hand side vector operand
159 , typename MT1 // Type of the right-hand side matrix operand
160 , bool SO // Storage order of the right-hand side matrix operand
161 , typename ST > // Type of the scalar factors
162inline void gemv( DenseVector<VT1,true>& y, const DenseVector<VT2,true>& x,
163 const DenseMatrix<MT1,SO>& A, ST alpha, ST beta )
164{
168
172
176
177 const blas_int_t m ( numeric_cast<blas_int_t>( (*A).rows() ) );
178 const blas_int_t n ( numeric_cast<blas_int_t>( (*A).columns() ) );
179 const blas_int_t lda( numeric_cast<blas_int_t>( (*A).spacing() ) );
180
181 gemv( ( SO )?( CblasColMajor ):( CblasRowMajor ), CblasTrans, m, n, alpha,
182 (*A).data(), lda, (*x).data(), 1, beta, (*y).data(), 1 );
183}
184#endif
185//*************************************************************************************************
186
187} // namespace blaze
188
189#endif
Header file for auxiliary alias declarations.
Constraint on the data type.
Constraint on the data type.
Header file for the IsRowMajorMatrix type trait.
Deactivation of problematic macros.
Constraint on the data type.
Cast operators for numeric types.
Header file for the CBLAS gemv 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