Blaze 3.9
getrf.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_LAPACK_CLAPACK_GETRF_H_
36#define _BLAZE_MATH_LAPACK_CLAPACK_GETRF_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
44#include <blaze/util/Complex.h>
46
47
48//=================================================================================================
49//
50// LAPACK FORWARD DECLARATIONS
51//
52//=================================================================================================
53
54//*************************************************************************************************
56#if !defined(INTEL_MKL_VERSION) && !defined(BLAS_H)
57extern "C" {
58
59void sgetrf_( blaze::blas_int_t* m, blaze::blas_int_t* n, float* A, blaze::blas_int_t* lda,
61void dgetrf_( blaze::blas_int_t* m, blaze::blas_int_t* n, double* A, blaze::blas_int_t* lda,
63void cgetrf_( blaze::blas_int_t* m, blaze::blas_int_t* n, float* A, blaze::blas_int_t* lda,
65void zgetrf_( blaze::blas_int_t* m, blaze::blas_int_t* n, double* A, blaze::blas_int_t* lda,
67
68}
69#endif
71//*************************************************************************************************
72
73
74
75
76namespace blaze {
77
78//=================================================================================================
79//
80// LAPACK LU DECOMPOSITION FUNCTIONS (GETRF)
81//
82//=================================================================================================
83
84//*************************************************************************************************
87void getrf( blas_int_t m, blas_int_t n, float* A, blas_int_t lda,
88 blas_int_t* ipiv, blas_int_t* info );
89
90void getrf( blas_int_t m, blas_int_t n, double* A, blas_int_t lda,
91 blas_int_t* ipiv, blas_int_t* info );
92
94 blas_int_t* ipiv, blas_int_t* info );
95
97 blas_int_t* ipiv, blas_int_t* info );
99//*************************************************************************************************
100
101
102//*************************************************************************************************
140inline void getrf( blas_int_t m, blas_int_t n, float* A, blas_int_t lda,
141 blas_int_t* ipiv, blas_int_t* info )
142{
143#if defined(INTEL_MKL_VERSION)
144 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
145#endif
146
147 sgetrf_( &m, &n, A, &lda, ipiv, info );
148}
149//*************************************************************************************************
150
151
152//*************************************************************************************************
190inline void getrf( blas_int_t m, blas_int_t n, double* A, blas_int_t lda,
191 blas_int_t* ipiv, blas_int_t* info )
192{
193#if defined(INTEL_MKL_VERSION)
194 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
195#endif
196
197 dgetrf_( &m, &n, A, &lda, ipiv, info );
198}
199//*************************************************************************************************
200
201
202//*************************************************************************************************
240inline void getrf( blas_int_t m, blas_int_t n, complex<float>* A, blas_int_t lda,
241 blas_int_t* ipiv, blas_int_t* info )
242{
243 BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
244
245#if defined(INTEL_MKL_VERSION)
246 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
247 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex8 ) == sizeof( complex<float> ) );
248 using ET = MKL_Complex8;
249#else
250 using ET = float;
251#endif
252
253 cgetrf_( &m, &n, reinterpret_cast<ET*>( A ), &lda, ipiv, info );
254}
255//*************************************************************************************************
256
257
258//*************************************************************************************************
296inline void getrf( blas_int_t m, blas_int_t n, complex<double>* A, blas_int_t lda,
297 blas_int_t* ipiv, blas_int_t* info )
298{
299 BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
300
301#if defined(INTEL_MKL_VERSION)
302 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
303 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex16 ) == sizeof( complex<double> ) );
304 using ET = MKL_Complex16;
305#else
306 using ET = double;
307#endif
308
309 zgetrf_( &m, &n, reinterpret_cast<ET*>( A ), &lda, ipiv, info );
310}
311//*************************************************************************************************
312
313} // namespace blaze
314
315#endif
Header file for the complex data type.
Compile time assertion.
Complex data type of the Blaze library.
void getrf(DenseMatrix< MT, SO > &A, blas_int_t *ipiv)
LAPACK kernel for the LU decomposition of the given dense general matrix.
Definition: getrf.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
Header file for basic BLAS type definitions.