getrf.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_LAPACK_CLAPACK_GETRF_H_
36 #define _BLAZE_MATH_LAPACK_CLAPACK_GETRF_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 sgetrf_( int* m, int* n, float* A, int* lda, int* ipiv, int* info );
59 void dgetrf_( int* m, int* n, double* A, int* lda, int* ipiv, int* info );
60 void cgetrf_( int* m, int* n, float* A, int* lda, int* ipiv, int* info );
61 void zgetrf_( int* m, int* n, double* A, int* lda, int* ipiv, int* info );
62 
63 }
64 #endif
65 
66 //*************************************************************************************************
67 
68 
69 
70 
71 namespace blaze {
72 
73 //=================================================================================================
74 //
75 // LAPACK LU DECOMPOSITION FUNCTIONS (GETRF)
76 //
77 //=================================================================================================
78 
79 //*************************************************************************************************
82 inline void getrf( int m, int n, float* A, int lda, int* ipiv, int* info );
83 
84 inline void getrf( int m, int n, double* A, int lda, int* ipiv, int* info );
85 
86 inline void getrf( int m, int n, complex<float>* A, int lda, int* ipiv, int* info );
87 
88 inline void getrf( int m, int n, complex<double>* A, int lda, int* ipiv, int* info );
90 //*************************************************************************************************
91 
92 
93 //*************************************************************************************************
131 inline void getrf( int m, int n, float* A, int lda, int* ipiv, int* info )
132 {
133 #if defined(INTEL_MKL_VERSION)
134  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
135 #endif
136 
137  sgetrf_( &m, &n, A, &lda, ipiv, info );
138 }
139 //*************************************************************************************************
140 
141 
142 //*************************************************************************************************
180 inline void getrf( int m, int n, double* A, int lda, int* ipiv, int* info )
181 {
182 #if defined(INTEL_MKL_VERSION)
183  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
184 #endif
185 
186  dgetrf_( &m, &n, A, &lda, ipiv, info );
187 }
188 //*************************************************************************************************
189 
190 
191 //*************************************************************************************************
229 inline void getrf( int m, int n, complex<float>* A, int lda, int* ipiv, int* 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( int ) );
235  using ET = MKL_Complex8;
236 #else
237  using ET = float;
238 #endif
239 
240  cgetrf_( &m, &n, reinterpret_cast<ET*>( A ), &lda, ipiv, info );
241 }
242 //*************************************************************************************************
243 
244 
245 //*************************************************************************************************
283 inline void getrf( int m, int n, complex<double>* A, int lda, int* ipiv, int* info )
284 {
285  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
286 
287 #if defined(INTEL_MKL_VERSION)
288  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
289  using ET = MKL_Complex16;
290 #else
291  using ET = double;
292 #endif
293 
294  zgetrf_( &m, &n, reinterpret_cast<ET*>( A ), &lda, ipiv, info );
295 }
296 //*************************************************************************************************
297 
298 } // namespace blaze
299 
300 #endif
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Compile time assertion.
void getrf(int m, int n, float *A, int lda, int *ipiv, int *info)
LAPACK kernel for the LU decomposition of the given dense general single precision column-major matri...
Definition: getrf.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