Blaze 3.9
hetri.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_LAPACK_CLAPACK_HETRI_H_
36#define _BLAZE_MATH_LAPACK_CLAPACK_HETRI_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 chetri_( 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* info,
63void zhetri_( 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* info,
66
67}
68#endif
70//*************************************************************************************************
71
72
73
74
75namespace blaze {
76
77//=================================================================================================
78//
79// LAPACK LDLH-BASED INVERSION FUNCTIONS (HETRI)
80//
81//=================================================================================================
82
83//*************************************************************************************************
86void hetri( char uplo, blas_int_t n, complex<float>* A, blas_int_t lda,
87 const blas_int_t* ipiv, complex<float>* work, blas_int_t* info );
88
89void hetri( char uplo, blas_int_t n, complex<double>* A, blas_int_t lda,
90 const blas_int_t* ipiv, complex<double>* work, blas_int_t* info );
92//*************************************************************************************************
93
94
95//*************************************************************************************************
127inline void hetri( char uplo, blas_int_t n, complex<float>* A, blas_int_t lda,
128 const blas_int_t* ipiv, complex<float>* work, blas_int_t* info )
129{
130 BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
131
132#if defined(INTEL_MKL_VERSION)
133 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
134 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex8 ) == sizeof( complex<float> ) );
135 using ET = MKL_Complex8;
136#else
137 using ET = float;
138#endif
139
140 chetri_( &uplo, &n, reinterpret_cast<ET*>( A ), &lda, const_cast<blas_int_t*>( ipiv ),
141 reinterpret_cast<ET*>( work ), info
142#if !defined(INTEL_MKL_VERSION)
144#endif
145 );
146}
147//*************************************************************************************************
148
149
150//*************************************************************************************************
182inline void hetri( char uplo, blas_int_t n, complex<double>* A, blas_int_t lda,
183 const blas_int_t* ipiv, complex<double>* work, blas_int_t* info )
184{
185 BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
186
187#if defined(INTEL_MKL_VERSION)
188 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
189 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex16 ) == sizeof( complex<double> ) );
190 using ET = MKL_Complex16;
191#else
192 using ET = double;
193#endif
194
195 zhetri_( &uplo, &n, reinterpret_cast<ET*>( A ), &lda, const_cast<blas_int_t*>( ipiv ),
196 reinterpret_cast<ET*>( work ), info
197#if !defined(INTEL_MKL_VERSION)
199#endif
200 );
201}
202//*************************************************************************************************
203
204} // namespace blaze
205
206#endif
Header file for the complex data type.
Compile time assertion.
Complex data type of the Blaze library.
void hetri(DenseMatrix< MT, SO > &A, char uplo, const blas_int_t *ipiv)
LAPACK kernel for the inversion of the given dense Hermitian indefinite matrix.
Definition: hetri.h:116
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.