Blaze  3.6
getri.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_LAPACK_CLAPACK_GETRI_H_
36 #define _BLAZE_MATH_LAPACK_CLAPACK_GETRI_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/util/Complex.h>
45 
46 
47 //=================================================================================================
48 //
49 // LAPACK FORWARD DECLARATIONS
50 //
51 //=================================================================================================
52 
53 //*************************************************************************************************
55 #if !defined(INTEL_MKL_VERSION)
56 extern "C" {
57 
58 void sgetri_( int* n, float* A, int* lda, int* ipiv, float* work, int* lwork, int* info );
59 void dgetri_( int* n, double* A, int* lda, int* ipiv, double* work, int* lwork, int* info );
60 void cgetri_( int* n, float* A, int* lda, int* ipiv, float* work, int* lwork, int* info );
61 void zgetri_( int* n, double* A, int* lda, int* ipiv, double* work, int* lwork, int* info );
62 
63 }
64 #endif
65 
66 //*************************************************************************************************
67 
68 
69 
70 
71 namespace blaze {
72 
73 //=================================================================================================
74 //
75 // LAPACK LU-BASED INVERSION FUNCTIONS (GETRI)
76 //
77 //=================================================================================================
78 
79 //*************************************************************************************************
82 void getri( int n, float* A, int lda, const int* ipiv, float* work, int lwork, int* info );
83 
84 void getri( int n, double* A, int lda, const int* ipiv, double* work, int lwork, int* info );
85 
86 void getri( int n, complex<float>* A, int lda, const int* ipiv,
87  complex<float>* work, int lwork, int* info );
88 
89 void getri( int n, complex<double>* A, int lda, const int* ipiv,
90  complex<double>* work, int lwork, int* info );
92 //*************************************************************************************************
93 
94 
95 //*************************************************************************************************
131 inline void getri( int n, float* A, int lda, const int* ipiv, float* work, int lwork, int* info )
132 {
133 #if defined(INTEL_MKL_VERSION)
134  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
135 #endif
136 
137  sgetri_( &n, A, &lda, const_cast<int*>( ipiv ), work, &lwork, info );
138 }
139 //*************************************************************************************************
140 
141 
142 //*************************************************************************************************
178 inline void getri( int n, double* A, int lda, const int* ipiv, double* work, int lwork, int* info )
179 {
180 #if defined(INTEL_MKL_VERSION)
181  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
182 #endif
183 
184  dgetri_( &n, A, &lda, const_cast<int*>( ipiv ), work, &lwork, info );
185 }
186 //*************************************************************************************************
187 
188 
189 //*************************************************************************************************
225 inline void getri( int n, complex<float>* A, int lda, const int* ipiv,
226  complex<float>* work, int lwork, int* info )
227 {
228  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
229 
230 #if defined(INTEL_MKL_VERSION)
231  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
232  using ET = MKL_Complex8;
233 #else
234  using ET = float;
235 #endif
236 
237  cgetri_( &n, reinterpret_cast<ET*>( A ), &lda, const_cast<int*>( ipiv ),
238  reinterpret_cast<ET*>( work ), &lwork, info );
239 }
240 //*************************************************************************************************
241 
242 
243 //*************************************************************************************************
279 inline void getri( int n, complex<double>* A, int lda, const int* ipiv,
280  complex<double>* work, int lwork, int* info )
281 {
282  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
283 
284 #if defined(INTEL_MKL_VERSION)
285  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
286  using ET = MKL_Complex16;
287 #else
288  using ET = double;
289 #endif
290 
291  zgetri_( &n, reinterpret_cast<ET*>( A ), &lda, const_cast<int*>( ipiv ),
292  reinterpret_cast<ET*>( work ), &lwork, info );
293 }
294 //*************************************************************************************************
295 
296 } // namespace blaze
297 
298 #endif
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Compile time assertion.
void getri(int n, float *A, int lda, const int *ipiv, float *work, int lwork, int *info)
LAPACK kernel for the inversion of the given dense general single precision column-major square matri...
Definition: getri.h:131
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