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 extern "C" {
56 
57 void sgesv_( int* n, int* nrhs, float* A, int* lda, int* ipiv, float* b, int* ldb, int* info );
58 void dgesv_( int* n, int* nrhs, double* A, int* lda, int* ipiv, double* b, int* ldb, int* info );
59 void cgesv_( int* n, int* nrhs, float* A, int* lda, int* ipiv, float* b, int* ldb, int* info );
60 void zgesv_( int* n, int* nrhs, double* A, int* lda, int* ipiv, double* b, int* ldb, int* info );
61 
62 }
64 //*************************************************************************************************
65 
66 
67 
68 
69 namespace blaze {
70 
71 //=================================================================================================
72 //
73 // LAPACK GENERAL LINEAR SYSTEM FUNCTIONS (GESV)
74 //
75 //=================================================================================================
76 
77 //*************************************************************************************************
80 inline void gesv( int n, int nrhs, float* A, int lda, int* ipiv, float* B, int ldb, int* info );
81 
82 inline void gesv( int n, int nrhs, double* A, int lda, int* ipiv, double* B, int ldb, int* info );
83 
84 inline void gesv( int n, int nrhs, complex<float>* A, int lda, int* ipiv, complex<float>* B, int ldb, int* info );
85 
86 inline void gesv( int n, int nrhs, complex<double>* A, int lda, int* ipiv, complex<double>* B, int ldb, int* info );
88 //*************************************************************************************************
89 
90 
91 //*************************************************************************************************
133 inline void gesv( int n, int nrhs, float* A, int lda, int* ipiv, float* B, int ldb, int* info )
134 {
135  sgesv_( &n, &nrhs, A, &lda, ipiv, B, &ldb, info );
136 }
137 //*************************************************************************************************
138 
139 
140 //*************************************************************************************************
182 inline void gesv( int n, int nrhs, double* A, int lda, int* ipiv, double* B, int ldb, int* info )
183 {
184  dgesv_( &n, &nrhs, A, &lda, ipiv, B, &ldb, info );
185 }
186 //*************************************************************************************************
187 
188 
189 //*************************************************************************************************
231 inline void gesv( int n, int nrhs, complex<float>* A, int lda, int* ipiv, complex<float>* B, int ldb, int* info )
232 {
233  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
234 
235  cgesv_( &n, &nrhs, reinterpret_cast<float*>( A ), &lda, ipiv,
236  reinterpret_cast<float*>( B ), &ldb, info );
237 }
238 //*************************************************************************************************
239 
240 
241 //*************************************************************************************************
283 inline void gesv( int n, int nrhs, complex<double>* A, int lda, int* ipiv, complex<double>* B, int ldb, int* info )
284 {
285  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
286 
287  zgesv_( &n, &nrhs, reinterpret_cast<double*>( A ), &lda, ipiv,
288  reinterpret_cast<double*>( B ), &ldb, info );
289 }
290 //*************************************************************************************************
291 
292 } // namespace blaze
293 
294 #endif
Log level for high-level information.
Definition: LogLevel.h:80
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:133
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