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 extern "C" {
56 
57 void sgetri_( int* n, float* A, int* lda, int* ipiv, float* work, int* lwork, int* info );
58 void dgetri_( int* n, double* A, int* lda, int* ipiv, double* work, int* lwork, int* info );
59 void cgetri_( int* n, float* A, int* lda, int* ipiv, float* work, int* lwork, int* info );
60 void zgetri_( int* n, double* A, int* lda, int* ipiv, double* work, int* lwork, int* info );
61 
62 }
64 //*************************************************************************************************
65 
66 
67 
68 
69 namespace blaze {
70 
71 //=================================================================================================
72 //
73 // LAPACK LU-BASED INVERSION FUNCTIONS (GETRI)
74 //
75 //=================================================================================================
76 
77 //*************************************************************************************************
80 inline void getri( int n, float* A, int lda, const int* ipiv, float* work, int lwork, int* info );
81 
82 inline void getri( int n, double* A, int lda, const int* ipiv, double* work, int lwork, int* info );
83 
84 inline void getri( int n, complex<float>* A, int lda, const int* ipiv,
85  complex<float>* work, int lwork, int* info );
86 
87 inline void getri( int n, complex<double>* A, int lda, const int* ipiv,
88  complex<double>* work, int lwork, int* info );
90 //*************************************************************************************************
91 
92 
93 //*************************************************************************************************
129 inline void getri( int n, float* A, int lda, const int* ipiv, float* work, int lwork, int* info )
130 {
131  sgetri_( &n, A, &lda, const_cast<int*>( ipiv ), work, &lwork, info );
132 }
133 //*************************************************************************************************
134 
135 
136 //*************************************************************************************************
172 inline void getri( int n, double* A, int lda, const int* ipiv, double* work, int lwork, int* info )
173 {
174  dgetri_( &n, A, &lda, const_cast<int*>( ipiv ), work, &lwork, info );
175 }
176 //*************************************************************************************************
177 
178 
179 //*************************************************************************************************
215 inline void getri( int n, complex<float>* A, int lda, const int* ipiv,
216  complex<float>* work, int lwork, int* info )
217 {
218  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
219 
220  cgetri_( &n, reinterpret_cast<float*>( A ), &lda, const_cast<int*>( ipiv ),
221  reinterpret_cast<float*>( work ), &lwork, info );
222 }
223 //*************************************************************************************************
224 
225 
226 //*************************************************************************************************
262 inline void getri( int n, complex<double>* A, int lda, const int* ipiv,
263  complex<double>* work, int lwork, int* info )
264 {
265  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
266 
267  zgetri_( &n, reinterpret_cast<double*>( A ), &lda, const_cast<int*>( ipiv ),
268  reinterpret_cast<double*>( work ), &lwork, info );
269 }
270 //*************************************************************************************************
271 
272 } // namespace blaze
273 
274 #endif
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
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:129
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