Blaze  3.6
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 
43 #include <blaze/util/Complex.h>
45 
46 
47 //=================================================================================================
48 //
49 // LAPACK FORWARD DECLARATIONS
50 //
51 //=================================================================================================
52 
53 //*************************************************************************************************
55 #if !defined(INTEL_MKL_VERSION)
56 extern "C" {
57 
58 void sgeqrf_( int* m, int* n, float* A, int* lda, float* tau, float* work, int* lwork, int* info );
59 void dgeqrf_( int* m, int* n, double* A, int* lda, double* tau, double* work, int* lwork, int* info );
60 void cgeqrf_( int* m, int* n, float* A, int* lda, float* tau, float* work, int* lwork, int* info );
61 void zgeqrf_( int* m, int* n, double* A, int* lda, double* tau, double* work, int* lwork, int* info );
62 
63 }
64 #endif
65 
66 //*************************************************************************************************
67 
68 
69 
70 
71 namespace blaze {
72 
73 //=================================================================================================
74 //
75 // LAPACK QR DECOMPOSITION FUNCTIONS (GEQRF)
76 //
77 //=================================================================================================
78 
79 //*************************************************************************************************
82 void geqrf( int m, int n, float* A, int lda, float* tau,
83  float* work, int lwork, int* info );
84 
85 void geqrf( int m, int n, double* A, int lda, double* tau,
86  double* work, int lwork, int* info );
87 
88 void geqrf( int m, int n, complex<float>* A, int lda, complex<float>* tau,
89  complex<float>* work, int lwork, int* info );
90 
91 void geqrf( int m, int n, complex<double>* A, int lda, complex<double>* tau,
92  complex<double>* work, int lwork, int* info );
94 //*************************************************************************************************
95 
96 
97 //*************************************************************************************************
146 inline void geqrf( int m, int n, float* A, int lda, float* tau,
147  float* work, int lwork, int* info )
148 {
149 #if defined(INTEL_MKL_VERSION)
150  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
151 #endif
152 
153  sgeqrf_( &m, &n, A, &lda, tau, work, &lwork, info );
154 }
155 //*************************************************************************************************
156 
157 
158 //*************************************************************************************************
207 inline void geqrf( int m, int n, double* A, int lda, double* tau,
208  double* work, int lwork, int* info )
209 {
210 #if defined(INTEL_MKL_VERSION)
211  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
212 #endif
213 
214  dgeqrf_( &m, &n, A, &lda, tau, work, &lwork, info );
215 }
216 //*************************************************************************************************
217 
218 
219 //*************************************************************************************************
268 inline void geqrf( int m, int n, complex<float>* A, int lda, complex<float>* tau,
269  complex<float>* work, int lwork, int* info )
270 {
271  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
272 
273 #if defined(INTEL_MKL_VERSION)
274  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
275  using ET = MKL_Complex8;
276 #else
277  using ET = float;
278 #endif
279 
280  cgeqrf_( &m, &n, reinterpret_cast<ET*>( A ), &lda, reinterpret_cast<ET*>( tau ),
281  reinterpret_cast<ET*>( work ), &lwork, info );
282 }
283 //*************************************************************************************************
284 
285 
286 //*************************************************************************************************
335 inline void geqrf( int m, int n, complex<double>* A, int lda, complex<double>* tau,
336  complex<double>* work, int lwork, int* info )
337 {
338  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
339 
340 #if defined(INTEL_MKL_VERSION)
341  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
342  using ET = MKL_Complex16;
343 #else
344  using ET = double;
345 #endif
346 
347  zgeqrf_( &m, &n, reinterpret_cast<ET*>( A ), &lda, reinterpret_cast<ET*>( tau ),
348  reinterpret_cast<ET*>( work ), &lwork, info );
349 }
350 //*************************************************************************************************
351 
352 } // namespace blaze
353 
354 #endif
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Compile time assertion.
void geqrf(int m, int n, float *A, int lda, float *tau, float *work, int lwork, int *info)
LAPACK kernel for the QR decomposition of the given dense single precision column-major matrix.
Definition: geqrf.h:146
Header file for the complex data type.
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:112