Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
math
lapack
clapack
getri.h
Go to the documentation of this file.
1
//=================================================================================================
33
//=================================================================================================
34
35
#ifndef _BLAZE_MATH_LAPACK_CLAPACK_GETRI_H_
36
#define _BLAZE_MATH_LAPACK_CLAPACK_GETRI_H_
37
38
39
//*************************************************************************************************
40
// Includes
41
//*************************************************************************************************
42
43
#include <
blaze/math/blas/Types.h
>
44
#include <
blaze/util/Complex.h
>
45
#include <
blaze/util/StaticAssert.h
>
46
47
48
//=================================================================================================
49
//
50
// LAPACK FORWARD DECLARATIONS
51
//
52
//=================================================================================================
53
54
//*************************************************************************************************
56
#if !defined(INTEL_MKL_VERSION)
57
extern
"C"
{
58
59
void
sgetri_(
blaze::blas_int_t
* n,
float
* A,
blaze::blas_int_t
* lda,
blaze::blas_int_t
* ipiv,
60
float
* work,
blaze::blas_int_t
* lwork,
blaze::blas_int_t
* info );
61
void
dgetri_(
blaze::blas_int_t
* n,
double
* A,
blaze::blas_int_t
* lda,
blaze::blas_int_t
* ipiv,
62
double
* work,
blaze::blas_int_t
* lwork,
blaze::blas_int_t
* info );
63
void
cgetri_(
blaze::blas_int_t
* n,
float
* A,
blaze::blas_int_t
* lda,
blaze::blas_int_t
* ipiv,
64
float
* work,
blaze::blas_int_t
* lwork,
blaze::blas_int_t
* info );
65
void
zgetri_(
blaze::blas_int_t
* n,
double
* A,
blaze::blas_int_t
* lda,
blaze::blas_int_t
* ipiv,
66
double
* work,
blaze::blas_int_t
* lwork,
blaze::blas_int_t
* info );
67
68
}
69
#endif
71
//*************************************************************************************************
72
73
74
75
76
namespace
blaze {
77
78
//=================================================================================================
79
//
80
// LAPACK LU-BASED INVERSION FUNCTIONS (GETRI)
81
//
82
//=================================================================================================
83
84
//*************************************************************************************************
87
void
getri
(
blas_int_t
n,
float
* A,
blas_int_t
lda,
const
blas_int_t
* ipiv,
88
float
* work,
blas_int_t
lwork,
blas_int_t
* info );
89
90
void
getri
(
blas_int_t
n,
double
* A,
blas_int_t
lda,
const
blas_int_t
* ipiv,
91
double
* work,
blas_int_t
lwork,
blas_int_t
* info );
92
93
void
getri
(
blas_int_t
n, complex<float>* A,
blas_int_t
lda,
const
blas_int_t
* ipiv,
94
complex<float>* work,
blas_int_t
lwork,
blas_int_t
* info );
95
96
void
getri
(
blas_int_t
n, complex<double>* A,
blas_int_t
lda,
const
blas_int_t
* ipiv,
97
complex<double>* work,
blas_int_t
lwork,
blas_int_t
* info );
99
//*************************************************************************************************
100
101
102
//*************************************************************************************************
138
inline
void
getri
(
blas_int_t
n,
float
* A,
blas_int_t
lda,
const
blas_int_t
* ipiv,
139
float
* work,
blas_int_t
lwork,
blas_int_t
* info )
140
{
141
#if defined(INTEL_MKL_VERSION)
142
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_INT ) ==
sizeof
(
blas_int_t
) );
143
#endif
144
145
sgetri_( &n, A, &lda,
const_cast<
blas_int_t
*
>
( ipiv ), work, &lwork, info );
146
}
147
//*************************************************************************************************
148
149
150
//*************************************************************************************************
186
inline
void
getri
(
blas_int_t
n,
double
* A,
blas_int_t
lda,
const
blas_int_t
* ipiv,
187
double
* work,
blas_int_t
lwork,
blas_int_t
* info )
188
{
189
#if defined(INTEL_MKL_VERSION)
190
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_INT ) ==
sizeof
(
blas_int_t
) );
191
#endif
192
193
dgetri_( &n, A, &lda,
const_cast<
blas_int_t
*
>
( ipiv ), work, &lwork, info );
194
}
195
//*************************************************************************************************
196
197
198
//*************************************************************************************************
234
inline
void
getri
(
blas_int_t
n, complex<float>* A,
blas_int_t
lda,
const
blas_int_t
* ipiv,
235
complex<float>* work,
blas_int_t
lwork,
blas_int_t
* info )
236
{
237
BLAZE_STATIC_ASSERT
(
sizeof
( complex<float> ) == 2UL*
sizeof
(
float
) );
238
239
#if defined(INTEL_MKL_VERSION)
240
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_INT ) ==
sizeof
(
blas_int_t
) );
241
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_Complex8 ) ==
sizeof
( complex<float> ) );
242
using
ET = MKL_Complex8;
243
#else
244
using
ET = float;
245
#endif
246
247
cgetri_( &n,
reinterpret_cast<
ET*
>
( A ), &lda,
const_cast<
blas_int_t
*
>
( ipiv ),
248
reinterpret_cast<
ET*
>
( work ), &lwork, info );
249
}
250
//*************************************************************************************************
251
252
253
//*************************************************************************************************
289
inline
void
getri
(
blas_int_t
n, complex<double>* A,
blas_int_t
lda,
const
blas_int_t
* ipiv,
290
complex<double>* work,
blas_int_t
lwork,
blas_int_t
* info )
291
{
292
BLAZE_STATIC_ASSERT
(
sizeof
( complex<double> ) == 2UL*
sizeof
(
double
) );
293
294
#if defined(INTEL_MKL_VERSION)
295
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_INT ) ==
sizeof
(
blas_int_t
) );
296
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_Complex16 ) ==
sizeof
( complex<double> ) );
297
using
ET = MKL_Complex16;
298
#else
299
using
ET = double;
300
#endif
301
302
zgetri_( &n,
reinterpret_cast<
ET*
>
( A ), &lda,
const_cast<
blas_int_t
*
>
( ipiv ),
303
reinterpret_cast<
ET*
>
( work ), &lwork, info );
304
}
305
//*************************************************************************************************
306
307
}
// namespace blaze
308
309
#endif
Complex.h
Header file for the complex data type.
StaticAssert.h
Compile time assertion.
blaze::getri
void getri(blas_int_t n, float *A, blas_int_t lda, const blas_int_t *ipiv, float *work, blas_int_t lwork, blas_int_t *info)
LAPACK kernel for the inversion of the given dense general single precision column-major square matri...
Definition
getri.h:138
blaze::blas_int_t
int32_t blas_int_t
Signed integer type used in the BLAS/LAPACK wrapper functions.
Definition
Types.h:64
BLAZE_STATIC_ASSERT
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.
Definition
StaticAssert.h:112
Types.h
Header file for basic BLAS type definitions.
Generated by
1.18.0