getrs.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_LAPACK_CLAPACK_GETRS_H_
36 #define _BLAZE_MATH_LAPACK_CLAPACK_GETRS_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 sgetrs_( char* trans, int* n, int* nrhs, float* A, int* lda, int* ipiv, float* B, int* ldb, int* info );
59 void dgetrs_( char* trans, int* n, int* nrhs, double* A, int* lda, int* ipiv, double* B, int* ldb, int* info );
60 void cgetrs_( char* trans, int* n, int* nrhs, float* A, int* lda, int* ipiv, float* B, int* ldb, int* info );
61 void zgetrs_( char* trans, 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 LU-BASED SUBSTITUTION FUNCTIONS (GETRS)
76 //
77 //=================================================================================================
78 
79 //*************************************************************************************************
82 inline void getrs( char trans, int n, int nrhs, const float* A, int lda, const int* ipiv,
83  float* B, int ldb, int* info );
84 
85 inline void getrs( char trans, int n, int nrhs, const double* A, int lda, const int* ipiv,
86  double* B, int ldb, int* info );
87 
88 inline void getrs( char trans, int n, int nrhs, const complex<float>* A, int lda,
89  const int* ipiv, complex<float>* B, int ldb, int* info );
90 
91 inline void getrs( char trans, int n, int nrhs, const complex<double>* A, int lda,
92  const int* ipiv, complex<double>* B, int ldb, int* info );
94 //*************************************************************************************************
95 
96 
97 //*************************************************************************************************
136 inline void getrs( char trans, int n, int nrhs, const float* A, int lda,
137  const int* ipiv, float* B, int ldb, int* info )
138 {
139 #if defined(INTEL_MKL_VERSION)
140  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
141 #endif
142 
143  sgetrs_( &trans, &n, &nrhs, const_cast<float*>( A ), &lda,
144  const_cast<int*>( ipiv ), B, &ldb, info );
145 }
146 //*************************************************************************************************
147 
148 
149 //*************************************************************************************************
188 inline void getrs( char trans, int n, int nrhs, const double* A, int lda,
189  const int* ipiv, double* B, int ldb, int* info )
190 {
191 #if defined(INTEL_MKL_VERSION)
192  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
193 #endif
194 
195  dgetrs_( &trans, &n, &nrhs, const_cast<double*>( A ), &lda,
196  const_cast<int*>( ipiv ), B, &ldb, info );
197 }
198 //*************************************************************************************************
199 
200 
201 //*************************************************************************************************
240 inline void getrs( char trans, int n, int nrhs, const complex<float>* A, int lda,
241  const int* ipiv, complex<float>* B, int ldb, int* info )
242 {
243  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
244 
245 #if defined(INTEL_MKL_VERSION)
246  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
247  using ET = MKL_Complex8;
248 #else
249  using ET = float;
250 #endif
251 
252  cgetrs_( &trans, &n, &nrhs, const_cast<ET*>( reinterpret_cast<const ET*>( A ) ),
253  &lda, const_cast<int*>( ipiv ), reinterpret_cast<ET*>( B ), &ldb, info );
254 }
255 //*************************************************************************************************
256 
257 
258 //*************************************************************************************************
297 inline void getrs( char trans, int n, int nrhs, const complex<double>* A, int lda,
298  const int* ipiv, complex<double>* B, int ldb, int* info )
299 {
300  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
301 
302 #if defined(INTEL_MKL_VERSION)
303  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
304  using ET = MKL_Complex16;
305 #else
306  using ET = double;
307 #endif
308 
309  zgetrs_( &trans, &n, &nrhs, const_cast<ET*>( reinterpret_cast<const ET*>( A ) ),
310  &lda, const_cast<int*>( ipiv ), reinterpret_cast<ET*>( B ), &ldb, info );
311 }
312 //*************************************************************************************************
313 
314 } // namespace blaze
315 
316 #endif
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Compile time assertion.
void getrs(char trans, int n, int nrhs, const float *A, int lda, const int *ipiv, float *B, int ldb, int *info)
LAPACK kernel for the substitution step of solving a general single precision linear system of equati...
Definition: getrs.h:136
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:765
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