Blaze 3.9
geev.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_LAPACK_CLAPACK_GEEV_H_
36#define _BLAZE_MATH_LAPACK_CLAPACK_GEEV_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 sgeev_( char* jobvl, char* jobvr, blaze::blas_int_t* n, float* A, blaze::blas_int_t* lda,
61 float* wr, float* wi, float* VL, blaze::blas_int_t* ldvl, float* VR, blaze::blas_int_t* ldvr,
62 float* work, blaze::blas_int_t* lwork, blaze::blas_int_t* info,
64void dgeev_( char* jobvl, char* jobvr, blaze::blas_int_t* n, double* A, blaze::blas_int_t* lda,
65 double* wr, double* wi, double* VL, blaze::blas_int_t* ldvl, double* VR, blaze::blas_int_t* ldvr,
66 double* work, blaze::blas_int_t* lwork, blaze::blas_int_t* info,
68void cgeev_( char* jobvl, char* jobvr, blaze::blas_int_t* n, float* A, blaze::blas_int_t* lda,
69 float* w, float* VL, blaze::blas_int_t* ldvl, float* VR, blaze::blas_int_t* ldvr,
70 float* work, blaze::blas_int_t* lwork, float* rwork, blaze::blas_int_t* info,
72void zgeev_( char* jobvl, char* jobvr, blaze::blas_int_t* n, double* A, blaze::blas_int_t* lda,
73 double* w, double* VL, blaze::blas_int_t* ldvl, double* VR, blaze::blas_int_t* ldvr,
74 double* work, blaze::blas_int_t* lwork, double* rwork, blaze::blas_int_t* info,
76
77}
78#endif
80//*************************************************************************************************
81
82
83
84
85namespace blaze {
86
87//=================================================================================================
88//
89// LAPACK GENERAL MATRIX EIGENVALUE FUNCTIONS (GEEV)
90//
91//=================================================================================================
92
93//*************************************************************************************************
96void geev( char jobvl, char jobvr, blas_int_t n, float* A, blas_int_t lda,
97 float* wr, float* wi, float* VL, blas_int_t ldvl, float* VR, blas_int_t ldvr,
98 float* work, blas_int_t lwork, blas_int_t* info );
99
100void geev( char jobvl, char jobvr, blas_int_t n, double* A, blas_int_t lda,
101 double* wr, double* wi, double* VL, blas_int_t ldvl, double* VR, blas_int_t ldvr,
102 double* work, blas_int_t lwork, blas_int_t* info );
103
104void geev( char jobvl, char jobvr, blas_int_t n, complex<float>* A, blas_int_t lda,
106 blas_int_t ldvr, complex<float>* work, blas_int_t lwork, float* rwork,
107 blas_int_t* info );
108
109void geev( char jobvl, char jobvr, blas_int_t n, complex<double>* A, blas_int_t lda,
111 blas_int_t ldvr, complex<double>* work, blas_int_t lwork, double* rwork,
112 blas_int_t* info );
114//*************************************************************************************************
115
116
117//*************************************************************************************************
179inline void geev( char jobvl, char jobvr, blas_int_t n, float* A, blas_int_t lda,
180 float* wr, float* wi, float* VL, blas_int_t ldvl, float* VR, blas_int_t ldvr,
181 float* work, blas_int_t lwork, blas_int_t* info )
182{
183#if defined(INTEL_MKL_VERSION)
184 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
185#endif
186
187 sgeev_( &jobvl, &jobvr, &n, A, &lda, wr, wi, VL, &ldvl, VR, &ldvr, work, &lwork, info
188#if !defined(INTEL_MKL_VERSION)
190#endif
191 );
192}
193//*************************************************************************************************
194
195
196//*************************************************************************************************
258inline void geev( char jobvl, char jobvr, blas_int_t n, double* A, blas_int_t lda,
259 double* wr, double* wi, double* VL, blas_int_t ldvl, double* VR, blas_int_t ldvr,
260 double* work, blas_int_t lwork, blas_int_t* info )
261{
262#if defined(INTEL_MKL_VERSION)
263 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
264#endif
265
266 dgeev_( &jobvl, &jobvr, &n, A, &lda, wr, wi, VL, &ldvl, VR, &ldvr, work, &lwork, info
267#if !defined(INTEL_MKL_VERSION)
269#endif
270 );
271}
272//*************************************************************************************************
273
274
275//*************************************************************************************************
337inline void geev( char jobvl, char jobvr, blas_int_t n, complex<float>* A, blas_int_t lda,
338 complex<float>* w, complex<float>* VL, blas_int_t ldvl, complex<float>* VR,
339 blas_int_t ldvr, complex<float>* work, blas_int_t lwork, float* rwork,
340 blas_int_t* info )
341{
342 BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
343
344#if defined(INTEL_MKL_VERSION)
345 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
346 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex8 ) == sizeof( complex<float> ) );
347 using ET = MKL_Complex8;
348#else
349 using ET = float;
350#endif
351
352 cgeev_( &jobvl, &jobvr, &n, reinterpret_cast<ET*>( A ), &lda, reinterpret_cast<ET*>( w ),
353 reinterpret_cast<ET*>( VL ), &ldvl, reinterpret_cast<ET*>( VR ), &ldvr,
354 reinterpret_cast<ET*>( work ), &lwork, rwork, info
355#if !defined(INTEL_MKL_VERSION)
357#endif
358 );
359}
360//*************************************************************************************************
361
362
363//*************************************************************************************************
425inline void geev( char jobvl, char jobvr, blas_int_t n, complex<double>* A, blas_int_t lda,
426 complex<double>* w, complex<double>* VL, blas_int_t ldvl, complex<double>* VR,
427 blas_int_t ldvr, complex<double>* work, blas_int_t lwork, double* rwork,
428 blas_int_t* info )
429{
430 BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
431
432#if defined(INTEL_MKL_VERSION)
433 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
434 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex16 ) == sizeof( complex<double> ) );
435 using ET = MKL_Complex16;
436#else
437 using ET = double;
438#endif
439
440 zgeev_( &jobvl, &jobvr, &n, reinterpret_cast<ET*>( A ), &lda, reinterpret_cast<ET*>( w ),
441 reinterpret_cast<ET*>( VL ), &ldvl, reinterpret_cast<ET*>( VR ), &ldvr,
442 reinterpret_cast<ET*>( work ), &lwork, rwork, info
443#if !defined(INTEL_MKL_VERSION)
445#endif
446 );
447}
448//*************************************************************************************************
449
450} // namespace blaze
451
452#endif
Header file for the complex data type.
Compile time assertion.
Complex data type of the Blaze library.
void geev(DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO2 > &VL, DenseVector< VT, TF > &w, DenseMatrix< MT3, SO3 > &VR)
LAPACK kernel for computing the eigenvalues of the given dense general matrix.
Definition: geev.h:1086
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.