Blaze 3.9
trtri.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_LAPACK_CLAPACK_TRTRI_H_
36#define _BLAZE_MATH_LAPACK_CLAPACK_TRTRI_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) && !defined(BLAS_H)
58extern "C" {
59
60void strtri_( char* uplo, char* diag, blaze::blas_int_t* n, float* A, blaze::blas_int_t* lda,
62void dtrtri_( char* uplo, char* diag, blaze::blas_int_t* n, double* A, blaze::blas_int_t* lda,
64void ctrtri_( char* uplo, char* diag, blaze::blas_int_t* n, float* A, blaze::blas_int_t* lda,
66void ztrtri_( char* uplo, char* diag, blaze::blas_int_t* n, double* A, blaze::blas_int_t* lda,
68
69}
70#endif
72//*************************************************************************************************
73
74
75
76
77namespace blaze {
78
79//=================================================================================================
80//
81// LAPACK TRIANGULAR MATRIX INVERSION FUNCTIONS (TRTRI)
82//
83//=================================================================================================
84
85//*************************************************************************************************
88void trtri( char uplo, char diag, blas_int_t n, float* A, blas_int_t lda,
89 blas_int_t* info );
90
91void trtri( char uplo, char diag, blas_int_t n, double* A, blas_int_t lda,
92 blas_int_t* info );
93
94void trtri( char uplo, char diag, blas_int_t n, complex<float>* A, blas_int_t lda,
95 blas_int_t* info );
96
97void trtri( char uplo, char diag, blas_int_t n, complex<double>* A, blas_int_t lda,
98 blas_int_t* info );
100//*************************************************************************************************
101
102
103//*************************************************************************************************
134inline void trtri( char uplo, char diag, blas_int_t n, float* A, blas_int_t lda,
135 blas_int_t* info )
136{
137#if defined(INTEL_MKL_VERSION)
138 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
139#endif
140
141 strtri_( &uplo, &diag, &n, A, &lda, info
142#if !defined(INTEL_MKL_VERSION) && !defined(BLAS_H)
144#endif
145 );
146}
147//*************************************************************************************************
148
149
150//*************************************************************************************************
181inline void trtri( char uplo, char diag, blas_int_t n, double* A, blas_int_t lda,
182 blas_int_t* info )
183{
184#if defined(INTEL_MKL_VERSION)
185 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
186#endif
187
188 dtrtri_( &uplo, &diag, &n, A, &lda, info
189#if !defined(INTEL_MKL_VERSION) && !defined(BLAS_H)
191#endif
192 );
193}
194//*************************************************************************************************
195
196
197//*************************************************************************************************
228inline void trtri( char uplo, char diag, blas_int_t n, complex<float>* A, blas_int_t lda,
229 blas_int_t* info )
230{
231 BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
232
233#if defined(INTEL_MKL_VERSION)
234 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
235 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex8 ) == sizeof( complex<float> ) );
236 using ET = MKL_Complex8;
237#else
238 using ET = float;
239#endif
240
241 ctrtri_( &uplo, &diag, &n, reinterpret_cast<ET*>( A ), &lda, info
242#if !defined(INTEL_MKL_VERSION) && !defined(BLAS_H)
244#endif
245 );
246}
247//*************************************************************************************************
248
249
250//*************************************************************************************************
281inline void trtri( char uplo, char diag, blas_int_t n, complex<double>* A, blas_int_t lda,
282 blas_int_t* info )
283{
284 BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
285
286#if defined(INTEL_MKL_VERSION)
287 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
288 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex16 ) == sizeof( complex<double> ) );
289 using ET = MKL_Complex16;
290#else
291 using ET = double;
292#endif
293
294 ztrtri_( &uplo, &diag, &n, reinterpret_cast<ET*>( A ), &lda, info
295#if !defined(INTEL_MKL_VERSION) && !defined(BLAS_H)
297#endif
298 );
299}
300//*************************************************************************************************
301
302} // namespace blaze
303
304#endif
Header file for the complex data type.
Compile time assertion.
Complex data type of the Blaze library.
void trtri(DenseMatrix< MT, SO > &A, char uplo, char diag)
LAPACK kernel for the inversion of the given dense triangular matrix.
Definition: trtri.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.