Blaze  3.6
potrf.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_LAPACK_CLAPACK_POTRF_H_
36 #define _BLAZE_MATH_LAPACK_CLAPACK_POTRF_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 spotrf_( char* uplo, int* n, float* A, int* lda, int* info, blaze::fortran_charlen_t nuplo );
60 void dpotrf_( char* uplo, int* n, double* A, int* lda, int* info, blaze::fortran_charlen_t nuplo );
61 void cpotrf_( char* uplo, int* n, float* A, int* lda, int* info, blaze::fortran_charlen_t nuplo );
62 void zpotrf_( char* uplo, int* n, double* A, int* lda, int* info, blaze::fortran_charlen_t nuplo );
63 
64 }
65 #endif
66 
67 //*************************************************************************************************
68 
69 
70 
71 
72 namespace blaze {
73 
74 //=================================================================================================
75 //
76 // LAPACK LLH (CHOLESKY) DECOMPOSITION FUNCTIONS (POTRF)
77 //
78 //=================================================================================================
79 
80 //*************************************************************************************************
83 void potrf( char uplo, int n, float* A, int lda, int* info );
84 
85 void potrf( char uplo, int n, double* A, int lda, int* info );
86 
87 void potrf( char uplo, int n, complex<float>* A, int lda, int* info );
88 
89 void potrf( char uplo, int n, complex<double>* A, int lda, int* info );
91 //*************************************************************************************************
92 
93 
94 //*************************************************************************************************
132 inline void potrf( char uplo, int n, float* A, int lda, int* info )
133 {
134 #if defined(INTEL_MKL_VERSION)
135  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
136 #endif
137 
138  spotrf_( &uplo, &n, A, &lda, info, blaze::fortran_charlen_t(1) );
139 }
140 //*************************************************************************************************
141 
142 
143 //*************************************************************************************************
181 inline void potrf( char uplo, int n, double* A, int lda, int* info )
182 {
183 #if defined(INTEL_MKL_VERSION)
184  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
185 #endif
186 
187  dpotrf_( &uplo, &n, A, &lda, info, blaze::fortran_charlen_t(1) );
188 }
189 //*************************************************************************************************
190 
191 
192 //*************************************************************************************************
230 inline void potrf( char uplo, int n, complex<float>* A, int lda, int* info )
231 {
232  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
233 
234 #if defined(INTEL_MKL_VERSION)
235  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
236  using ET = MKL_Complex8;
237 #else
238  using ET = float;
239 #endif
240 
241  cpotrf_( &uplo, &n, reinterpret_cast<ET*>( A ), &lda, info, blaze::fortran_charlen_t(1) );
242 }
243 //*************************************************************************************************
244 
245 
246 //*************************************************************************************************
284 inline void potrf( char uplo, int n, complex<double>* A, int lda, int* info )
285 {
286  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
287 
288 #if defined(INTEL_MKL_VERSION)
289  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
290  using ET = MKL_Complex16;
291 #else
292  using ET = double;
293 #endif
294 
295  zpotrf_( &uplo, &n, reinterpret_cast<ET*>( A ), &lda, info, blaze::fortran_charlen_t(1) );
296 }
297 //*************************************************************************************************
298 
299 } // namespace blaze
300 
301 #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.
void potrf(char uplo, int n, float *A, int lda, int *info)
LAPACK kernel for the Cholesky decomposition of the given dense positive definite single precision co...
Definition: potrf.h:132
#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.