Blaze 3.9
unmqr.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_LAPACK_CLAPACK_UNMQR_H_
36#define _BLAZE_MATH_LAPACK_CLAPACK_UNMQR_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
44#include <blaze/util/Complex.h>
46#include <blaze/util/Types.h>
47
48
49//=================================================================================================
50//
51// LAPACK FORWARD DECLARATIONS
52//
53//=================================================================================================
54
55//*************************************************************************************************
57#if !defined(INTEL_MKL_VERSION)
58extern "C" {
59
60void cunmqr_( char* side, char* trans, blaze::blas_int_t* m, blaze::blas_int_t* n,
61 blaze::blas_int_t* k, float* A, blaze::blas_int_t* lda, float* tau, float* C,
62 blaze::blas_int_t* ldc, float* work, blaze::blas_int_t* lwork, blaze::blas_int_t* info,
64void zunmqr_( char* side, char* trans, blaze::blas_int_t* m, blaze::blas_int_t* n,
65 blaze::blas_int_t* k, double* A, blaze::blas_int_t* lda, double* tau, double* C,
66 blaze::blas_int_t* ldc, double* work, blaze::blas_int_t* lwork, blaze::blas_int_t* info,
68
69}
70#endif
72//*************************************************************************************************
73
74
75
76
77namespace blaze {
78
79//=================================================================================================
80//
81// LAPACK FUNCTIONS TO MULTIPLY Q FROM A QR DECOMPOSITION WITH A MATRIX (UNMQR)
82//
83//=================================================================================================
84
85//*************************************************************************************************
88void unmqr( char side, char trans, blas_int_t m, blas_int_t n,
89 blas_int_t k, const complex<float>* A, blas_int_t lda,
90 const complex<float>* tau, complex<float>* C, blas_int_t ldc,
91 complex<float>* work, blas_int_t lwork, blas_int_t* info );
92
93void unmqr( char side, char trans, blas_int_t m, blas_int_t n,
94 blas_int_t k, const complex<double>* A, blas_int_t lda,
95 const complex<double>* tau, complex<double>* C, blas_int_t ldc,
96 complex<double>* work, blas_int_t lwork, blas_int_t* info );
98//*************************************************************************************************
99
100
101//*************************************************************************************************
148inline void unmqr( char side, char trans, blas_int_t m, blas_int_t n,
149 blas_int_t k, const complex<float>* A, blas_int_t lda,
150 const complex<float>* tau, complex<float>* C, blas_int_t ldc,
151 complex<float>* work, blas_int_t lwork, blas_int_t* info )
152{
153 BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
154
155#if defined(INTEL_MKL_VERSION)
156 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
157 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex8 ) == sizeof( complex<float> ) );
158 using ET = MKL_Complex8;
159#else
160 using ET = float;
161#endif
162
163 cunmqr_( &side, &trans, &m, &n, &k,
164 const_cast<ET*>( reinterpret_cast<const ET*>( A ) ), &lda,
165 const_cast<ET*>( reinterpret_cast<const ET*>( tau ) ),
166 reinterpret_cast<ET*>( C ), &ldc, reinterpret_cast<ET*>( work ),
167 &lwork, info
168#if !defined(INTEL_MKL_VERSION)
170#endif
171 );
172}
173//*************************************************************************************************
174
175
176//*************************************************************************************************
223inline void unmqr( char side, char trans, blas_int_t m, blas_int_t n,
224 blas_int_t k, const complex<double>* A, blas_int_t lda,
225 const complex<double>* tau, complex<double>* C, blas_int_t ldc,
226 complex<double>* work, blas_int_t lwork, blas_int_t* info )
227{
228 BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
229
230#if defined(INTEL_MKL_VERSION)
231 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
232 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex16 ) == sizeof( complex<double> ) );
233 using ET = MKL_Complex16;
234#else
235 using ET = double;
236#endif
237
238 zunmqr_( &side, &trans, &m, &n, &k,
239 const_cast<ET*>( reinterpret_cast<const ET*>( A ) ), &lda,
240 const_cast<ET*>( reinterpret_cast<const ET*>( tau ) ),
241 reinterpret_cast<ET*>( C ), &ldc, reinterpret_cast<ET*>( work ),
242 &lwork, info
243#if !defined(INTEL_MKL_VERSION)
245#endif
246 );
247}
248//*************************************************************************************************
249
250} // namespace blaze
251
252#endif
Header file for the complex data type.
Compile time assertion.
Complex data type of the Blaze library.
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:766
void unmqr(DenseMatrix< MT1, SO > &C, DenseMatrix< MT2, SO > &A, char side, char trans, ElementType_t< MT2 > *tau)
LAPACK kernel for the multiplication of the double precision Q from a QR decomposition with another m...
Definition: unmqr.h:144
int32_t blas_int_t
Signed integer type used in the BLAS/LAPACK wrapper functions.
Definition: Types.h:64
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.
Definition: StaticAssert.h:112
size_t fortran_charlen_t
Type of the hidden arguments of character type within a Fortran forward declaration.
Definition: Types.h:186
Header file for basic BLAS type definitions.
Header file for basic type definitions.