Blaze  3.6
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 #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 cheevd_( char* jobz, char* uplo, int* n, float* A, int* lda, float* w,
60  float* work, int* lwork, float* rwork, int* lrwork, int* iwork, int* liwork,
61  int* info, blaze::fortran_charlen_t njobz, blaze::fortran_charlen_t nuplo );
62 void zheevd_( char* jobz, char* uplo, int* n, double* A, int* lda, double* w,
63  double* work, int* lwork, double* rwork, int* lrwork, int* iwork, int* liwork,
64  int* info, blaze::fortran_charlen_t njobz, blaze::fortran_charlen_t nuplo );
65 
66 }
67 #endif
68 
69 //*************************************************************************************************
70 
71 
72 
73 
74 namespace blaze {
75 
76 //=================================================================================================
77 //
78 // LAPACK HERMITIAN MATRIX EIGENVALUE FUNCTIONS (HEEVD)
79 //
80 //=================================================================================================
81 
82 //*************************************************************************************************
85 void heevd( char jobz, char uplo, int n, complex<float>* A, int lda, float* w,
86  complex<float>* work, int lwork, float* rwork, int lrwork,
87  int* iwork, int liwork, int* info );
88 
89 void heevd( char jobz, char uplo, int n, complex<double>* A, int lda, double* w,
90  complex<double>* work, int lwork, double* rwork, int lrwork,
91  int* iwork, int liwork, int* info );
93 //*************************************************************************************************
94 
95 
96 //*************************************************************************************************
140 inline void heevd( char jobz, char uplo, int n, complex<float>* A, int lda, float* w,
141  complex<float>* work, int lwork, float* rwork, int lrwork,
142  int* iwork, int liwork, int* info )
143 {
144  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
145 
146 #if defined(INTEL_MKL_VERSION)
147  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
148  using ET = MKL_Complex8;
149 #else
150  using ET = float;
151 #endif
152 
153  cheevd_( &jobz, &uplo, &n, reinterpret_cast<ET*>( A ), &lda, w,
154  reinterpret_cast<ET*>( work ), &lwork, rwork, &lrwork, iwork, &liwork, info,
156 }
157 //*************************************************************************************************
158 
159 
160 //*************************************************************************************************
204 inline void heevd( char jobz, char uplo, int n, complex<double>* A, int lda,
205  double* w, complex<double>* work, int lwork, double* rwork, int lrwork,
206  int* iwork, int liwork, int* info )
207 {
208  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
209 
210 #if defined(INTEL_MKL_VERSION)
211  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
212  using ET = MKL_Complex16;
213 #else
214  using ET = double;
215 #endif
216 
217  zheevd_( &jobz, &uplo, &n, reinterpret_cast<ET*>( A ), &lda, w,
218  reinterpret_cast<ET*>( work ), &lwork, rwork, &lrwork, iwork, &liwork, info,
220 }
221 //*************************************************************************************************
222 
223 } // namespace blaze
224 
225 #endif
Header file for basic type definitions.
void heevd(char jobz, char uplo, int n, complex< float > *A, int lda, float *w, complex< float > *work, int lwork, float *rwork, int lrwork, int *iwork, int liwork, int *info)
LAPACK kernel for computing the eigenvalues of the given dense Hermitian single precision column-majo...
Definition: heevd.h:140
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.