Blaze 3.9
hetrf.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_LAPACK_CLAPACK_HETRF_H_
36#define _BLAZE_MATH_LAPACK_CLAPACK_HETRF_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 chetrf_( char* uplo, blaze::blas_int_t* n, float* A, blaze::blas_int_t* lda,
61 blaze::blas_int_t* ipiv, float* work, blaze::blas_int_t* lwork,
63void zhetrf_( char* uplo, blaze::blas_int_t* n, double* A, blaze::blas_int_t* lda,
64 blaze::blas_int_t* ipiv, double* work, blaze::blas_int_t* lwork,
66
67}
68#endif
70//*************************************************************************************************
71
72
73
74
75namespace blaze {
76
77//=================================================================================================
78//
79// LAPACK LDLH DECOMPOSITION FUNCTIONS (HETRF)
80//
81//=================================================================================================
82
83//*************************************************************************************************
86void hetrf( char uplo, blas_int_t n, complex<float>* A, blas_int_t lda,
87 blas_int_t* ipiv, complex<float>* work, blas_int_t lwork, blas_int_t* info );
88
89void hetrf( char uplo, blas_int_t n, complex<double>* A, blas_int_t lda,
90 blas_int_t* ipiv, complex<double>* work, blas_int_t lwork, blas_int_t* info );
92//*************************************************************************************************
93
94
95//*************************************************************************************************
143inline void hetrf( char uplo, blas_int_t n, complex<float>* A, blas_int_t lda,
144 blas_int_t* ipiv, complex<float>* work, blas_int_t lwork, blas_int_t* info )
145{
146 BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
147
148#if defined(INTEL_MKL_VERSION)
149 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
150 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex8 ) == sizeof( complex<float> ) );
151 using ET = MKL_Complex8;
152#else
153 using ET = float;
154#endif
155
156 chetrf_( &uplo, &n, reinterpret_cast<ET*>( A ), &lda, ipiv,
157 reinterpret_cast<ET*>( work ), &lwork, info
158#if !defined(INTEL_MKL_VERSION)
160#endif
161 );
162}
163//*************************************************************************************************
164
165
166//*************************************************************************************************
214inline void hetrf( char uplo, blas_int_t n, complex<double>* A, blas_int_t lda,
215 blas_int_t* ipiv, complex<double>* work, blas_int_t lwork, blas_int_t* info )
216{
217 BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
218
219#if defined(INTEL_MKL_VERSION)
220 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
221 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex16 ) == sizeof( complex<double> ) );
222 using ET = MKL_Complex16;
223#else
224 using ET = double;
225#endif
226
227 zhetrf_( &uplo, &n, reinterpret_cast<ET*>( A ), &lda, ipiv,
228 reinterpret_cast<ET*>( work ), &lwork, info
229#if !defined(INTEL_MKL_VERSION)
231#endif
232 );
233}
234//*************************************************************************************************
235
236} // namespace blaze
237
238#endif
Header file for the complex data type.
Compile time assertion.
Complex data type of the Blaze library.
void hetrf(DenseMatrix< MT, SO > &A, char uplo, blas_int_t *ipiv)
LAPACK kernel for the decomposition of the given dense Hermitian indefinite matrix.
Definition: hetrf.h:121
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.