ungrq.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_LAPACK_CLAPACK_UNGRQ_H_
36 #define _BLAZE_MATH_LAPACK_CLAPACK_UNGRQ_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 cungrq_( int* m, int* n, int* k, float* A, int* lda, float* tau, float* work, int* lwork, int* info );
59 void zungrq_( int* m, int* n, int* k, double* A, int* lda, double* tau, double* work, int* lwork, int* info );
60 
61 }
62 #endif
63 
64 //*************************************************************************************************
65 
66 
67 
68 
69 namespace blaze {
70 
71 //=================================================================================================
72 //
73 // LAPACK FUNCTIONS TO RECONSTRUCT Q FROM A RQ DECOMPOSITION (UNGRQ)
74 //
75 //=================================================================================================
76 
77 //*************************************************************************************************
80 inline void ungrq( int m, int n, int k, complex<float>* A, int lda, const complex<float>* tau,
81  complex<float>* work, int lwork, int* info );
82 
83 inline void ungrq( int m, int n, int k, complex<double>* A, int lda, const complex<double>* tau,
84  complex<double>* work, int lwork, int* info );
86 //*************************************************************************************************
87 
88 
89 //*************************************************************************************************
120 inline void ungrq( int m, int n, int k, complex<float>* A, int lda, const complex<float>* tau,
121  complex<float>* work, int lwork, int* info )
122 {
123  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
124 
125 #if defined(INTEL_MKL_VERSION)
126  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
127  using ET = MKL_Complex8;
128 #else
129  using ET = float;
130 #endif
131 
132  cungrq_( &m, &n, &k, reinterpret_cast<ET*>( A ), &lda,
133  const_cast<ET*>( reinterpret_cast<const ET*>( tau ) ),
134  reinterpret_cast<ET*>( work ), &lwork, info );
135 }
136 //*************************************************************************************************
137 
138 
139 //*************************************************************************************************
170 inline void ungrq( int m, int n, int k, complex<double>* A, int lda, const complex<double>* tau,
171  complex<double>* work, int lwork, int* info )
172 {
173  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
174 
175 #if defined(INTEL_MKL_VERSION)
176  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
177  using ET = MKL_Complex16;
178 #else
179  using ET = double;
180 #endif
181 
182  zungrq_( &m, &n, &k, reinterpret_cast<ET*>( A ), &lda,
183  const_cast<ET*>( reinterpret_cast<const ET*>( tau ) ),
184  reinterpret_cast<ET*>( work ), &lwork, info );
185 }
186 //*************************************************************************************************
187 
188 } // namespace blaze
189 
190 #endif
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Compile time assertion.
void ungrq(int m, int n, int k, complex< float > *A, int lda, const complex< float > *tau, complex< float > *work, int lwork, int *info)
LAPACK kernel for the reconstruction of the orthogonal matrix Q from a RQ decomposition.
Definition: ungrq.h:120
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