Blaze  3.6
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 
43 #include <blaze/util/Complex.h>
45 #include <blaze/util/Types.h>
46 
47 
48 //=================================================================================================
49 //
50 // LAPACK FORWARD DECLARATIONS
51 //
52 //=================================================================================================
53 
54 //*************************************************************************************************
56 #if !defined(INTEL_MKL_VERSION)
57 extern "C" {
58 
59 void spotri_( char* uplo, int* n, float* A, int* lda, int* info, blaze::fortran_charlen_t nuplo );
60 void dpotri_( char* uplo, int* n, double* A, int* lda, int* info, blaze::fortran_charlen_t nuplo );
61 void cpotri_( char* uplo, int* n, float* A, int* lda, int* info, blaze::fortran_charlen_t nuplo );
62 void zpotri_( char* uplo, int* n, double* A, int* lda, int* info, blaze::fortran_charlen_t nuplo );
63 
64 }
65 #endif
66 
67 //*************************************************************************************************
68 
69 
70 
71 
72 namespace blaze {
73 
74 //=================================================================================================
75 //
76 // LAPACK LLH-BASED INVERSION FUNCTIONS (POTRI)
77 //
78 //=================================================================================================
79 
80 //*************************************************************************************************
83 void potri( char uplo, int n, float* A, int lda, int* info );
84 
85 void potri( char uplo, int n, double* A, int lda, int* info );
86 
87 void potri( char uplo, int n, complex<float>* A, int lda, int* info );
88 
89 void potri( char uplo, int n, complex<double>* A, int lda, int* info );
91 //*************************************************************************************************
92 
93 
94 //*************************************************************************************************
125 inline void potri( char uplo, int n, float* A, int lda, int* info )
126 {
127 #if defined(INTEL_MKL_VERSION)
128  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
129 #endif
130 
131  spotri_( &uplo, &n, A, &lda, info, blaze::fortran_charlen_t(1) );
132 }
133 //*************************************************************************************************
134 
135 
136 //*************************************************************************************************
167 inline void potri( char uplo, int n, double* A, int lda, int* info )
168 {
169 #if defined(INTEL_MKL_VERSION)
170  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
171 #endif
172 
173  dpotri_( &uplo, &n, A, &lda, info, blaze::fortran_charlen_t(1) );
174 }
175 //*************************************************************************************************
176 
177 
178 //*************************************************************************************************
209 inline void potri( char uplo, int n, complex<float>* A, int lda, int* info )
210 {
211  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
212 
213 #if defined(INTEL_MKL_VERSION)
214  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
215  using ET = MKL_Complex8;
216 #else
217  using ET = float;
218 #endif
219 
220  cpotri_( &uplo, &n, reinterpret_cast<ET*>( A ), &lda, info, blaze::fortran_charlen_t(1) );
221 }
222 //*************************************************************************************************
223 
224 
225 //*************************************************************************************************
256 inline void potri( char uplo, int n, complex<double>* A, int lda, int* info )
257 {
258  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
259 
260 #if defined(INTEL_MKL_VERSION)
261  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
262  using ET = MKL_Complex16;
263 #else
264  using ET = double;
265 #endif
266 
267  zpotri_( &uplo, &n, reinterpret_cast<ET*>( A ), &lda, info, blaze::fortran_charlen_t(1) );
268 }
269 //*************************************************************************************************
270 
271 } // namespace blaze
272 
273 #endif
Header file for basic type definitions.
void potri(char uplo, int n, float *A, int lda, int *info)
LAPACK kernel for the inversion of the given dense positive definite single precision column-major sq...
Definition: potri.h:125
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Compile time assertion.
Header file for the complex data type.
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:112
Size type of the Blaze library.