gesv.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_LAPACK_CLAPACK_GESV_H_
36 #define _BLAZE_MATH_LAPACK_CLAPACK_GESV_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 sgesv_( int* n, int* nrhs, float* A, int* lda, int* ipiv, float* b, int* ldb, int* info );
59 void dgesv_( int* n, int* nrhs, double* A, int* lda, int* ipiv, double* b, int* ldb, int* info );
60 void cgesv_( int* n, int* nrhs, float* A, int* lda, int* ipiv, float* b, int* ldb, int* info );
61 void zgesv_( int* n, int* nrhs, double* A, int* lda, int* ipiv, double* b, int* ldb, int* info );
62 
63 }
64 #endif
65 
66 //*************************************************************************************************
67 
68 
69 
70 
71 namespace blaze {
72 
73 //=================================================================================================
74 //
75 // LAPACK GENERAL LINEAR SYSTEM FUNCTIONS (GESV)
76 //
77 //=================================================================================================
78 
79 //*************************************************************************************************
82 inline void gesv( int n, int nrhs, float* A, int lda, int* ipiv, float* B, int ldb, int* info );
83 
84 inline void gesv( int n, int nrhs, double* A, int lda, int* ipiv, double* B, int ldb, int* info );
85 
86 inline void gesv( int n, int nrhs, complex<float>* A, int lda, int* ipiv, complex<float>* B, int ldb, int* info );
87 
88 inline void gesv( int n, int nrhs, complex<double>* A, int lda, int* ipiv, complex<double>* B, int ldb, int* info );
90 //*************************************************************************************************
91 
92 
93 //*************************************************************************************************
136 inline void gesv( int n, int nrhs, float* A, int lda, int* ipiv, float* B, int ldb, int* info )
137 {
138 #if defined(INTEL_MKL_VERSION)
139  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
140 #endif
141 
142  sgesv_( &n, &nrhs, A, &lda, ipiv, B, &ldb, info );
143 }
144 //*************************************************************************************************
145 
146 
147 //*************************************************************************************************
190 inline void gesv( int n, int nrhs, double* A, int lda, int* ipiv, double* B, int ldb, int* info )
191 {
192 #if defined(INTEL_MKL_VERSION)
193  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
194 #endif
195 
196  dgesv_( &n, &nrhs, A, &lda, ipiv, B, &ldb, info );
197 }
198 //*************************************************************************************************
199 
200 
201 //*************************************************************************************************
244 inline void gesv( int n, int nrhs, complex<float>* A, int lda, int* ipiv, complex<float>* B, int ldb, int* info )
245 {
246  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
247 
248 #if defined(INTEL_MKL_VERSION)
249  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
250  using ET = MKL_Complex8;
251 #else
252  using ET = float;
253 #endif
254 
255  cgesv_( &n, &nrhs, reinterpret_cast<ET*>( A ), &lda, ipiv,
256  reinterpret_cast<ET*>( B ), &ldb, info );
257 }
258 //*************************************************************************************************
259 
260 
261 //*************************************************************************************************
304 inline void gesv( int n, int nrhs, complex<double>* A, int lda, int* ipiv, complex<double>* B, int ldb, int* info )
305 {
306  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
307 
308 #if defined(INTEL_MKL_VERSION)
309  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
310  using ET = MKL_Complex16;
311 #else
312  using ET = double;
313 #endif
314 
315  zgesv_( &n, &nrhs, reinterpret_cast<ET*>( A ), &lda, ipiv,
316  reinterpret_cast<ET*>( B ), &ldb, info );
317 }
318 //*************************************************************************************************
319 
320 } // namespace blaze
321 
322 #endif
void gesv(int n, int nrhs, float *A, int lda, int *ipiv, float *B, int ldb, int *info)
LAPACK kernel for solving a general single precision linear system of equations ( )...
Definition: gesv.h:136
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
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