Blaze 3.9
pstrf.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_LAPACK_CLAPACK_PSTRF_H_
36#define _BLAZE_MATH_LAPACK_CLAPACK_PSTRF_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 spstrf_( char* uplo, blaze::blas_int_t* n, float* A, blaze::blas_int_t* lda,
61 blaze::blas_int_t* piv, blaze::blas_int_t* rank, float* tol, float* work,
63void dpstrf_( char* uplo, blaze::blas_int_t* n, double* A, blaze::blas_int_t* lda,
64 blaze::blas_int_t* piv, blaze::blas_int_t* rank, double* tol, double* work,
66void cpstrf_( char* uplo, blaze::blas_int_t* n, float* A, blaze::blas_int_t* lda,
67 blaze::blas_int_t* piv, blaze::blas_int_t* rank, float* tol, float* work,
69void zpstrf_( char* uplo, blaze::blas_int_t* n, double* A, blaze::blas_int_t* lda,
70 blaze::blas_int_t* piv, blaze::blas_int_t* rank, double* tol, double* work,
72
73}
74#endif
76//*************************************************************************************************
77
78
79
80
81namespace blaze {
82
83//=================================================================================================
84//
85// LAPACK LLH PIVOTING (CHOLESKY) DECOMPOSITION FUNCTIONS (PSTRF)
86//
87//=================================================================================================
88
89//*************************************************************************************************
92void pstrf( char uplo, blas_int_t n, float* A, blas_int_t lda,
93 blaze::blas_int_t* piv, blaze::blas_int_t* rank, float tol, float* work,
94 blas_int_t* info );
95
96void pstrf( char uplo, blas_int_t n, double* A, blas_int_t lda,
97 blaze::blas_int_t* piv, blaze::blas_int_t* rank, double tol, double* work,
98 blas_int_t* info );
99
100void pstrf( char uplo, blas_int_t n, complex<float>* A, blas_int_t lda,
102 blas_int_t* info );
103
104void pstrf( char uplo, blas_int_t n, complex<double>* A, blas_int_t lda,
106 blas_int_t* info );
108//*************************************************************************************************
109
110
111//*************************************************************************************************
155inline void pstrf( char uplo, blas_int_t n, float* A, blas_int_t lda,
156 blaze::blas_int_t* piv, blaze::blas_int_t* rank, float tol,
157 float* work, blas_int_t* info )
158{
159#if defined(INTEL_MKL_VERSION)
160 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
161#endif
162
163 spstrf_( &uplo, &n, A, &lda, piv, rank, &tol, work, info
164#if !defined(INTEL_MKL_VERSION) && !defined(BLAS_H)
166#endif
167 );
168}
169//*************************************************************************************************
170
171
172//*************************************************************************************************
216inline void pstrf( char uplo, blas_int_t n, double* A, blas_int_t lda,
217 blaze::blas_int_t* piv, blaze::blas_int_t* rank, double tol,
218 double* work, blas_int_t* info )
219{
220#if defined(INTEL_MKL_VERSION)
221 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
222#endif
223
224 dpstrf_( &uplo, &n, A, &lda, piv, rank, &tol, work, info
225#if !defined(INTEL_MKL_VERSION) && !defined(BLAS_H)
227#endif
228 );
229}
230//*************************************************************************************************
231
232
233//*************************************************************************************************
277inline void pstrf( char uplo, blas_int_t n, complex<float>* A, blas_int_t lda,
278 blaze::blas_int_t* piv, blaze::blas_int_t* rank, float tol,
279 complex<float>* work, blas_int_t* info )
280{
281#if defined(INTEL_MKL_VERSION)
282 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
283#endif
284
285#if defined(INTEL_MKL_VERSION)
286 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
287 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex8 ) == sizeof( complex<float> ) );
288 using ET = MKL_Complex8;
289#else
290 using ET = float;
291#endif
292
293 cpstrf_( &uplo, &n, reinterpret_cast<ET*>(A), &lda, piv, rank,
294 &tol, reinterpret_cast<ET*>(work), info
295#if !defined(INTEL_MKL_VERSION) && !defined(BLAS_H)
297#endif
298 );
299}
300//*************************************************************************************************
301
302
303//*************************************************************************************************
347inline void pstrf( char uplo, blas_int_t n, complex<double>* A, blas_int_t lda,
348 blaze::blas_int_t* piv, blaze::blas_int_t* rank, double tol,
349 complex<double>* work, blas_int_t* info )
350{
351#if defined(INTEL_MKL_VERSION)
352 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
353#endif
354
355#if defined(INTEL_MKL_VERSION)
356 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
357 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex16 ) == sizeof( complex<double> ) );
358 using ET = MKL_Complex16;
359#else
360 using ET = double;
361#endif
362
363 zpstrf_( &uplo, &n, reinterpret_cast<ET*>(A), &lda, piv, rank,
364 &tol, reinterpret_cast<ET*>(work), info
365#if !defined(INTEL_MKL_VERSION) && !defined(BLAS_H)
367#endif
368 );
369}
370//*************************************************************************************************
371
372} // namespace blaze
373
374#endif
Header file for the complex data type.
Compile time assertion.
Complex data type of the Blaze library.
size_t rank(const DenseMatrix< MT, SO > &dm)
Computes the rank of the given dense matrix.
Definition: DenseMatrix.h:2715
blas_int_t pstrf(DenseMatrix< MT, SO > &A, char uplo, blas_int_t *piv, ST tol)
LAPACK kernel for the Cholesky decomposition of the given dense positive definite matrix.
Definition: pstrf.h:124
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.