Blaze 3.9
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
44#include <blaze/util/Complex.h>
46#include <blaze/util/Types.h>
47
48
49//=================================================================================================
50//
51// LAPACK FORWARD DECLARATIONS
52//
53//=================================================================================================
54
55//*************************************************************************************************
57#if !defined(INTEL_MKL_VERSION) && !defined(BLAS_H)
58extern "C" {
59
60void spotrf_( char* uplo, blaze::blas_int_t* n, float* A, blaze::blas_int_t* lda,
62void dpotrf_( char* uplo, blaze::blas_int_t* n, double* A, blaze::blas_int_t* lda,
64void cpotrf_( char* uplo, blaze::blas_int_t* n, float* A, blaze::blas_int_t* lda,
66void zpotrf_( char* uplo, blaze::blas_int_t* n, double* A, blaze::blas_int_t* lda,
68
69}
70#endif
72//*************************************************************************************************
73
74
75
76
77namespace blaze {
78
79//=================================================================================================
80//
81// LAPACK LLH (CHOLESKY) DECOMPOSITION FUNCTIONS (POTRF)
82//
83//=================================================================================================
84
85//*************************************************************************************************
88void potrf( char uplo, blas_int_t n, float* A, blas_int_t lda, blas_int_t* info );
89
90void potrf( char uplo, blas_int_t n, double* A, blas_int_t lda, blas_int_t* info );
91
92void potrf( char uplo, blas_int_t n, complex<float>* A, blas_int_t lda, blas_int_t* info );
93
94void potrf( char uplo, blas_int_t n, complex<double>* A, blas_int_t lda, blas_int_t* info );
96//*************************************************************************************************
97
98
99//*************************************************************************************************
137inline void potrf( char uplo, blas_int_t n, float* A, blas_int_t lda, blas_int_t* info )
138{
139#if defined(INTEL_MKL_VERSION)
140 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
141#endif
142
143 spotrf_( &uplo, &n, A, &lda, info
144#if !defined(INTEL_MKL_VERSION) && !defined(BLAS_H)
146#endif
147 );
148}
149//*************************************************************************************************
150
151
152//*************************************************************************************************
190inline void potrf( char uplo, blas_int_t n, double* A, blas_int_t lda, blas_int_t* info )
191{
192#if defined(INTEL_MKL_VERSION)
193 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
194#endif
195
196 dpotrf_( &uplo, &n, A, &lda, info
197#if !defined(INTEL_MKL_VERSION) && !defined(BLAS_H)
199#endif
200 );
201}
202//*************************************************************************************************
203
204
205//*************************************************************************************************
243inline void potrf( char uplo, blas_int_t n, complex<float>* A, blas_int_t lda, blas_int_t* info )
244{
245 BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
246
247#if defined(INTEL_MKL_VERSION)
248 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
249 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex8 ) == sizeof( complex<float> ) );
250 using ET = MKL_Complex8;
251#else
252 using ET = float;
253#endif
254
255 cpotrf_( &uplo, &n, reinterpret_cast<ET*>( A ), &lda, info
256#if !defined(INTEL_MKL_VERSION) && !defined(BLAS_H)
258#endif
259 );
260}
261//*************************************************************************************************
262
263
264//*************************************************************************************************
302inline void potrf( char uplo, blas_int_t n, complex<double>* A, blas_int_t lda, blas_int_t* info )
303{
304 BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
305
306#if defined(INTEL_MKL_VERSION)
307 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
308 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex16 ) == sizeof( complex<double> ) );
309 using ET = MKL_Complex16;
310#else
311 using ET = double;
312#endif
313
314 zpotrf_( &uplo, &n, reinterpret_cast<ET*>( A ), &lda, info
315#if !defined(INTEL_MKL_VERSION) && !defined(BLAS_H)
317#endif
318 );
319}
320//*************************************************************************************************
321
322} // namespace blaze
323
324#endif
Header file for the complex data type.
Compile time assertion.
Complex data type of the Blaze library.
void potrf(DenseMatrix< MT, SO > &A, char uplo)
LAPACK kernel for the Cholesky decomposition of the given dense positive definite matrix.
Definition: potrf.h:118
int32_t blas_int_t
Signed integer type used in the BLAS/LAPACK wrapper functions.
Definition: Types.h:64
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.
Definition: StaticAssert.h:112
size_t fortran_charlen_t
Type of the hidden arguments of character type within a Fortran forward declaration.
Definition: Types.h:186
Header file for basic BLAS type definitions.
Header file for basic type definitions.