Blaze 3.9
geqrf.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_LAPACK_CLAPACK_GEQRF_H_
36#define _BLAZE_MATH_LAPACK_CLAPACK_GEQRF_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
44#include <blaze/util/Complex.h>
46
47
48//=================================================================================================
49//
50// LAPACK FORWARD DECLARATIONS
51//
52//=================================================================================================
53
54//*************************************************************************************************
56#if !defined(INTEL_MKL_VERSION)
57extern "C" {
58
59void sgeqrf_( blaze::blas_int_t* m, blaze::blas_int_t* n, float* A, blaze::blas_int_t* lda,
60 float* tau, float* work, blaze::blas_int_t* lwork, blaze::blas_int_t* info );
61void dgeqrf_( blaze::blas_int_t* m, blaze::blas_int_t* n, double* A, blaze::blas_int_t* lda,
62 double* tau, double* work, blaze::blas_int_t* lwork, blaze::blas_int_t* info );
63void cgeqrf_( blaze::blas_int_t* m, blaze::blas_int_t* n, float* A, blaze::blas_int_t* lda,
64 float* tau, float* work, blaze::blas_int_t* lwork, blaze::blas_int_t* info );
65void zgeqrf_( blaze::blas_int_t* m, blaze::blas_int_t* n, double* A, blaze::blas_int_t* lda,
66 double* tau, double* work, blaze::blas_int_t* lwork, blaze::blas_int_t* info );
67
68}
69#endif
71//*************************************************************************************************
72
73
74
75
76namespace blaze {
77
78//=================================================================================================
79//
80// LAPACK QR DECOMPOSITION FUNCTIONS (GEQRF)
81//
82//=================================================================================================
83
84//*************************************************************************************************
87void geqrf( blas_int_t m, blas_int_t n, float* A, blas_int_t lda,
88 float* tau, float* work, blas_int_t lwork, blas_int_t* info );
89
90void geqrf( blas_int_t m, blas_int_t n, double* A, blas_int_t lda,
91 double* tau, double* work, blas_int_t lwork, blas_int_t* info );
92
94 complex<float>* tau, complex<float>* work, blas_int_t lwork, blas_int_t* info );
95
97 complex<double>* tau, complex<double>* work, blas_int_t lwork, blas_int_t* info );
99//*************************************************************************************************
100
101
102//*************************************************************************************************
151inline void geqrf( blas_int_t m, blas_int_t n, float* A, blas_int_t lda,
152 float* tau, float* work, blas_int_t lwork, blas_int_t* info )
153{
154#if defined(INTEL_MKL_VERSION)
155 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
156#endif
157
158 sgeqrf_( &m, &n, A, &lda, tau, work, &lwork, info );
159}
160//*************************************************************************************************
161
162
163//*************************************************************************************************
212inline void geqrf( blas_int_t m, blas_int_t n, double* A, blas_int_t lda,
213 double* tau, double* work, blas_int_t lwork, blas_int_t* info )
214{
215#if defined(INTEL_MKL_VERSION)
216 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
217#endif
218
219 dgeqrf_( &m, &n, A, &lda, tau, work, &lwork, info );
220}
221//*************************************************************************************************
222
223
224//*************************************************************************************************
273inline void geqrf( blas_int_t m, blas_int_t n, complex<float>* A, blas_int_t lda,
274 complex<float>* tau, complex<float>* work, blas_int_t lwork, blas_int_t* info )
275{
276 BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
277
278#if defined(INTEL_MKL_VERSION)
279 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
280 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex8 ) == sizeof( complex<float> ) );
281 using ET = MKL_Complex8;
282#else
283 using ET = float;
284#endif
285
286 cgeqrf_( &m, &n, reinterpret_cast<ET*>( A ), &lda, reinterpret_cast<ET*>( tau ),
287 reinterpret_cast<ET*>( work ), &lwork, info );
288}
289//*************************************************************************************************
290
291
292//*************************************************************************************************
341inline void geqrf( blas_int_t m, blas_int_t n, complex<double>* A, blas_int_t lda,
342 complex<double>* tau, complex<double>* work, blas_int_t lwork, blas_int_t* info )
343{
344 BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
345
346#if defined(INTEL_MKL_VERSION)
347 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
348 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex16 ) == sizeof( complex<double> ) );
349 using ET = MKL_Complex16;
350#else
351 using ET = double;
352#endif
353
354 zgeqrf_( &m, &n, reinterpret_cast<ET*>( A ), &lda, reinterpret_cast<ET*>( tau ),
355 reinterpret_cast<ET*>( work ), &lwork, info );
356}
357//*************************************************************************************************
358
359} // namespace blaze
360
361#endif
Header file for the complex data type.
Compile time assertion.
Complex data type of the Blaze library.
void geqrf(DenseMatrix< MT, SO > &A, ElementType_t< MT > *tau)
LAPACK kernel for the QR decomposition of the given dense matrix.
Definition: geqrf.h:118
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
Header file for basic BLAS type definitions.