Blaze  3.6
heev.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_LAPACK_CLAPACK_HEEV_H_
36 #define _BLAZE_MATH_LAPACK_CLAPACK_HEEV_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/util/Complex.h>
45 #include <blaze/util/Types.h>
46 
47 
48 //=================================================================================================
49 //
50 // LAPACK FORWARD DECLARATIONS
51 //
52 //=================================================================================================
53 
54 //*************************************************************************************************
56 #if !defined(INTEL_MKL_VERSION)
57 extern "C" {
58 
59 void cheev_( char* jobz, char* uplo, int* n, float* A, int* lda, float* w,
60  float* work, int* lwork, float* rwork, int* info,
62 void zheev_( char* jobz, char* uplo, int* n, double* A, int* lda, double* w,
63  double* work, int* lwork, double* rwork, int* info,
65 
66 }
67 #endif
68 
69 //*************************************************************************************************
70 
71 
72 
73 
74 namespace blaze {
75 
76 //=================================================================================================
77 //
78 // LAPACK HERMITIAN MATRIX EIGENVALUE FUNCTIONS (HEEV)
79 //
80 //=================================================================================================
81 
82 //*************************************************************************************************
85 void heev( char jobz, char uplo, int n, complex<float>* A, int lda,
86  float* w, complex<float>* work, int lwork, float* rwork, int* info );
87 
88 void heev( char jobz, char uplo, int n, complex<double>* A, int lda,
89  double* w, complex<double>* work, int lwork, double* rwork, int* info );
91 //*************************************************************************************************
92 
93 
94 //*************************************************************************************************
135 inline void heev( char jobz, char uplo, int n, complex<float>* A, int lda,
136  float* w, complex<float>* work, int lwork, float* rwork, int* info )
137 {
138  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
139 
140 #if defined(INTEL_MKL_VERSION)
141  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
142  using ET = MKL_Complex8;
143 #else
144  using ET = float;
145 #endif
146 
147  cheev_( &jobz, &uplo, &n, reinterpret_cast<ET*>( A ), &lda, w,
148  reinterpret_cast<ET*>( work ), &lwork, rwork, info,
150 }
151 //*************************************************************************************************
152 
153 
154 //*************************************************************************************************
195 inline void heev( char jobz, char uplo, int n, complex<double>* A, int lda,
196  double* w, complex<double>* work, int lwork, double* rwork, int* info )
197 {
198  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
199 
200 #if defined(INTEL_MKL_VERSION)
201  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
202  using ET = MKL_Complex16;
203 #else
204  using ET = double;
205 #endif
206 
207  zheev_( &jobz, &uplo, &n, reinterpret_cast<ET*>( A ), &lda, w,
208  reinterpret_cast<ET*>( work ), &lwork, rwork, info,
210 }
211 //*************************************************************************************************
212 
213 } // namespace blaze
214 
215 #endif
Header file for basic type definitions.
void heev(char jobz, char uplo, int n, complex< float > *A, int lda, float *w, complex< float > *work, int lwork, float *rwork, int *info)
LAPACK kernel for computing the eigenvalues of the given dense Hermitian single precision column-majo...
Definition: heev.h:135
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Compile time assertion.
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
Size type of the Blaze library.