Blaze  3.6
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 #include <blaze/util/Types.h>
46 
47 
48 //=================================================================================================
49 //
50 // LAPACK FORWARD DECLARATIONS
51 //
52 //=================================================================================================
53 
54 //*************************************************************************************************
56 #if !defined(INTEL_MKL_VERSION)
57 extern "C" {
58 
59 void ssysv_( char* uplo, int* n, int* nrhs, float* A, int* lda, int* ipiv, float* b, int* ldb,
60  float* work, int* lwork, int* info, blaze::fortran_charlen_t nuplo );
61 void dsysv_( char* uplo, int* n, int* nrhs, double* A, int* lda, int* ipiv, double* b, int* ldb,
62  double* work, int* lwork, int* info, blaze::fortran_charlen_t nuplo );
63 void csysv_( char* uplo, int* n, int* nrhs, float* A, int* lda, int* ipiv, float* b, int* ldb,
64  float* work, int* lwork, int* info, blaze::fortran_charlen_t nuplo );
65 void zsysv_( char* uplo, int* n, int* nrhs, double* A, int* lda, int* ipiv, double* b, int* ldb,
66  double* work, int* lwork, int* info, blaze::fortran_charlen_t nuplo );
67 
68 }
69 #endif
70 
71 //*************************************************************************************************
72 
73 
74 
75 
76 namespace blaze {
77 
78 //=================================================================================================
79 //
80 // LAPACK SYMMETRIC INDEFINITE LINEAR SYSTEM FUNCTIONS (SYSV)
81 //
82 //=================================================================================================
83 
84 //*************************************************************************************************
87 void sysv( char uplo, int n, int nrhs, float* A, int lda, int* ipiv,
88  float* B, int ldb, float* work, int lwork, int* info );
89 
90 void sysv( char uplo, int n, int nrhs, double* A, int lda, int* ipiv,
91  double* B, int ldb, double* work, int lwork, int* info );
92 
93 void sysv( char uplo, int n, int nrhs, complex<float>* A, int lda, int* ipiv,
94  complex<float>* B, int ldb, complex<float>* work, int lwork, int* info );
95 
96 void sysv( char uplo, int n, int nrhs, complex<double>* A, int lda, int* ipiv,
97  complex<double>* B, int ldb, complex<double>* work, int lwork, int* info );
99 //*************************************************************************************************
100 
101 
102 //*************************************************************************************************
151 inline void sysv( char uplo, int n, int nrhs, float* A, int lda, int* ipiv,
152  float* B, int ldb, float* work, int lwork, int* info )
153 {
154 #if defined(INTEL_MKL_VERSION)
155  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
156 #endif
157 
158  ssysv_( &uplo, &n, &nrhs, A, &lda, ipiv, B, &ldb, work, &lwork,
159  info, blaze::fortran_charlen_t(1) );
160 }
161 //*************************************************************************************************
162 
163 
164 //*************************************************************************************************
213 inline void sysv( char uplo, int n, int nrhs, double* A, int lda, int* ipiv,
214  double* B, int ldb, double* work, int lwork, int* info )
215 {
216 #if defined(INTEL_MKL_VERSION)
217  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
218 #endif
219 
220  dsysv_( &uplo, &n, &nrhs, A, &lda, ipiv, B, &ldb, work, &lwork,
221  info, blaze::fortran_charlen_t(1) );
222 }
223 //*************************************************************************************************
224 
225 
226 //*************************************************************************************************
275 inline void sysv( char uplo, int n, int nrhs, complex<float>* A, int lda, int* ipiv,
276  complex<float>* B, int ldb, complex<float>* work, int lwork, int* info )
277 {
278  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
279 
280 #if defined(INTEL_MKL_VERSION)
281  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
282  using ET = MKL_Complex8;
283 #else
284  using ET = float;
285 #endif
286 
287  csysv_( &uplo, &n, &nrhs, reinterpret_cast<ET*>( A ), &lda, ipiv,
288  reinterpret_cast<ET*>( B ), &ldb, reinterpret_cast<ET*>( work ),
289  &lwork, info, blaze::fortran_charlen_t(1) );
290 }
291 //*************************************************************************************************
292 
293 
294 //*************************************************************************************************
343 inline void sysv( char uplo, int n, int nrhs, complex<double>* A, int lda, int* ipiv,
344  complex<double>* B, int ldb, complex<double>* work, int lwork, int* info )
345 {
346  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
347 
348 #if defined(INTEL_MKL_VERSION)
349  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
350  using ET = MKL_Complex16;
351 #else
352  using ET = double;
353 #endif
354 
355  zsysv_( &uplo, &n, &nrhs, reinterpret_cast<ET*>( A ), &lda, ipiv,
356  reinterpret_cast<ET*>( B ), &ldb, reinterpret_cast<ET*>( work ),
357  &lwork, info, blaze::fortran_charlen_t(1) );
358 }
359 //*************************************************************************************************
360 
361 } // namespace blaze
362 
363 #endif
Header file for basic type definitions.
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:151
Size type of the Blaze library.