Blaze 3.9
ungl2.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_LAPACK_CLAPACK_UNGL2_H_
36#define _BLAZE_MATH_LAPACK_CLAPACK_UNGL2_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 cungl2_( 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* info );
61void zungl2_( blaze::blas_int_t* m, blaze::blas_int_t* n, blaze::blas_int_t* k, double* A,
62 blaze::blas_int_t* lda, double* tau, double* work, blaze::blas_int_t* info );
63
64}
65#endif
67//*************************************************************************************************
68
69
70
71
72namespace blaze {
73
74//=================================================================================================
75//
76// LAPACK FUNCTIONS TO RECONSTRUCT Q FROM A LQ DECOMPOSITION (UNGL2)
77//
78//=================================================================================================
79
80//*************************************************************************************************
84 const complex<float>* tau, complex<float>* work, blas_int_t* info );
85
87 const complex<double>* tau, complex<double>* work, blas_int_t* info );
89//*************************************************************************************************
90
91
92//*************************************************************************************************
122inline void ungl2( blas_int_t m, blas_int_t n, blas_int_t k, complex<float>* A, blas_int_t lda,
123 const complex<float>* tau, complex<float>* work, blas_int_t* 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( blas_int_t ) );
129 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex8 ) == sizeof( complex<float> ) );
130 using ET = MKL_Complex8;
131#else
132 using ET = float;
133#endif
134
135 cungl2_( &m, &n, &k, reinterpret_cast<ET*>( A ), &lda,
136 const_cast<ET*>( reinterpret_cast<const ET*>( tau ) ),
137 reinterpret_cast<ET*>( work ), info );
138}
139//*************************************************************************************************
140
141
142//*************************************************************************************************
172inline void ungl2( blas_int_t m, blas_int_t n, blas_int_t k, complex<double>* A, blas_int_t lda,
173 const complex<double>* tau, complex<double>* work, blas_int_t* 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( blas_int_t ) );
179 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex16 ) == sizeof( complex<double> ) );
180 using ET = MKL_Complex16;
181#else
182 using ET = double;
183#endif
184
185 zungl2_( &m, &n, &k, reinterpret_cast<ET*>( A ), &lda,
186 const_cast<ET*>( reinterpret_cast<const ET*>( tau ) ),
187 reinterpret_cast<ET*>( work ), info );
188}
189//*************************************************************************************************
190
191} // namespace blaze
192
193#endif
Header file for the complex data type.
Compile time assertion.
Complex data type of the Blaze library.
void ungl2(DenseMatrix< MT, SO > &A, const ElementType_t< MT > *tau)
LAPACK kernel for the reconstruction of the orthogonal matrix Q from a LQ decomposition.
Definition: ungl2.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.