Blaze 3.9
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
44#include <blaze/util/Complex.h>
46#include <blaze/util/Types.h>
47
48
49//=================================================================================================
50//
51// LAPACK FORWARD DECLARATIONS
52//
53//=================================================================================================
54
55//*************************************************************************************************
57#if !defined(INTEL_MKL_VERSION)
58extern "C" {
59
60void cheevd_( char* jobz, char* uplo, blaze::blas_int_t* n, float* A, blaze::blas_int_t* lda,
61 float* w, float* work, blaze::blas_int_t* lwork, float* rwork, blaze::blas_int_t* lrwork,
64void zheevd_( char* jobz, char* uplo, blaze::blas_int_t* n, double* A, blaze::blas_int_t* lda,
65 double* w, double* work, blaze::blas_int_t* lwork, double* rwork, blaze::blas_int_t* lrwork,
68
69}
70#endif
72//*************************************************************************************************
73
74
75
76
77namespace blaze {
78
79//=================================================================================================
80//
81// LAPACK HERMITIAN MATRIX EIGENVALUE FUNCTIONS (HEEVD)
82//
83//=================================================================================================
84
85//*************************************************************************************************
88void heevd( char jobz, char uplo, blas_int_t n, complex<float>* A, blas_int_t lda,
89 float* w, complex<float>* work, blas_int_t lwork, float* rwork,
90 blas_int_t lrwork, blas_int_t* iwork, blas_int_t liwork, blas_int_t* info );
91
92void heevd( char jobz, char uplo, blas_int_t n, complex<double>* A, blas_int_t lda,
93 double* w, complex<double>* work, blas_int_t lwork, double* rwork,
94 blas_int_t lrwork, blas_int_t* iwork, blas_int_t liwork, blas_int_t* info );
96//*************************************************************************************************
97
98
99//*************************************************************************************************
143inline void heevd( char jobz, char uplo, blas_int_t n, complex<float>* A, blas_int_t lda,
144 float* w, complex<float>* work, blas_int_t lwork, float* rwork,
145 blas_int_t lrwork, blas_int_t* iwork, blas_int_t liwork, blas_int_t* info )
146{
147 BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
148
149#if defined(INTEL_MKL_VERSION)
150 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
151 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex8 ) == sizeof( complex<float> ) );
152 using ET = MKL_Complex8;
153#else
154 using ET = float;
155#endif
156
157 cheevd_( &jobz, &uplo, &n, reinterpret_cast<ET*>( A ), &lda, w,
158 reinterpret_cast<ET*>( work ), &lwork, rwork, &lrwork, iwork, &liwork, info
159#if !defined(INTEL_MKL_VERSION)
161#endif
162 );
163}
164//*************************************************************************************************
165
166
167//*************************************************************************************************
211inline void heevd( char jobz, char uplo, blas_int_t n, complex<double>* A, blas_int_t lda,
212 double* w, complex<double>* work, blas_int_t lwork, double* rwork,
213 blas_int_t lrwork, blas_int_t* iwork, blas_int_t liwork, blas_int_t* info )
214{
215 BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
216
217#if defined(INTEL_MKL_VERSION)
218 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
219 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex16 ) == sizeof( complex<double> ) );
220 using ET = MKL_Complex16;
221#else
222 using ET = double;
223#endif
224
225 zheevd_( &jobz, &uplo, &n, reinterpret_cast<ET*>( A ), &lda, w,
226 reinterpret_cast<ET*>( work ), &lwork, rwork, &lrwork, iwork, &liwork, info
227#if !defined(INTEL_MKL_VERSION)
229#endif
230 );
231}
232//*************************************************************************************************
233
234} // namespace blaze
235
236#endif
Header file for the complex data type.
Compile time assertion.
Complex data type of the Blaze library.
void heevd(DenseMatrix< MT, SO > &A, DenseVector< VT, TF > &w, char jobz, char uplo)
LAPACK kernel for computing the eigenvalues of the given dense Hermitian matrix.
Definition: heevd.h:140
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
size_t fortran_charlen_t
Type of the hidden arguments of character type within a Fortran forward declaration.
Definition: Types.h:186
Header file for basic BLAS type definitions.
Header file for basic type definitions.