heevd.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_LAPACK_CLAPACK_HEEVD_H_
36 #define _BLAZE_MATH_LAPACK_CLAPACK_HEEVD_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 cheevd_( char* jobz, char* uplo, int* n, float* A, int* lda, float* w, float* work, int* lwork, float* rwork, int* lrwork, int* iwork, int* liwork, int* info );
59 void zheevd_( char* jobz, char* uplo, int* n, double* A, int* lda, double* w, double* work, int* lwork, double* rwork, int* lrwork, int* iwork, int* liwork, int* info );
60 
61 }
62 #endif
63 
64 //*************************************************************************************************
65 
66 
67 
68 
69 namespace blaze {
70 
71 //=================================================================================================
72 //
73 // LAPACK HERMITIAN MATRIX EIGENVALUE FUNCTIONS (HEEVD)
74 //
75 //=================================================================================================
76 
77 //*************************************************************************************************
80 inline void heevd( char jobz, char uplo, int n, complex<float>* A, int lda, float* w,
81  complex<float>* work, int lwork, float* rwork, int* lrwork,
82  int* iwork, int* liwork, int* info );
83 
84 inline void heevd( char jobz, char uplo, int n, complex<double>* A, int lda, double* w,
85  complex<double>* work, int lwork, double* rwork, int lrwork,
86  int* iwork, int* liwork, int* info );
88 //*************************************************************************************************
89 
90 
91 //*************************************************************************************************
135 inline void heevd( char jobz, char uplo, int n, complex<float>* A, int lda, float* w,
136  complex<float>* work, int lwork, float* rwork, int lrwork,
137  int* iwork, int liwork, int* info )
138 {
139  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
140 
141 #if defined(INTEL_MKL_VERSION)
142  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
143  using ET = MKL_Complex8;
144 #else
145  using ET = float;
146 #endif
147 
148  cheevd_( &jobz, &uplo, &n, reinterpret_cast<ET*>( A ), &lda, w,
149  reinterpret_cast<ET*>( work ), &lwork, rwork, &lrwork, iwork, &liwork, info );
150 }
151 //*************************************************************************************************
152 
153 
154 //*************************************************************************************************
198 inline void heevd( char jobz, char uplo, int n, complex<double>* A, int lda,
199  double* w, complex<double>* work, int lwork, double* rwork, int lrwork,
200  int* iwork, int liwork, int* info )
201 {
202  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
203 
204 #if defined(INTEL_MKL_VERSION)
205  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
206  using ET = MKL_Complex16;
207 #else
208  using ET = double;
209 #endif
210 
211  zheevd_( &jobz, &uplo, &n, reinterpret_cast<ET*>( A ), &lda, w,
212  reinterpret_cast<ET*>( work ), &lwork, rwork, &lrwork, iwork, &liwork, info );
213 }
214 //*************************************************************************************************
215 
216 } // namespace blaze
217 
218 #endif
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