Blaze  3.6
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 #include <blaze/util/Types.h>
46 
47 
48 //=================================================================================================
49 //
50 // LAPACK FORWARD DECLARATIONS
51 //
52 //=================================================================================================
53 
54 //*************************************************************************************************
56 #if !defined(INTEL_MKL_VERSION)
57 extern "C" {
58 
59 void sgetrs_( char* trans, int* n, int* nrhs, float* A, int* lda, int* ipiv,
60  float* B, int* ldb, int* info, blaze::fortran_charlen_t ntrans );
61 void dgetrs_( char* trans, int* n, int* nrhs, double* A, int* lda, int* ipiv,
62  double* B, int* ldb, int* info, blaze::fortran_charlen_t ntrans );
63 void cgetrs_( char* trans, int* n, int* nrhs, float* A, int* lda, int* ipiv,
64  float* B, int* ldb, int* info, blaze::fortran_charlen_t ntrans );
65 void zgetrs_( char* trans, int* n, int* nrhs, double* A, int* lda, int* ipiv,
66  double* B, int* ldb, int* info, blaze::fortran_charlen_t ntrans );
67 
68 }
69 #endif
70 
71 //*************************************************************************************************
72 
73 
74 
75 
76 namespace blaze {
77 
78 //=================================================================================================
79 //
80 // LAPACK LU-BASED SUBSTITUTION FUNCTIONS (GETRS)
81 //
82 //=================================================================================================
83 
84 //*************************************************************************************************
87 void getrs( char trans, int n, int nrhs, const float* A, int lda, const int* ipiv,
88  float* B, int ldb, int* info );
89 
90 void getrs( char trans, int n, int nrhs, const double* A, int lda, const int* ipiv,
91  double* B, int ldb, int* info );
92 
93 void getrs( char trans, int n, int nrhs, const complex<float>* A, int lda,
94  const int* ipiv, complex<float>* B, int ldb, int* info );
95 
96 void getrs( char trans, int n, int nrhs, const complex<double>* A, int lda,
97  const int* ipiv, complex<double>* B, int ldb, int* info );
99 //*************************************************************************************************
100 
101 
102 //*************************************************************************************************
141 inline void getrs( char trans, int n, int nrhs, const float* A, int lda,
142  const int* ipiv, float* B, int ldb, int* info )
143 {
144 #if defined(INTEL_MKL_VERSION)
145  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
146 #endif
147 
148  sgetrs_( &trans, &n, &nrhs, const_cast<float*>( A ), &lda,
149  const_cast<int*>( ipiv ), B, &ldb, info, blaze::fortran_charlen_t(1) );
150 }
151 //*************************************************************************************************
152 
153 
154 //*************************************************************************************************
193 inline void getrs( char trans, int n, int nrhs, const double* A, int lda,
194  const int* ipiv, double* B, int ldb, int* info )
195 {
196 #if defined(INTEL_MKL_VERSION)
197  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
198 #endif
199 
200  dgetrs_( &trans, &n, &nrhs, const_cast<double*>( A ), &lda,
201  const_cast<int*>( ipiv ), B, &ldb, info, blaze::fortran_charlen_t(1) );
202 }
203 //*************************************************************************************************
204 
205 
206 //*************************************************************************************************
245 inline void getrs( char trans, int n, int nrhs, const complex<float>* A, int lda,
246  const int* ipiv, complex<float>* B, int ldb, int* info )
247 {
248  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
249 
250 #if defined(INTEL_MKL_VERSION)
251  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
252  using ET = MKL_Complex8;
253 #else
254  using ET = float;
255 #endif
256 
257  cgetrs_( &trans, &n, &nrhs, const_cast<ET*>( reinterpret_cast<const ET*>( A ) ),
258  &lda, const_cast<int*>( ipiv ), reinterpret_cast<ET*>( B ), &ldb, info,
260 }
261 //*************************************************************************************************
262 
263 
264 //*************************************************************************************************
303 inline void getrs( char trans, int n, int nrhs, const complex<double>* A, int lda,
304  const 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  zgetrs_( &trans, &n, &nrhs, const_cast<ET*>( reinterpret_cast<const ET*>( A ) ),
316  &lda, const_cast<int*>( ipiv ), reinterpret_cast<ET*>( B ), &ldb, info,
318 }
319 //*************************************************************************************************
320 
321 } // namespace blaze
322 
323 #endif
Header file for basic type definitions.
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:141
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
Size type of the Blaze library.