Blaze 3.9
sysv.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_LAPACK_CLAPACK_SYSV_H_
36#define _BLAZE_MATH_LAPACK_CLAPACK_SYSV_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 ssysv_( char* uplo, blaze::blas_int_t* n, blaze::blas_int_t* nrhs, float* A,
61 blaze::blas_int_t* lda, blaze::blas_int_t* ipiv, float* b, blaze::blas_int_t* ldb,
62 float* work, blaze::blas_int_t* lwork, blaze::blas_int_t* info,
64void dsysv_( char* uplo, blaze::blas_int_t* n, blaze::blas_int_t* nrhs, double* A,
65 blaze::blas_int_t* lda, blaze::blas_int_t* ipiv, double* b, blaze::blas_int_t* ldb,
66 double* work, blaze::blas_int_t* lwork, blaze::blas_int_t* info,
68void csysv_( char* uplo, blaze::blas_int_t* n, blaze::blas_int_t* nrhs, float* A,
69 blaze::blas_int_t* lda, blaze::blas_int_t* ipiv, float* b, blaze::blas_int_t* ldb,
70 float* work, blaze::blas_int_t* lwork, blaze::blas_int_t* info,
72void zsysv_( char* uplo, blaze::blas_int_t* n, blaze::blas_int_t* nrhs, double* A,
73 blaze::blas_int_t* lda, blaze::blas_int_t* ipiv, double* b, blaze::blas_int_t* ldb,
74 double* work, blaze::blas_int_t* lwork, blaze::blas_int_t* info,
76
77}
78#endif
80//*************************************************************************************************
81
82
83
84
85namespace blaze {
86
87//=================================================================================================
88//
89// LAPACK SYMMETRIC INDEFINITE LINEAR SYSTEM FUNCTIONS (SYSV)
90//
91//=================================================================================================
92
93//*************************************************************************************************
96void sysv( char uplo, blas_int_t n, blas_int_t nrhs, float* A, blas_int_t lda,
97 blas_int_t* ipiv, float* B, blas_int_t ldb, float* work, blas_int_t lwork,
98 blas_int_t* info );
99
100void sysv( char uplo, blas_int_t n, blas_int_t nrhs, double* A, blas_int_t lda,
101 blas_int_t* ipiv, double* B, blas_int_t ldb, double* work, blas_int_t lwork,
102 blas_int_t* info );
103
104void sysv( char uplo, blas_int_t n, blas_int_t nrhs, complex<float>* A, blas_int_t lda,
106 blas_int_t lwork, blas_int_t* info );
107
108void sysv( char uplo, blas_int_t n, blas_int_t nrhs, complex<double>* A, blas_int_t lda,
110 blas_int_t lwork, blas_int_t* info );
112//*************************************************************************************************
113
114
115//*************************************************************************************************
164inline void sysv( char uplo, blas_int_t n, blas_int_t nrhs, float* A, blas_int_t lda,
165 blas_int_t* ipiv, float* B, blas_int_t ldb, float* work, blas_int_t lwork,
166 blas_int_t* info )
167{
168#if defined(INTEL_MKL_VERSION)
169 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
170#endif
171
172 ssysv_( &uplo, &n, &nrhs, A, &lda, ipiv, B, &ldb, work, &lwork, info
173#if !defined(INTEL_MKL_VERSION)
175#endif
176 );
177}
178//*************************************************************************************************
179
180
181//*************************************************************************************************
230inline void sysv( char uplo, blas_int_t n, blas_int_t nrhs, double* A, blas_int_t lda,
231 blas_int_t* ipiv, double* B, blas_int_t ldb, double* work, blas_int_t lwork,
232 blas_int_t* info )
233{
234#if defined(INTEL_MKL_VERSION)
235 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
236#endif
237
238 dsysv_( &uplo, &n, &nrhs, A, &lda, ipiv, B, &ldb, work, &lwork, info
239#if !defined(INTEL_MKL_VERSION)
241#endif
242 );
243}
244//*************************************************************************************************
245
246
247//*************************************************************************************************
296inline void sysv( char uplo, blas_int_t n, blas_int_t nrhs, complex<float>* A, blas_int_t lda,
297 blas_int_t* ipiv, complex<float>* B, blas_int_t ldb, complex<float>* work,
298 blas_int_t lwork, blas_int_t* info )
299{
300 BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
301
302#if defined(INTEL_MKL_VERSION)
303 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
304 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex8 ) == sizeof( complex<float> ) );
305 using ET = MKL_Complex8;
306#else
307 using ET = float;
308#endif
309
310 csysv_( &uplo, &n, &nrhs, reinterpret_cast<ET*>( A ), &lda, ipiv,
311 reinterpret_cast<ET*>( B ), &ldb, reinterpret_cast<ET*>( work ), &lwork, info
312#if !defined(INTEL_MKL_VERSION)
314#endif
315 );
316}
317//*************************************************************************************************
318
319
320//*************************************************************************************************
369inline void sysv( char uplo, blas_int_t n, blas_int_t nrhs, complex<double>* A, blas_int_t lda,
370 blas_int_t* ipiv, complex<double>* B, blas_int_t ldb, complex<double>* work,
371 blas_int_t lwork, blas_int_t* info )
372{
373 BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
374
375#if defined(INTEL_MKL_VERSION)
376 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
377 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex16 ) == sizeof( complex<double> ) );
378 using ET = MKL_Complex16;
379#else
380 using ET = double;
381#endif
382
383 zsysv_( &uplo, &n, &nrhs, reinterpret_cast<ET*>( A ), &lda, ipiv,
384 reinterpret_cast<ET*>( B ), &ldb, reinterpret_cast<ET*>( work ), &lwork, info
385#if !defined(INTEL_MKL_VERSION)
387#endif
388 );
389}
390//*************************************************************************************************
391
392} // namespace blaze
393
394#endif
Header file for the complex data type.
Compile time assertion.
Complex data type of the Blaze library.
void sysv(DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO2 > &B, char uplo, blas_int_t *ipiv)
LAPACK kernel for solving a symmetric indefinite linear system of equations ( ).
Definition: sysv.h:266
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.