trtrs.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_LAPACK_CLAPACK_TRTRS_H_
36 #define _BLAZE_MATH_LAPACK_CLAPACK_TRTRS_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 strtrs_( char* uplo, char* trans, char* diag, int* n, int* nrhs, float* A, int* lda, float* B, int* ldb, int* info );
59 void dtrtrs_( char* uplo, char* trans, char* diag, int* n, int* nrhs, double* A, int* lda, double* B, int* ldb, int* info );
60 void ctrtrs_( char* uplo, char* trans, char* diag, int* n, int* nrhs, float* A, int* lda, float* B, int* ldb, int* info );
61 void ztrtrs_( char* uplo, char* trans, char* diag, int* n, int* nrhs, double* A, int* lda, double* B, int* ldb, int* info );
62 
63 }
64 #endif
65 
66 //*************************************************************************************************
67 
68 
69 
70 
71 namespace blaze {
72 
73 //=================================================================================================
74 //
75 // LAPACK TRIANGULAR SUBSTITUTION FUNCTIONS (TRTRS)
76 //
77 //=================================================================================================
78 
79 //*************************************************************************************************
82 inline void trtrs( char uplo, char trans, char diag, int n, int nrhs, const float* A,
83  int lda, float* B, int ldb, int* info );
84 
85 inline void trtrs( char uplo, char trans, char diag, int n, int nrhs, const double* A,
86  int lda, double* B, int ldb, int* info );
87 
88 inline void trtrs( char uplo, char trans, char diag, int n, int nrhs, const complex<float>* A,
89  int lda, complex<float>* B, int ldb, int* info );
90 
91 inline void trtrs( char uplo, char trans, char diag, int n, int nrhs, const complex<double>* A,
92  int lda, complex<double>* B, int ldb, int* info );
94 //*************************************************************************************************
95 
96 
97 //*************************************************************************************************
137 inline void trtrs( char uplo, char trans, char diag, int n, int nrhs, const float* A, int lda,
138  float* B, int ldb, int* info )
139 {
140 #if defined(INTEL_MKL_VERSION)
141  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
142 #endif
143 
144  strtrs_( &uplo, &trans, &diag, &n, &nrhs, const_cast<float*>( A ), &lda, B, &ldb, info );
145 }
146 //*************************************************************************************************
147 
148 
149 //*************************************************************************************************
189 inline void trtrs( char uplo, char trans, char diag, int n, int nrhs, const double* A, int lda,
190  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  dtrtrs_( &uplo, &trans, &diag, &n, &nrhs, const_cast<double*>( A ), &lda, B, &ldb, info );
197 }
198 //*************************************************************************************************
199 
200 
201 //*************************************************************************************************
241 inline void trtrs( char uplo, char trans, char diag, int n, int nrhs, const complex<float>* A,
242  int lda, complex<float>* B, int ldb, int* info )
243 {
244  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
245 
246 #if defined(INTEL_MKL_VERSION)
247  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
248  using ET = MKL_Complex8;
249 #else
250  using ET = float;
251 #endif
252 
253  ctrtrs_( &uplo, &trans, &diag, &n, &nrhs, const_cast<ET*>( reinterpret_cast<const ET*>( A ) ),
254  &lda, reinterpret_cast<ET*>( B ), &ldb, info );
255 }
256 //*************************************************************************************************
257 
258 
259 //*************************************************************************************************
299 inline void trtrs( char uplo, char trans, char diag, int n, int nrhs, const complex<double>* A,
300  int lda, complex<double>* B, int ldb, int* info )
301 {
302  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
303 
304 #if defined(INTEL_MKL_VERSION)
305  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
306  using ET = MKL_Complex16;
307 #else
308  using ET = double;
309 #endif
310 
311  ztrtrs_( &uplo, &trans, &diag, &n, &nrhs, const_cast<ET*>( reinterpret_cast<const ET*>( A ) ),
312  &lda, reinterpret_cast<ET*>( B ), &ldb, info );
313 }
314 //*************************************************************************************************
315 
316 } // namespace blaze
317 
318 #endif
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Compile time assertion.
void trtrs(char uplo, char trans, char diag, int n, int nrhs, const float *A, int lda, float *B, int ldb, int *info)
LAPACK kernel for the substitution step of solving a triangular single precision linear system of equ...
Definition: trtrs.h:137
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