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 
46 
47 //=================================================================================================
48 //
49 // LAPACK FORWARD DECLARATIONS
50 //
51 //=================================================================================================
52 
53 //*************************************************************************************************
55 extern "C" {
56 
57 void spotrf_( char* uplo, int* n, float* A, int* lda, int* info );
58 void dpotrf_( char* uplo, int* n, double* A, int* lda, int* info );
59 void cpotrf_( char* uplo, int* n, float* A, int* lda, int* info );
60 void zpotrf_( char* uplo, int* n, double* A, int* lda, int* info );
61 
62 }
64 //*************************************************************************************************
65 
66 
67 
68 
69 namespace blaze {
70 
71 //=================================================================================================
72 //
73 // LAPACK LLH (CHOLESKY) DECOMPOSITION FUNCTIONS (POTRF)
74 //
75 //=================================================================================================
76 
77 //*************************************************************************************************
80 inline void potrf( char uplo, int n, float* A, int lda, int* info );
81 
82 inline void potrf( char uplo, int n, double* A, int lda, int* info );
83 
84 inline void potrf( char uplo, int n, complex<float>* A, int lda, int* info );
85 
86 inline void potrf( char uplo, int n, complex<double>* A, int lda, int* info );
88 //*************************************************************************************************
89 
90 
91 //*************************************************************************************************
129 inline void potrf( char uplo, int n, float* A, int lda, int* info )
130 {
131  spotrf_( &uplo, &n, A, &lda, info );
132 }
133 //*************************************************************************************************
134 
135 
136 //*************************************************************************************************
174 inline void potrf( char uplo, int n, double* A, int lda, int* info )
175 {
176  dpotrf_( &uplo, &n, A, &lda, info );
177 }
178 //*************************************************************************************************
179 
180 
181 //*************************************************************************************************
219 inline void potrf( char uplo, int n, complex<float>* A, int lda, int* info )
220 {
221  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
222 
223  cpotrf_( &uplo, &n, reinterpret_cast<float*>( A ), &lda, info );
224 }
225 //*************************************************************************************************
226 
227 
228 //*************************************************************************************************
266 inline void potrf( char uplo, int n, complex<double>* A, int lda, int* info )
267 {
268  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
269 
270  zpotrf_( &uplo, &n, reinterpret_cast<double*>( A ), &lda, info );
271 }
272 //*************************************************************************************************
273 
274 } // namespace blaze
275 
276 #endif
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
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:129
#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