Blaze  3.6
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 
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 sposv_( char* uplo, int* n, int* nrhs, float* A, int* lda, float* b, int* ldb,
60  int* info, blaze::fortran_charlen_t nuplo );
61 void dposv_( char* uplo, int* n, int* nrhs, double* A, int* lda, double* b, int* ldb,
62  int* info, blaze::fortran_charlen_t nuplo );
63 void cposv_( char* uplo, int* n, int* nrhs, float* A, int* lda, float* b, int* ldb,
64  int* info, blaze::fortran_charlen_t nuplo );
65 void zposv_( char* uplo, int* n, int* nrhs, double* A, int* lda, double* b, int* ldb,
66  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 POSITIVE DEFINITE LINEAR SYSTEM FUNCTIONS (POSV)
81 //
82 //=================================================================================================
83 
84 //*************************************************************************************************
87 void posv( char uplo, int n, int nrhs, float* A, int lda, float* B, int ldb, int* info );
88 
89 void posv( char uplo, int n, int nrhs, double* A, int lda, double* B, int ldb, int* info );
90 
91 void posv( char uplo, int n, int nrhs, complex<float>* A, int lda, complex<float>* B, int ldb, int* info );
92 
93 void posv( char uplo, int n, int nrhs, complex<double>* A, int lda, complex<double>* B, int ldb, int* info );
95 //*************************************************************************************************
96 
97 
98 //*************************************************************************************************
143 inline void posv( char uplo, int n, int nrhs, float* A, int lda, float* B, int ldb, int* info )
144 {
145 #if defined(INTEL_MKL_VERSION)
146  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
147 #endif
148 
149  sposv_( &uplo, &n, &nrhs, A, &lda, B, &ldb, info, blaze::fortran_charlen_t(1) );
150 }
151 //*************************************************************************************************
152 
153 
154 //*************************************************************************************************
199 inline void posv( char uplo, int n, int nrhs, double* A, int lda, double* B, int ldb, int* info )
200 {
201 #if defined(INTEL_MKL_VERSION)
202  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
203 #endif
204 
205  dposv_( &uplo, &n, &nrhs, A, &lda, B, &ldb, info, blaze::fortran_charlen_t(1) );
206 }
207 //*************************************************************************************************
208 
209 
210 //*************************************************************************************************
255 inline void posv( char uplo, int n, int nrhs, complex<float>* A, int lda, complex<float>* B, int ldb, int* info )
256 {
257  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
258 
259 #if defined(INTEL_MKL_VERSION)
260  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
261  using ET = MKL_Complex8;
262 #else
263  using ET = float;
264 #endif
265 
266  cposv_( &uplo, &n, &nrhs, reinterpret_cast<ET*>( A ), &lda,
267  reinterpret_cast<ET*>( B ), &ldb, info, blaze::fortran_charlen_t(1) );
268 }
269 //*************************************************************************************************
270 
271 
272 //*************************************************************************************************
317 inline void posv( char uplo, int n, int nrhs, complex<double>* A, int lda, complex<double>* B, int ldb, int* info )
318 {
319  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
320 
321 #if defined(INTEL_MKL_VERSION)
322  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
323  using ET = MKL_Complex16;
324 #else
325  using ET = double;
326 #endif
327 
328  zposv_( &uplo, &n, &nrhs, reinterpret_cast<ET*>( A ), &lda,
329  reinterpret_cast<ET*>( B ), &ldb, info, blaze::fortran_charlen_t(1) );
330 }
331 //*************************************************************************************************
332 
333 } // namespace blaze
334 
335 #endif
Header file for basic type definitions.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Compile time assertion.
void posv(char uplo, int n, int nrhs, float *A, int lda, float *B, int ldb, int *info)
LAPACK kernel for solving a positive definite single precision linear system of equations ( ).
Definition: posv.h:143
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
Size type of the Blaze library.