Blaze  3.6
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 #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 strtrs_( char* uplo, char* trans, char* diag, int* n, int* nrhs, float* A, int* lda,
60  float* B, int* ldb, int* info, blaze::fortran_charlen_t nuplo,
62 void dtrtrs_( char* uplo, char* trans, char* diag, int* n, int* nrhs, double* A, int* lda,
63  double* B, int* ldb, int* info, blaze::fortran_charlen_t nuplo,
65 void ctrtrs_( char* uplo, char* trans, char* diag, int* n, int* nrhs, float* A, int* lda,
66  float* B, int* ldb, int* info, blaze::fortran_charlen_t nuplo,
68 void ztrtrs_( char* uplo, char* trans, char* diag, int* n, int* nrhs, double* A, int* lda,
69  double* B, int* ldb, int* info, blaze::fortran_charlen_t nuplo,
71 
72 }
73 #endif
74 
75 //*************************************************************************************************
76 
77 
78 
79 
80 namespace blaze {
81 
82 //=================================================================================================
83 //
84 // LAPACK TRIANGULAR SUBSTITUTION FUNCTIONS (TRTRS)
85 //
86 //=================================================================================================
87 
88 //*************************************************************************************************
91 void trtrs( char uplo, char trans, char diag, int n, int nrhs, const float* A,
92  int lda, float* B, int ldb, int* info );
93 
94 void trtrs( char uplo, char trans, char diag, int n, int nrhs, const double* A,
95  int lda, double* B, int ldb, int* info );
96 
97 void trtrs( char uplo, char trans, char diag, int n, int nrhs, const complex<float>* A,
98  int lda, complex<float>* B, int ldb, int* info );
99 
100 void trtrs( char uplo, char trans, char diag, int n, int nrhs, const complex<double>* A,
101  int lda, complex<double>* B, int ldb, int* info );
103 //*************************************************************************************************
104 
105 
106 //*************************************************************************************************
146 inline void trtrs( char uplo, char trans, char diag, int n, int nrhs, const float* A, int lda,
147  float* B, int ldb, int* info )
148 {
149 #if defined(INTEL_MKL_VERSION)
150  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
151 #endif
152 
153  strtrs_( &uplo, &trans, &diag, &n, &nrhs, const_cast<float*>( A ), &lda, B, &ldb, info,
155 }
156 //*************************************************************************************************
157 
158 
159 //*************************************************************************************************
199 inline void trtrs( char uplo, char trans, char diag, int n, int nrhs, const double* A, int lda,
200  double* B, int ldb, int* info )
201 {
202 #if defined(INTEL_MKL_VERSION)
203  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
204 #endif
205 
206  dtrtrs_( &uplo, &trans, &diag, &n, &nrhs, const_cast<double*>( A ), &lda, B, &ldb, info,
208 }
209 //*************************************************************************************************
210 
211 
212 //*************************************************************************************************
252 inline void trtrs( char uplo, char trans, char diag, int n, int nrhs, const complex<float>* A,
253  int lda, complex<float>* B, int ldb, int* info )
254 {
255  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
256 
257 #if defined(INTEL_MKL_VERSION)
258  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
259  using ET = MKL_Complex8;
260 #else
261  using ET = float;
262 #endif
263 
264  ctrtrs_( &uplo, &trans, &diag, &n, &nrhs, const_cast<ET*>( reinterpret_cast<const ET*>( A ) ),
265  &lda, reinterpret_cast<ET*>( B ), &ldb, info, blaze::fortran_charlen_t(1),
267 }
268 //*************************************************************************************************
269 
270 
271 //*************************************************************************************************
311 inline void trtrs( char uplo, char trans, char diag, int n, int nrhs, const complex<double>* A,
312  int lda, complex<double>* B, int ldb, int* info )
313 {
314  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
315 
316 #if defined(INTEL_MKL_VERSION)
317  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
318  using ET = MKL_Complex16;
319 #else
320  using ET = double;
321 #endif
322 
323  ztrtrs_( &uplo, &trans, &diag, &n, &nrhs, const_cast<ET*>( reinterpret_cast<const ET*>( A ) ),
324  &lda, reinterpret_cast<ET*>( B ), &ldb, info, blaze::fortran_charlen_t(1),
326 }
327 //*************************************************************************************************
328 
329 } // namespace blaze
330 
331 #endif
Header file for basic type definitions.
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:146
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.