potrs.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_LAPACK_CLAPACK_POTRS_H_
36 #define _BLAZE_MATH_LAPACK_CLAPACK_POTRS_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 spotrs_( char* uplo, int* n, int* nrhs, float* A, int* lda, float* B, int* ldb, int* info );
59 void dpotrs_( char* uplo, int* n, int* nrhs, double* A, int* lda, double* B, int* ldb, int* info );
60 void cpotrs_( char* uplo, int* n, int* nrhs, float* A, int* lda, float* B, int* ldb, int* info );
61 void zpotrs_( char* uplo, int* n, int* nrhs, double* A, int* lda, double* B, int* ldb, int* info );
62 
63 }
64 #endif
65 
66 //*************************************************************************************************
67 
68 
69 
70 
71 namespace blaze {
72 
73 //=================================================================================================
74 //
75 // LAPACK LLH-BASED SUBSTITUTION FUNCTIONS (POTRS)
76 //
77 //=================================================================================================
78 
79 //*************************************************************************************************
82 inline void potrs( char uplo, int n, int nrhs, const float* A, int lda, float* B, int ldb, int* info );
83 
84 inline void potrs( char uplo, int n, int nrhs, const double* A, int lda, double* B, int ldb, int* info );
85 
86 inline void potrs( char uplo, int n, int nrhs, const complex<float>* A, int lda, complex<float>* B, int ldb, int* info );
87 
88 inline void potrs( char uplo, int n, int nrhs, const complex<double>* A, int lda, complex<double>* B, int ldb, int* info );
90 //*************************************************************************************************
91 
92 
93 //*************************************************************************************************
126 inline void potrs( char uplo, int n, int nrhs, const float* A, int lda, float* B, int ldb, int* info )
127 {
128 #if defined(INTEL_MKL_VERSION)
129  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
130 #endif
131 
132  spotrs_( &uplo, &n, &nrhs, const_cast<float*>( A ), &lda, B, &ldb, info );
133 }
134 //*************************************************************************************************
135 
136 
137 //*************************************************************************************************
170 inline void potrs( char uplo, int n, int nrhs, const double* A, int lda, double* B, int ldb, int* info )
171 {
172 #if defined(INTEL_MKL_VERSION)
173  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
174 #endif
175 
176  dpotrs_( &uplo, &n, &nrhs, const_cast<double*>( A ), &lda, B, &ldb, info );
177 }
178 //*************************************************************************************************
179 
180 
181 //*************************************************************************************************
214 inline void potrs( char uplo, int n, int nrhs, const complex<float>* A,
215  int lda, complex<float>* B, int ldb, int* info )
216 {
217  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
218 
219 #if defined(INTEL_MKL_VERSION)
220  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
221  using ET = MKL_Complex8;
222 #else
223  using ET = float;
224 #endif
225 
226  cpotrs_( &uplo, &n, &nrhs, const_cast<ET*>( reinterpret_cast<const ET*>( A ) ),
227  &lda, reinterpret_cast<ET*>( B ), &ldb, info );
228 }
229 //*************************************************************************************************
230 
231 
232 //*************************************************************************************************
265 inline void potrs( char uplo, int n, int nrhs, const complex<double>* A,
266  int lda, complex<double>* B, int ldb, int* info )
267 {
268  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
269 
270 #if defined(INTEL_MKL_VERSION)
271  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
272  using ET = MKL_Complex16;
273 #else
274  using ET = double;
275 #endif
276 
277  zpotrs_( &uplo, &n, &nrhs, const_cast<ET*>( reinterpret_cast<const ET*>( A ) ),
278  &lda, reinterpret_cast<ET*>( B ), &ldb, info );
279 }
280 //*************************************************************************************************
281 
282 } // namespace blaze
283 
284 #endif
void potrs(char uplo, int n, int nrhs, const float *A, int lda, float *B, int ldb, int *info)
LAPACK kernel for the substitution step of solving a positive definite single precision linear system...
Definition: potrs.h:126
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