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 
46 
47 //=================================================================================================
48 //
49 // LAPACK FORWARD DECLARATIONS
50 //
51 //=================================================================================================
52 
53 //*************************************************************************************************
55 #if !defined(INTEL_MKL_VERSION)
56 extern "C" {
57 
58 void cheev_( char* jobz, char* uplo, int* n, float* A, int* lda, float* w, float* work, int* lwork, float* rwork, int* info );
59 void zheev_( char* jobz, char* uplo, int* n, double* A, int* lda, double* w, double* work, int* lwork, double* rwork, int* info );
60 
61 }
62 #endif
63 
64 //*************************************************************************************************
65 
66 
67 
68 
69 namespace blaze {
70 
71 //=================================================================================================
72 //
73 // LAPACK HERMITIAN MATRIX EIGENVALUE FUNCTIONS (HEEV)
74 //
75 //=================================================================================================
76 
77 //*************************************************************************************************
80 inline void heev( char jobz, char uplo, int n, complex<float>* A, int lda,
81  float* w, complex<float>* work, int lwork, float* rwork, int* info );
82 
83 inline void heev( char jobz, char uplo, int n, complex<double>* A, int lda,
84  double* w, complex<double>* work, int lwork, float* rwork, int* info );
86 //*************************************************************************************************
87 
88 
89 //*************************************************************************************************
130 inline void heev( char jobz, char uplo, int n, complex<float>* A, int lda,
131  float* w, complex<float>* work, int lwork, float* rwork, int* info )
132 {
133  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
134 
135 #if defined(INTEL_MKL_VERSION)
136  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
137  using ET = MKL_Complex8;
138 #else
139  using ET = float;
140 #endif
141 
142  cheev_( &jobz, &uplo, &n, reinterpret_cast<ET*>( A ), &lda, w,
143  reinterpret_cast<ET*>( work ), &lwork, rwork, info );
144 }
145 //*************************************************************************************************
146 
147 
148 //*************************************************************************************************
189 inline void heev( char jobz, char uplo, int n, complex<double>* A, int lda,
190  double* w, complex<double>* work, int lwork, double* rwork, int* info )
191 {
192  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
193 
194 #if defined(INTEL_MKL_VERSION)
195  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
196  using ET = MKL_Complex16;
197 #else
198  using ET = double;
199 #endif
200 
201  zheev_( &jobz, &uplo, &n, reinterpret_cast<ET*>( A ), &lda, w,
202  reinterpret_cast<ET*>( work ), &lwork, rwork, info );
203 }
204 //*************************************************************************************************
205 
206 } // namespace blaze
207 
208 #endif
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:130
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
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