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 
43 #include <blaze/util/Complex.h>
45 
46 
47 //=================================================================================================
48 //
49 // LAPACK FORWARD DECLARATIONS
50 //
51 //=================================================================================================
52 
53 //*************************************************************************************************
55 #if !defined(INTEL_MKL_VERSION)
56 extern "C" {
57 
58 void ssysv_( char* uplo, int* n, int* nrhs, float* A, int* lda, int* ipiv, float* b, int* ldb, float* work, int* lwork, int* info );
59 void dsysv_( char* uplo, int* n, int* nrhs, double* A, int* lda, int* ipiv, double* b, int* ldb, double* work, int* lwork, int* info );
60 void csysv_( char* uplo, int* n, int* nrhs, float* A, int* lda, int* ipiv, float* b, int* ldb, float* work, int* lwork, int* info );
61 void zsysv_( char* uplo, int* n, int* nrhs, double* A, int* lda, int* ipiv, double* b, int* ldb, double* work, int* lwork, int* info );
62 
63 }
64 #endif
65 
66 //*************************************************************************************************
67 
68 
69 
70 
71 namespace blaze {
72 
73 //=================================================================================================
74 //
75 // LAPACK SYMMETRIC INDEFINITE LINEAR SYSTEM FUNCTIONS (SYSV)
76 //
77 //=================================================================================================
78 
79 //*************************************************************************************************
82 inline void sysv( char uplo, int n, int nrhs, float* A, int lda, int* ipiv,
83  float* B, int ldb, float* work, int lwork, int* info );
84 
85 inline void sysv( char uplo, int n, int nrhs, double* A, int lda, int* ipiv,
86  double* B, int ldb, double* work, int lwork, int* info );
87 
88 inline void sysv( char uplo, int n, int nrhs, complex<float>* A, int lda, int* ipiv,
89  complex<float>* B, int ldb, complex<float>* work, int lwork, int* info );
90 
91 inline void sysv( char uplo, int n, int nrhs, complex<double>* A, int lda, int* ipiv,
92  complex<double>* B, int ldb, complex<double>* work, int lwork, int* info );
94 //*************************************************************************************************
95 
96 
97 //*************************************************************************************************
146 inline void sysv( char uplo, int n, int nrhs, float* A, int lda, int* ipiv,
147  float* B, int ldb, float* work, int lwork, int* info )
148 {
149 #if defined(INTEL_MKL_VERSION)
150  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
151 #endif
152 
153  ssysv_( &uplo, &n, &nrhs, A, &lda, ipiv, B, &ldb, work, &lwork, info );
154 }
155 //*************************************************************************************************
156 
157 
158 //*************************************************************************************************
207 inline void sysv( char uplo, int n, int nrhs, double* A, int lda, int* ipiv,
208  double* B, int ldb, double* work, int lwork, int* info )
209 {
210 #if defined(INTEL_MKL_VERSION)
211  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
212 #endif
213 
214  dsysv_( &uplo, &n, &nrhs, A, &lda, ipiv, B, &ldb, work, &lwork, info );
215 }
216 //*************************************************************************************************
217 
218 
219 //*************************************************************************************************
268 inline void sysv( char uplo, int n, int nrhs, complex<float>* A, int lda, int* ipiv,
269  complex<float>* B, int ldb, complex<float>* work, int lwork, int* info )
270 {
271  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
272 
273 #if defined(INTEL_MKL_VERSION)
274  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
275  using ET = MKL_Complex8;
276 #else
277  using ET = float;
278 #endif
279 
280  csysv_( &uplo, &n, &nrhs, reinterpret_cast<ET*>( A ), &lda, ipiv,
281  reinterpret_cast<ET*>( B ), &ldb, reinterpret_cast<ET*>( work ), &lwork, info );
282 }
283 //*************************************************************************************************
284 
285 
286 //*************************************************************************************************
335 inline void sysv( char uplo, int n, int nrhs, complex<double>* A, int lda, int* ipiv,
336  complex<double>* B, int ldb, complex<double>* work, int lwork, int* info )
337 {
338  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
339 
340 #if defined(INTEL_MKL_VERSION)
341  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
342  using ET = MKL_Complex16;
343 #else
344  using ET = double;
345 #endif
346 
347  zsysv_( &uplo, &n, &nrhs, reinterpret_cast<ET*>( A ), &lda, ipiv,
348  reinterpret_cast<ET*>( B ), &ldb, reinterpret_cast<ET*>( work ), &lwork, info );
349 }
350 //*************************************************************************************************
351 
352 } // namespace blaze
353 
354 #endif
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Compile time assertion.
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
void sysv(char uplo, int n, int nrhs, float *A, int lda, int *ipiv, float *B, int ldb, float *work, int lwork, int *info)
LAPACK kernel for solving a symmetric indefinite single precision linear system of equations ( )...
Definition: sysv.h:146