Blaze 3.9
posv.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_LAPACK_CLAPACK_POSV_H_
36#define _BLAZE_MATH_LAPACK_CLAPACK_POSV_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 sposv_( 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 dposv_( 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 cposv_( 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 zposv_( 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 POSITIVE DEFINITE LINEAR SYSTEM FUNCTIONS (POSV)
86//
87//=================================================================================================
88
89//*************************************************************************************************
92void posv( char uplo, blas_int_t n, blas_int_t nrhs, float* A, blas_int_t lda,
93 float* B, blas_int_t ldb, blas_int_t* info );
94
95void posv( char uplo, blas_int_t n, blas_int_t nrhs, double* A, blas_int_t lda,
96 double* B, blas_int_t ldb, blas_int_t* info );
97
98void posv( char uplo, blas_int_t n, blas_int_t nrhs, complex<float>* A, blas_int_t lda,
99 complex<float>* B, blas_int_t ldb, blas_int_t* info );
100
101void posv( char uplo, blas_int_t n, blas_int_t nrhs, complex<double>* A, blas_int_t lda,
102 complex<double>* B, blas_int_t ldb, blas_int_t* info );
104//*************************************************************************************************
105
106
107//*************************************************************************************************
152inline void posv( char uplo, blas_int_t n, blas_int_t nrhs, float* A, blas_int_t lda,
153 float* B, blas_int_t ldb, blas_int_t* info )
154{
155#if defined(INTEL_MKL_VERSION)
156 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
157#endif
158
159 sposv_( &uplo, &n, &nrhs, A, &lda, B, &ldb, info
160#if !defined(INTEL_MKL_VERSION)
162#endif
163 );
164}
165//*************************************************************************************************
166
167
168//*************************************************************************************************
213inline void posv( char uplo, blas_int_t n, blas_int_t nrhs, double* A, blas_int_t lda,
214 double* B, blas_int_t ldb, 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 dposv_( &uplo, &n, &nrhs, A, &lda, B, &ldb, info
221#if !defined(INTEL_MKL_VERSION)
223#endif
224 );
225}
226//*************************************************************************************************
227
228
229//*************************************************************************************************
274inline void posv( char uplo, blas_int_t n, blas_int_t nrhs, complex<float>* A, blas_int_t lda,
275 complex<float>* B, blas_int_t ldb, blas_int_t* info )
276{
277 BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
278
279#if defined(INTEL_MKL_VERSION)
280 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
281 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex8 ) == sizeof( complex<float> ) );
282 using ET = MKL_Complex8;
283#else
284 using ET = float;
285#endif
286
287 cposv_( &uplo, &n, &nrhs, reinterpret_cast<ET*>( A ), &lda,
288 reinterpret_cast<ET*>( B ), &ldb, info
289#if !defined(INTEL_MKL_VERSION)
291#endif
292 );
293}
294//*************************************************************************************************
295
296
297//*************************************************************************************************
342inline void posv( char uplo, blas_int_t n, blas_int_t nrhs, complex<double>* A, blas_int_t lda,
343 complex<double>* B, blas_int_t ldb, blas_int_t* info )
344{
345 BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
346
347#if defined(INTEL_MKL_VERSION)
348 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
349 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex16 ) == sizeof( complex<double> ) );
350 using ET = MKL_Complex16;
351#else
352 using ET = double;
353#endif
354
355 zposv_( &uplo, &n, &nrhs, reinterpret_cast<ET*>( A ), &lda,
356 reinterpret_cast<ET*>( B ), &ldb, info
357#if !defined(INTEL_MKL_VERSION)
359#endif
360 );
361}
362//*************************************************************************************************
363
364} // namespace blaze
365
366#endif
Header file for the complex data type.
Compile time assertion.
Complex data type of the Blaze library.
void posv(DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO2 > &B, char uplo)
LAPACK kernel for solving a positive definite linear system of equations ( ).
Definition: posv.h:256
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.