Blaze 3.9
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
44#include <blaze/util/Complex.h>
46#include <blaze/util/Types.h>
47
48
49//=================================================================================================
50//
51// LAPACK FORWARD DECLARATIONS
52//
53//=================================================================================================
54
55//*************************************************************************************************
57#if !defined(INTEL_MKL_VERSION)
58extern "C" {
59
60void strtrs_( char* uplo, char* trans, char* diag, blaze::blas_int_t* n, blaze::blas_int_t* nrhs,
61 float* A, blaze::blas_int_t* lda, float* B, blaze::blas_int_t* ldb,
64void dtrtrs_( char* uplo, char* trans, char* diag, blaze::blas_int_t* n, blaze::blas_int_t* nrhs,
65 double* A, blaze::blas_int_t* lda, double* B, blaze::blas_int_t* ldb,
68void ctrtrs_( char* uplo, char* trans, char* diag, blaze::blas_int_t* n, blaze::blas_int_t* nrhs,
69 float* A, blaze::blas_int_t* lda, float* B, blaze::blas_int_t* ldb,
72void ztrtrs_( char* uplo, char* trans, char* diag, blaze::blas_int_t* n, blaze::blas_int_t* nrhs,
73 double* A, blaze::blas_int_t* lda, double* B, blaze::blas_int_t* ldb,
76
77}
78#endif
80//*************************************************************************************************
81
82
83
84
85namespace blaze {
86
87//=================================================================================================
88//
89// LAPACK TRIANGULAR SUBSTITUTION FUNCTIONS (TRTRS)
90//
91//=================================================================================================
92
93//*************************************************************************************************
96void trtrs( char uplo, char trans, char diag, blas_int_t n, blas_int_t nrhs,
97 const float* A, blas_int_t lda, float* B, blas_int_t ldb,
98 blas_int_t* info );
99
100void trtrs( char uplo, char trans, char diag, blas_int_t n, blas_int_t nrhs,
101 const double* A, blas_int_t lda, double* B, blas_int_t ldb,
102 blas_int_t* info );
103
104void trtrs( char uplo, char trans, char diag, blas_int_t n, blas_int_t nrhs,
105 const complex<float>* A, blas_int_t lda, complex<float>* B,
106 blas_int_t ldb, blas_int_t* info );
107
108void trtrs( char uplo, char trans, char diag, blas_int_t n, blas_int_t nrhs,
110 blas_int_t ldb, blas_int_t* info );
112//*************************************************************************************************
113
114
115//*************************************************************************************************
155inline void trtrs( char uplo, char trans, char diag, blas_int_t n, blas_int_t nrhs,
156 const float* A, blas_int_t lda, float* B, blas_int_t ldb,
157 blas_int_t* info )
158{
159#if defined(INTEL_MKL_VERSION)
160 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
161#endif
162
163 strtrs_( &uplo, &trans, &diag, &n, &nrhs, const_cast<float*>( A ), &lda, B, &ldb, info
164#if !defined(INTEL_MKL_VERSION)
166#endif
167 );
168}
169//*************************************************************************************************
170
171
172//*************************************************************************************************
212inline void trtrs( char uplo, char trans, char diag, blas_int_t n, blas_int_t nrhs,
213 const double* A, blas_int_t lda, double* B, blas_int_t ldb,
214 blas_int_t* info )
215{
216#if defined(INTEL_MKL_VERSION)
217 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
218#endif
219
220 dtrtrs_( &uplo, &trans, &diag, &n, &nrhs, const_cast<double*>( A ), &lda, B, &ldb, info
221#if !defined(INTEL_MKL_VERSION)
223#endif
224 );
225}
226//*************************************************************************************************
227
228
229//*************************************************************************************************
269inline void trtrs( char uplo, char trans, char diag, blas_int_t n, blas_int_t nrhs,
270 const complex<float>* A, blas_int_t lda, complex<float>* B,
271 blas_int_t ldb, blas_int_t* info )
272{
273 BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
274
275#if defined(INTEL_MKL_VERSION)
276 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
277 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex8 ) == sizeof( complex<float> ) );
278 using ET = MKL_Complex8;
279#else
280 using ET = float;
281#endif
282
283 ctrtrs_( &uplo, &trans, &diag, &n, &nrhs, const_cast<ET*>( reinterpret_cast<const ET*>( A ) ),
284 &lda, reinterpret_cast<ET*>( B ), &ldb, info
285#if !defined(INTEL_MKL_VERSION)
287#endif
288 );
289}
290//*************************************************************************************************
291
292
293//*************************************************************************************************
333inline void trtrs( char uplo, char trans, char diag, blas_int_t n, blas_int_t nrhs,
334 const complex<double>* A, blas_int_t lda, complex<double>* B,
335 blas_int_t ldb, blas_int_t* info )
336{
337 BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
338
339#if defined(INTEL_MKL_VERSION)
340 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
341 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex16 ) == sizeof( complex<double> ) );
342 using ET = MKL_Complex16;
343#else
344 using ET = double;
345#endif
346
347 ztrtrs_( &uplo, &trans, &diag, &n, &nrhs, const_cast<ET*>( reinterpret_cast<const ET*>( A ) ),
348 &lda, reinterpret_cast<ET*>( B ), &ldb, info
349#if !defined(INTEL_MKL_VERSION)
351#endif
352 );
353}
354//*************************************************************************************************
355
356} // namespace blaze
357
358#endif
Header file for the complex data type.
Compile time assertion.
Complex data type of the Blaze library.
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:766
void trtrs(const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO2 > &B, char uplo, char trans, char diag)
LAPACK kernel for the substitution step of solving a triangular linear system of equations ( ).
Definition: trtrs.h:316
int32_t blas_int_t
Signed integer type used in the BLAS/LAPACK wrapper functions.
Definition: Types.h:64
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.
Definition: StaticAssert.h:112
size_t fortran_charlen_t
Type of the hidden arguments of character type within a Fortran forward declaration.
Definition: Types.h:186
Header file for basic BLAS type definitions.
Header file for basic type definitions.