Blaze 3.9
sytrf.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_LAPACK_CLAPACK_SYTRF_H_
36#define _BLAZE_MATH_LAPACK_CLAPACK_SYTRF_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)
58extern "C" {
59
60void ssytrf_( char* uplo, blaze::blas_int_t* n, float* A, blaze::blas_int_t* lda,
61 blaze::blas_int_t* ipiv, float* work, blaze::blas_int_t* lwork,
63void dsytrf_( char* uplo, blaze::blas_int_t* n, double* A, blaze::blas_int_t* lda,
64 blaze::blas_int_t* ipiv, double* work, blaze::blas_int_t* lwork,
66void csytrf_( char* uplo, blaze::blas_int_t* n, float* A, blaze::blas_int_t* lda,
67 blaze::blas_int_t* ipiv, float* work, blaze::blas_int_t* lwork,
69void zsytrf_( char* uplo, blaze::blas_int_t* n, double* A, blaze::blas_int_t* lda,
70 blaze::blas_int_t* ipiv, double* work, blaze::blas_int_t* lwork,
72
73}
74#endif
76//*************************************************************************************************
77
78
79
80
81namespace blaze {
82
83//=================================================================================================
84//
85// LAPACK LDLT DECOMPOSITION FUNCTIONS (SYTRF)
86//
87//=================================================================================================
88
89//*************************************************************************************************
92void sytrf( char uplo, blas_int_t n, float* A, blas_int_t lda, blas_int_t* ipiv,
93 float* work, blas_int_t lwork, blas_int_t* info );
94
95void sytrf( char uplo, blas_int_t n, double* A, blas_int_t lda, blas_int_t* ipiv,
96 double* work, blas_int_t lwork, blas_int_t* info );
97
98void sytrf( char uplo, blas_int_t n, complex<float>* A, blas_int_t lda, blas_int_t* ipiv,
99 complex<float>* work, blas_int_t lwork, blas_int_t* info );
100
101void sytrf( char uplo, blas_int_t n, complex<double>* A, blas_int_t lda, blas_int_t* ipiv,
102 complex<double>* work, blas_int_t lwork, blas_int_t* info );
104//*************************************************************************************************
105
106
107//*************************************************************************************************
155inline void sytrf( char uplo, blas_int_t n, float* A, blas_int_t lda, blas_int_t* ipiv,
156 float* work, blas_int_t lwork, blas_int_t* info )
157{
158#if defined(INTEL_MKL_VERSION)
159 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
160#endif
161
162 ssytrf_( &uplo, &n, A, &lda, ipiv, work, &lwork, info
163#if !defined(INTEL_MKL_VERSION)
165#endif
166 );
167}
168//*************************************************************************************************
169
170
171//*************************************************************************************************
219inline void sytrf( char uplo, blas_int_t n, double* A, blas_int_t lda, blas_int_t* ipiv,
220 double* work, blas_int_t lwork, blas_int_t* info )
221{
222#if defined(INTEL_MKL_VERSION)
223 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
224#endif
225
226 dsytrf_( &uplo, &n, A, &lda, ipiv, work, &lwork, info
227#if !defined(INTEL_MKL_VERSION)
229#endif
230 );
231}
232//*************************************************************************************************
233
234
235//*************************************************************************************************
283inline void sytrf( char uplo, blas_int_t n, complex<float>* A, blas_int_t lda, blas_int_t* ipiv,
284 complex<float>* work, blas_int_t lwork, blas_int_t* info )
285{
286 BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
287
288#if defined(INTEL_MKL_VERSION)
289 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
290 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex8 ) == sizeof( complex<float> ) );
291 using ET = MKL_Complex8;
292#else
293 using ET = float;
294#endif
295
296 csytrf_( &uplo, &n, reinterpret_cast<ET*>( A ), &lda, ipiv,
297 reinterpret_cast<ET*>( work ), &lwork, info
298#if !defined(INTEL_MKL_VERSION)
300#endif
301 );
302}
303//*************************************************************************************************
304
305
306//*************************************************************************************************
354inline void sytrf( char uplo, blas_int_t n, complex<double>* A, blas_int_t lda, blas_int_t* ipiv,
355 complex<double>* work, blas_int_t lwork, blas_int_t* info )
356{
357 BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
358
359#if defined(INTEL_MKL_VERSION)
360 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
361 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex16 ) == sizeof( complex<double> ) );
362 using ET = MKL_Complex16;
363#else
364 using ET = double;
365#endif
366
367 zsytrf_( &uplo, &n, reinterpret_cast<ET*>( A ), &lda, ipiv,
368 reinterpret_cast<ET*>( work ), &lwork, info
369#if !defined(INTEL_MKL_VERSION)
371#endif
372 );
373}
374//*************************************************************************************************
375
376} // namespace blaze
377
378#endif
Header file for the complex data type.
Compile time assertion.
Complex data type of the Blaze library.
void sytrf(DenseMatrix< MT, SO > &A, char uplo, blas_int_t *ipiv)
LAPACK kernel for the decomposition of the given dense symmetric indefinite matrix.
Definition: sytrf.h:121
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.