Blaze  3.6
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,
59  float* work, int* lwork, int* info );
60 void zungrq_( int* m, int* n, int* k, double* A, int* lda, double* tau,
61  double* work, int* lwork, int* info );
62 
63 }
64 #endif
65 
66 //*************************************************************************************************
67 
68 
69 
70 
71 namespace blaze {
72 
73 //=================================================================================================
74 //
75 // LAPACK FUNCTIONS TO RECONSTRUCT Q FROM A RQ DECOMPOSITION (UNGRQ)
76 //
77 //=================================================================================================
78 
79 //*************************************************************************************************
82 void ungrq( int m, int n, int k, complex<float>* A, int lda, const complex<float>* tau,
83  complex<float>* work, int lwork, int* info );
84 
85 void ungrq( int m, int n, int k, complex<double>* A, int lda, const complex<double>* tau,
86  complex<double>* work, int lwork, int* info );
88 //*************************************************************************************************
89 
90 
91 //*************************************************************************************************
122 inline void ungrq( int m, int n, int k, complex<float>* A, int lda, const complex<float>* tau,
123  complex<float>* work, int lwork, int* info )
124 {
125  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
126 
127 #if defined(INTEL_MKL_VERSION)
128  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
129  using ET = MKL_Complex8;
130 #else
131  using ET = float;
132 #endif
133 
134  cungrq_( &m, &n, &k, reinterpret_cast<ET*>( A ), &lda,
135  const_cast<ET*>( reinterpret_cast<const ET*>( tau ) ),
136  reinterpret_cast<ET*>( work ), &lwork, info );
137 }
138 //*************************************************************************************************
139 
140 
141 //*************************************************************************************************
172 inline void ungrq( int m, int n, int k, complex<double>* A, int lda, const complex<double>* tau,
173  complex<double>* work, int lwork, int* info )
174 {
175  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
176 
177 #if defined(INTEL_MKL_VERSION)
178  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
179  using ET = MKL_Complex16;
180 #else
181  using ET = double;
182 #endif
183 
184  zungrq_( &m, &n, &k, reinterpret_cast<ET*>( A ), &lda,
185  const_cast<ET*>( reinterpret_cast<const ET*>( tau ) ),
186  reinterpret_cast<ET*>( work ), &lwork, info );
187 }
188 //*************************************************************************************************
189 
190 } // namespace blaze
191 
192 #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:122
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