Blaze 3.9
sytri.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_LAPACK_CLAPACK_SYTRI_H_
36#define _BLAZE_MATH_LAPACK_CLAPACK_SYTRI_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 ssytri_( 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 dsytri_( 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,
66void csytri_( char* uplo, blaze::blas_int_t* n, float* A, blaze::blas_int_t* lda,
67 blaze::blas_int_t* ipiv, float* work, blaze::blas_int_t* info,
69void zsytri_( char* uplo, blaze::blas_int_t* n, double* A, blaze::blas_int_t* lda,
70 blaze::blas_int_t* ipiv, double* work, blaze::blas_int_t* info,
72
73}
74#endif
76//*************************************************************************************************
77
78
79
80
81namespace blaze {
82
83//=================================================================================================
84//
85// LAPACK LDLT-BASED INVERSION FUNCTIONS (SYTRI)
86//
87//=================================================================================================
88
89//*************************************************************************************************
92void sytri( char uplo, blas_int_t n, float* A, blas_int_t lda,
93 const blas_int_t* ipiv, float* work, blas_int_t* info );
94
95void sytri( char uplo, blas_int_t n, double* A, blas_int_t lda,
96 const blas_int_t* ipiv, double* work, blas_int_t* info );
97
98void sytri( char uplo, blas_int_t n, complex<float>* A, blas_int_t lda,
99 const blas_int_t* ipiv, complex<float>* work, blas_int_t* info );
100
101void sytri( char uplo, blas_int_t n, complex<double>* A, blas_int_t lda,
102 const blas_int_t* ipiv, complex<double>* work, blas_int_t* info );
104//*************************************************************************************************
105
106
107//*************************************************************************************************
139inline void sytri( char uplo, blas_int_t n, float* A, blas_int_t lda,
140 const blas_int_t* ipiv, float* work, blas_int_t* info )
141{
142#if defined(INTEL_MKL_VERSION)
143 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
144#endif
145
146 ssytri_( &uplo, &n, A, &lda, const_cast<blas_int_t*>( ipiv ), work, info
147#if !defined(INTEL_MKL_VERSION)
149#endif
150 );
151}
152//*************************************************************************************************
153
154
155//*************************************************************************************************
187inline void sytri( char uplo, blas_int_t n, double* A, blas_int_t lda,
188 const blas_int_t* ipiv, double* work, blas_int_t* info )
189{
190#if defined(INTEL_MKL_VERSION)
191 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
192#endif
193
194 dsytri_( &uplo, &n, A, &lda, const_cast<blas_int_t*>( ipiv ), work, info
195#if !defined(INTEL_MKL_VERSION)
197#endif
198 );
199}
200//*************************************************************************************************
201
202
203//*************************************************************************************************
235inline void sytri( char uplo, blas_int_t n, complex<float>* A, blas_int_t lda,
236 const blas_int_t* ipiv, complex<float>* work, blas_int_t* info )
237{
238 BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
239
240#if defined(INTEL_MKL_VERSION)
241 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
242 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex8 ) == sizeof( complex<float> ) );
243 using ET = MKL_Complex8;
244#else
245 using ET = float;
246#endif
247
248 csytri_( &uplo, &n, reinterpret_cast<ET*>( A ), &lda,
249 const_cast<blas_int_t*>( ipiv ), reinterpret_cast<ET*>( work ), info
250#if !defined(INTEL_MKL_VERSION)
252#endif
253 );
254}
255//*************************************************************************************************
256
257
258//*************************************************************************************************
290inline void sytri( char uplo, blas_int_t n, complex<double>* A, blas_int_t lda,
291 const blas_int_t* ipiv, complex<double>* work, blas_int_t* info )
292{
293 BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
294
295#if defined(INTEL_MKL_VERSION)
296 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
297 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex16 ) == sizeof( complex<double> ) );
298 using ET = MKL_Complex16;
299#else
300 using ET = double;
301#endif
302
303 zsytri_( &uplo, &n, reinterpret_cast<ET*>( A ), &lda,
304 const_cast<blas_int_t*>( ipiv ), reinterpret_cast<ET*>( work ), info
305#if !defined(INTEL_MKL_VERSION)
307#endif
308 );
309}
310//*************************************************************************************************
311
312} // namespace blaze
313
314#endif
Header file for the complex data type.
Compile time assertion.
Complex data type of the Blaze library.
void sytri(DenseMatrix< MT, SO > &A, char uplo, const blas_int_t *ipiv)
LAPACK kernel for the inversion of the given dense symmetric indefinite matrix.
Definition: sytri.h:115
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.