Blaze 3.9
potrs.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_LAPACK_CLAPACK_POTRS_H_
36#define _BLAZE_MATH_LAPACK_CLAPACK_POTRS_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 spotrs_( char* uplo, blaze::blas_int_t* n, blaze::blas_int_t* nrhs, float* A,
61 blaze::blas_int_t* lda, float* B, blaze::blas_int_t* ldb,
63void dpotrs_( char* uplo, blaze::blas_int_t* n, blaze::blas_int_t* nrhs, double* A,
64 blaze::blas_int_t* lda, double* B, blaze::blas_int_t* ldb,
66void cpotrs_( char* uplo, blaze::blas_int_t* n, blaze::blas_int_t* nrhs, float* A,
67 blaze::blas_int_t* lda, float* B, blaze::blas_int_t* ldb,
69void zpotrs_( char* uplo, blaze::blas_int_t* n, blaze::blas_int_t* nrhs, double* A,
70 blaze::blas_int_t* lda, double* B, blaze::blas_int_t* ldb,
72
73}
74#endif
76//*************************************************************************************************
77
78
79
80
81namespace blaze {
82
83//=================================================================================================
84//
85// LAPACK LLH-BASED SUBSTITUTION FUNCTIONS (POTRS)
86//
87//=================================================================================================
88
89//*************************************************************************************************
92void potrs( char uplo, blas_int_t n, blas_int_t nrhs, const float* A, blas_int_t lda,
93 float* B, blas_int_t ldb, blas_int_t* info );
94
95void potrs( char uplo, blas_int_t n, blas_int_t nrhs, const double* A, blas_int_t lda,
96 double* B, blas_int_t ldb, blas_int_t* info );
97
98void potrs( char uplo, blas_int_t n, blas_int_t nrhs, const complex<float>* A, blas_int_t lda,
99 complex<float>* B, blas_int_t ldb, blas_int_t* info );
100
101void potrs( char uplo, blas_int_t n, blas_int_t nrhs, const complex<double>* A, blas_int_t lda,
102 complex<double>* B, blas_int_t ldb, blas_int_t* info );
104//*************************************************************************************************
105
106
107//*************************************************************************************************
140inline void potrs( char uplo, blas_int_t n, blas_int_t nrhs, const float* A, blas_int_t lda,
141 float* B, blas_int_t ldb, blas_int_t* info )
142{
143#if defined(INTEL_MKL_VERSION)
144 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
145#endif
146
147 spotrs_( &uplo, &n, &nrhs, const_cast<float*>( A ), &lda, B, &ldb, info
148#if !defined(INTEL_MKL_VERSION)
150#endif
151 );
152}
153//*************************************************************************************************
154
155
156//*************************************************************************************************
189inline void potrs( char uplo, blas_int_t n, blas_int_t nrhs, const double* A, blas_int_t lda,
190 double* B, blas_int_t ldb, blas_int_t* info )
191{
192#if defined(INTEL_MKL_VERSION)
193 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
194#endif
195
196 dpotrs_( &uplo, &n, &nrhs, const_cast<double*>( A ), &lda, B, &ldb, info
197#if !defined(INTEL_MKL_VERSION)
199#endif
200 );
201}
202//*************************************************************************************************
203
204
205//*************************************************************************************************
238inline void potrs( char uplo, blas_int_t n, blas_int_t nrhs, const complex<float>* A, blas_int_t lda,
239 complex<float>* B, blas_int_t ldb, blas_int_t* info )
240{
241 BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
242
243#if defined(INTEL_MKL_VERSION)
244 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
245 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex8 ) == sizeof( complex<float> ) );
246 using ET = MKL_Complex8;
247#else
248 using ET = float;
249#endif
250
251 cpotrs_( &uplo, &n, &nrhs, const_cast<ET*>( reinterpret_cast<const ET*>( A ) ),
252 &lda, reinterpret_cast<ET*>( B ), &ldb, info
253#if !defined(INTEL_MKL_VERSION)
255#endif
256 );
257}
258//*************************************************************************************************
259
260
261//*************************************************************************************************
294inline void potrs( char uplo, blas_int_t n, blas_int_t nrhs, const complex<double>* A, blas_int_t lda,
295 complex<double>* B, blas_int_t ldb, blas_int_t* info )
296{
297 BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
298
299#if defined(INTEL_MKL_VERSION)
300 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
301 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex16 ) == sizeof( complex<double> ) );
302 using ET = MKL_Complex16;
303#else
304 using ET = double;
305#endif
306
307 zpotrs_( &uplo, &n, &nrhs, const_cast<ET*>( reinterpret_cast<const ET*>( A ) ),
308 &lda, reinterpret_cast<ET*>( B ), &ldb, info
309#if !defined(INTEL_MKL_VERSION)
311#endif
312 );
313}
314//*************************************************************************************************
315
316} // namespace blaze
317
318#endif
Header file for the complex data type.
Compile time assertion.
Complex data type of the Blaze library.
void potrs(const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO2 > &B, char uplo)
LAPACK kernel for the substitution step of solving a positive definite linear system of equations ( )...
Definition: potrs.h:298
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.