Blaze 3.9
heevx.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_LAPACK_CLAPACK_HEEVX_H_
36#define _BLAZE_MATH_LAPACK_CLAPACK_HEEVX_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 cheevx_( char* jobz, char* range, char* uplo, blaze::blas_int_t* n, float* A,
61 blaze::blas_int_t* lda, float* vl, float* vu, blaze::blas_int_t* il,
62 blaze::blas_int_t* iu, float* abstol, blaze::blas_int_t* m, float* w,
63 float* Z, blaze::blas_int_t* ldz, float* work, blaze::blas_int_t* lwork,
64 float* rwork, blaze::blas_int_t* iwork, blaze::blas_int_t* ifail,
67void zheevx_( char* jobz, char* range, char* uplo, blaze::blas_int_t* n, double* A,
68 blaze::blas_int_t* lda, double* vl, double* vu, blaze::blas_int_t* il,
69 blaze::blas_int_t* iu, double* abstol, blaze::blas_int_t* m, double* w,
70 double* Z, blaze::blas_int_t* ldz, double* work, blaze::blas_int_t* lwork,
71 double* rwork, blaze::blas_int_t* iwork, blaze::blas_int_t* ifail,
74
75}
76#endif
78//*************************************************************************************************
79
80
81
82
83namespace blaze {
84
85//=================================================================================================
86//
87// LAPACK HERMITIAN MATRIX EIGENVALUE FUNCTIONS (HEEVX)
88//
89//=================================================================================================
90
91//*************************************************************************************************
94void heevx( char jobz, char range, char uplo, blas_int_t n, complex<float>* A,
95 blas_int_t lda, float vl, float vu, blas_int_t il, blas_int_t iu,
96 float abstol, blas_int_t* m, float* w, complex<float>* Z, blas_int_t ldz,
97 complex<float>* work, blas_int_t lwork, float* rwork, blas_int_t* iwork,
98 blas_int_t* ifail, blas_int_t* info );
99
100void heevx( char jobz, char range, char uplo, blas_int_t n, complex<double>* A,
101 blas_int_t lda, double vl, double vu, blas_int_t il, blas_int_t iu,
102 double abstol, blas_int_t* m, double* w, complex<double>* Z, blas_int_t ldz,
103 complex<double>* work, blas_int_t lwork, double* rwork, blas_int_t* iwork,
104 blas_int_t* ifail, blas_int_t* info );
106//*************************************************************************************************
107
108
109//*************************************************************************************************
167inline void heevx( char jobz, char range, char uplo, blas_int_t n, complex<float>* A,
168 blas_int_t lda, float vl, float vu, blas_int_t il, blas_int_t iu,
169 float abstol, blas_int_t* m, float* w, complex<float>* Z, blas_int_t ldz,
170 complex<float>* work, blas_int_t lwork, float* rwork, blas_int_t* iwork,
171 blas_int_t* ifail, blas_int_t* info )
172{
173 BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
174
175#if defined(INTEL_MKL_VERSION)
176 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
177 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex8 ) == sizeof( complex<float> ) );
178 using ET = MKL_Complex8;
179#else
180 using ET = float;
181#endif
182
183 ++il;
184 ++iu;
185
186 cheevx_( &jobz, &range, &uplo, &n, reinterpret_cast<ET*>( A ), &lda, &vl, &vu, &il, &iu,
187 &abstol, m, w, reinterpret_cast<ET*>( Z ), &ldz, reinterpret_cast<ET*>( work ),
188 &lwork, rwork, iwork, ifail, info
189#if !defined(INTEL_MKL_VERSION)
191#endif
192 );
193}
194//*************************************************************************************************
195
196
197//*************************************************************************************************
255inline void heevx( char jobz, char range, char uplo, blas_int_t n, complex<double>* A,
256 blas_int_t lda, double vl, double vu, blas_int_t il, blas_int_t iu,
257 double abstol, blas_int_t* m, double* w, complex<double>* Z, blas_int_t ldz,
258 complex<double>* work, blas_int_t lwork, double* rwork, blas_int_t* iwork,
259 blas_int_t* ifail, blas_int_t* info )
260{
261 BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
262
263#if defined(INTEL_MKL_VERSION)
264 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
265 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex16 ) == sizeof( complex<double> ) );
266 using ET = MKL_Complex16;
267#else
268 using ET = double;
269#endif
270
271 ++il;
272 ++iu;
273
274 zheevx_( &jobz, &range, &uplo, &n, reinterpret_cast<ET*>( A ), &lda, &vl, &vu, &il, &iu,
275 &abstol, m, w, reinterpret_cast<ET*>( Z ), &ldz, reinterpret_cast<ET*>( work ),
276 &lwork, rwork, iwork, ifail, info
277#if !defined(INTEL_MKL_VERSION)
279#endif
280 );
281}
282//*************************************************************************************************
283
284} // namespace blaze
285
286#endif
Header file for the complex data type.
Compile time assertion.
Complex data type of the Blaze library.
size_t heevx(DenseMatrix< MT1, SO1 > &A, DenseVector< VT, TF > &w, DenseMatrix< MT2, SO2 > &Z, char uplo, ST low, ST upp)
LAPACK kernel for computing the eigenvalues of the given dense Hermitian matrix.
Definition: heevx.h:708
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.