Blaze 3.9
potri.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_LAPACK_CLAPACK_POTRI_H_
36#define _BLAZE_MATH_LAPACK_CLAPACK_POTRI_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 spotri_( char* uplo, blaze::blas_int_t* n, float* A, blaze::blas_int_t* lda,
62void dpotri_( char* uplo, blaze::blas_int_t* n, double* A, blaze::blas_int_t* lda,
64void cpotri_( char* uplo, blaze::blas_int_t* n, float* A, blaze::blas_int_t* lda,
66void zpotri_( char* uplo, 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 LLH-BASED INVERSION FUNCTIONS (POTRI)
82//
83//=================================================================================================
84
85//*************************************************************************************************
88void potri( char uplo, blas_int_t n, float* A, blas_int_t lda, blas_int_t* info );
89
90void potri( char uplo, blas_int_t n, double* A, blas_int_t lda, blas_int_t* info );
91
92void potri( char uplo, blas_int_t n, complex<float>* A, blas_int_t lda, blas_int_t* info );
93
94void potri( char uplo, blas_int_t n, complex<double>* A, blas_int_t lda, blas_int_t* info );
96//*************************************************************************************************
97
98
99//*************************************************************************************************
130inline void potri( char uplo, blas_int_t n, float* A, blas_int_t lda, blas_int_t* info )
131{
132#if defined(INTEL_MKL_VERSION)
133 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
134#endif
135
136 spotri_( &uplo, &n, A, &lda, info
137#if !defined(INTEL_MKL_VERSION) && !defined(BLAS_H)
139#endif
140 );
141}
142//*************************************************************************************************
143
144
145//*************************************************************************************************
176inline void potri( char uplo, blas_int_t n, double* A, blas_int_t lda, blas_int_t* info )
177{
178#if defined(INTEL_MKL_VERSION)
179 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
180#endif
181
182 dpotri_( &uplo, &n, A, &lda, info
183#if !defined(INTEL_MKL_VERSION) && !defined(BLAS_H)
185#endif
186 );
187}
188//*************************************************************************************************
189
190
191//*************************************************************************************************
222inline void potri( char uplo, blas_int_t n, complex<float>* A, blas_int_t lda, blas_int_t* info )
223{
224 BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
225
226#if defined(INTEL_MKL_VERSION)
227 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
228 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex8 ) == sizeof( complex<float> ) );
229 using ET = MKL_Complex8;
230#else
231 using ET = float;
232#endif
233
234 cpotri_( &uplo, &n, reinterpret_cast<ET*>( A ), &lda, info
235#if !defined(INTEL_MKL_VERSION) && !defined(BLAS_H)
237#endif
238 );
239}
240//*************************************************************************************************
241
242
243//*************************************************************************************************
274inline void potri( char uplo, blas_int_t n, complex<double>* A, blas_int_t lda, blas_int_t* info )
275{
276 BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
277
278#if defined(INTEL_MKL_VERSION)
279 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
280 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex16 ) == sizeof( complex<double> ) );
281 using ET = MKL_Complex16;
282#else
283 using ET = double;
284#endif
285
286 zpotri_( &uplo, &n, reinterpret_cast<ET*>( A ), &lda, info
287#if !defined(INTEL_MKL_VERSION) && !defined(BLAS_H)
289#endif
290 );
291}
292//*************************************************************************************************
293
294} // namespace blaze
295
296#endif
Header file for the complex data type.
Compile time assertion.
Complex data type of the Blaze library.
void potri(DenseMatrix< MT, SO > &A, char uplo)
LAPACK kernel for the inversion of the given dense positive definite matrix.
Definition: potri.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.