Blaze 3.9
unglq.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_LAPACK_CLAPACK_UNGLQ_H_
36#define _BLAZE_MATH_LAPACK_CLAPACK_UNGLQ_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 cunglq_( blaze::blas_int_t* m, blaze::blas_int_t* n, blaze::blas_int_t* k, float* A,
60 blaze::blas_int_t* lda, float* tau, float* work, blaze::blas_int_t* lwork,
61 blaze::blas_int_t* info );
62void zunglq_( blaze::blas_int_t* m, blaze::blas_int_t* n, blaze::blas_int_t* k, double* A,
63 blaze::blas_int_t* lda, double* tau, double* work, blaze::blas_int_t* lwork,
64 blaze::blas_int_t* info );
65
66}
67#endif
69//*************************************************************************************************
70
71
72
73
74namespace blaze {
75
76//=================================================================================================
77//
78// LAPACK FUNCTIONS TO RECONSTRUCT Q FROM A LQ DECOMPOSITION (UNGLQ)
79//
80//=================================================================================================
81
82//*************************************************************************************************
86 blas_int_t lda, const complex<float>* tau, complex<float>* work,
87 blas_int_t lwork, blas_int_t* info );
88
90 blas_int_t lda, const complex<double>* tau, complex<double>* work,
91 blas_int_t lwork, blas_int_t* info );
93//*************************************************************************************************
94
95
96//*************************************************************************************************
127inline void unglq( blas_int_t m, blas_int_t n, blas_int_t k, complex<float>* A,
128 blas_int_t lda, const complex<float>* tau, complex<float>* work,
129 blas_int_t lwork, blas_int_t* info )
130{
131 BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
132
133#if defined(INTEL_MKL_VERSION)
134 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
135 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex8 ) == sizeof( complex<float> ) );
136 using ET = MKL_Complex8;
137#else
138 using ET = float;
139#endif
140
141 cunglq_( &m, &n, &k, reinterpret_cast<ET*>( A ), &lda,
142 const_cast<ET*>( reinterpret_cast<const ET*>( tau ) ),
143 reinterpret_cast<ET*>( work ), &lwork, info );
144}
145//*************************************************************************************************
146
147
148//*************************************************************************************************
179inline void unglq( blas_int_t m, blas_int_t n, blas_int_t k, complex<double>* A,
180 blas_int_t lda, const complex<double>* tau, complex<double>* work,
181 blas_int_t lwork, blas_int_t* info )
182{
183 BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
184
185#if defined(INTEL_MKL_VERSION)
186 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
187 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex16 ) == sizeof( complex<double> ) );
188 using ET = MKL_Complex16;
189#else
190 using ET = double;
191#endif
192
193 zunglq_( &m, &n, &k, reinterpret_cast<ET*>( A ), &lda,
194 const_cast<ET*>( reinterpret_cast<const ET*>( tau ) ),
195 reinterpret_cast<ET*>( work ), &lwork, info );
196}
197//*************************************************************************************************
198
199} // namespace blaze
200
201#endif
Header file for the complex data type.
Compile time assertion.
Complex data type of the Blaze library.
void unglq(DenseMatrix< MT, SO > &A, const ElementType_t< MT > *tau)
LAPACK kernel for the reconstruction of the orthogonal matrix Q from a LQ decomposition.
Definition: unglq.h:120
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.