Blaze  3.6
hesv.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_LAPACK_CLAPACK_HESV_H_
36 #define _BLAZE_MATH_LAPACK_CLAPACK_HESV_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 chesv_( char* uplo, int* n, int* nrhs, float* A, int* lda, int* ipiv, float* b, int* ldb,
60  float* work, int* lwork, int* info, blaze::fortran_charlen_t nuplo );
61 void zhesv_( char* uplo, int* n, int* nrhs, double* A, int* lda, int* ipiv, double* b, int* ldb,
62  double* work, int* lwork, int* info, blaze::fortran_charlen_t nuplo );
63 
64 }
65 #endif
66 
67 //*************************************************************************************************
68 
69 
70 
71 
72 namespace blaze {
73 
74 //=================================================================================================
75 //
76 // LAPACK HERMITIAN INDEFINITE LINEAR SYSTEM FUNCTIONS (HESV)
77 //
78 //=================================================================================================
79 
80 //*************************************************************************************************
83 void hesv( char uplo, int n, int nrhs, complex<float>* A, int lda, int* ipiv,
84  complex<float>* B, int ldb, complex<float>* work, int lwork, int* info );
85 
86 void hesv( char uplo, int n, int nrhs, complex<double>* A, int lda, int* ipiv,
87  complex<double>* B, int ldb, complex<double>* work, int lwork, int* info );
89 //*************************************************************************************************
90 
91 
92 //*************************************************************************************************
141 inline void hesv( char uplo, int n, int nrhs, complex<float>* A, int lda, int* ipiv,
142  complex<float>* B, int ldb, complex<float>* work, int lwork, 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  chesv_( &uplo, &n, &nrhs, reinterpret_cast<ET*>( A ), &lda, ipiv,
154  reinterpret_cast<ET*>( B ), &ldb, reinterpret_cast<ET*>( work ), &lwork, info,
156 }
157 //*************************************************************************************************
158 
159 
160 //*************************************************************************************************
209 inline void hesv( char uplo, int n, int nrhs, complex<double>* A, int lda, int* ipiv,
210  complex<double>* B, int ldb, complex<double>* work, int lwork, int* info )
211 {
212  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
213 
214 #if defined(INTEL_MKL_VERSION)
215  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
216  using ET = MKL_Complex16;
217 #else
218  using ET = double;
219 #endif
220 
221  zhesv_( &uplo, &n, &nrhs, reinterpret_cast<ET*>( A ), &lda, ipiv,
222  reinterpret_cast<ET*>( B ), &ldb, reinterpret_cast<ET*>( work ), &lwork, info,
224 }
225 //*************************************************************************************************
226 
227 } // namespace blaze
228 
229 #endif
Header file for basic type definitions.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Compile time assertion.
void hesv(char uplo, int n, int nrhs, complex< float > *A, int lda, int *ipiv, complex< float > *B, int ldb, complex< float > *work, int lwork, int *info)
LAPACK kernel for solving a Hermitian indefinite single precision complex linear system of equations ...
Definition: hesv.h:141
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.