Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
math
lapack
clapack
gesv.h
Go to the documentation of this file.
1
//=================================================================================================
33
//=================================================================================================
34
35
#ifndef _BLAZE_MATH_LAPACK_CLAPACK_GESV_H_
36
#define _BLAZE_MATH_LAPACK_CLAPACK_GESV_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) && !defined(BLAS_H)
57
extern
"C"
{
58
59
void
sgesv_(
blaze::blas_int_t
* n,
blaze::blas_int_t
* nrhs,
float
* A,
blaze::blas_int_t
* lda,
60
blaze::blas_int_t
* ipiv,
float
* b,
blaze::blas_int_t
* ldb,
blaze::blas_int_t
* info );
61
void
dgesv_(
blaze::blas_int_t
* n,
blaze::blas_int_t
* nrhs,
double
* A,
blaze::blas_int_t
* lda,
62
blaze::blas_int_t
* ipiv,
double
* b,
blaze::blas_int_t
* ldb,
blaze::blas_int_t
* info );
63
void
cgesv_(
blaze::blas_int_t
* n,
blaze::blas_int_t
* nrhs,
float
* A,
blaze::blas_int_t
* lda,
64
blaze::blas_int_t
* ipiv,
float
* b,
blaze::blas_int_t
* ldb,
blaze::blas_int_t
* info );
65
void
zgesv_(
blaze::blas_int_t
* n,
blaze::blas_int_t
* nrhs,
double
* A,
blaze::blas_int_t
* lda,
66
blaze::blas_int_t
* ipiv,
double
* b,
blaze::blas_int_t
* ldb,
blaze::blas_int_t
* info );
67
68
}
69
#endif
71
//*************************************************************************************************
72
73
74
75
76
namespace
blaze {
77
78
//=================================================================================================
79
//
80
// LAPACK GENERAL LINEAR SYSTEM FUNCTIONS (GESV)
81
//
82
//=================================================================================================
83
84
//*************************************************************************************************
87
void
gesv
(
blas_int_t
n,
blas_int_t
nrhs,
float
* A,
blas_int_t
lda,
88
blas_int_t
* ipiv,
float
* B,
blas_int_t
ldb,
blas_int_t
* info );
89
90
void
gesv
(
blas_int_t
n,
blas_int_t
nrhs,
double
* A,
blas_int_t
lda,
91
blas_int_t
* ipiv,
double
* B,
blas_int_t
ldb,
blas_int_t
* info );
92
93
void
gesv
(
blas_int_t
n,
blas_int_t
nrhs, complex<float>* A,
blas_int_t
lda,
94
blas_int_t
* ipiv, complex<float>* B,
blas_int_t
ldb,
blas_int_t
* info );
95
96
void
gesv
(
blas_int_t
n,
blas_int_t
nrhs, complex<double>* A,
blas_int_t
lda,
97
blas_int_t
* ipiv, complex<double>* B,
blas_int_t
ldb,
blas_int_t
* info );
99
//*************************************************************************************************
100
101
102
//*************************************************************************************************
145
inline
void
gesv
(
blas_int_t
n,
blas_int_t
nrhs,
float
* A,
blas_int_t
lda,
146
blas_int_t
* ipiv,
float
* B,
blas_int_t
ldb,
blas_int_t
* info )
147
{
148
#if defined(INTEL_MKL_VERSION)
149
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_INT ) ==
sizeof
(
blas_int_t
) );
150
#endif
151
152
sgesv_( &n, &nrhs, A, &lda, ipiv, B, &ldb, info );
153
}
154
//*************************************************************************************************
155
156
157
//*************************************************************************************************
200
inline
void
gesv
(
blas_int_t
n,
blas_int_t
nrhs,
double
* A,
blas_int_t
lda,
201
blas_int_t
* ipiv,
double
* B,
blas_int_t
ldb,
blas_int_t
* info )
202
{
203
#if defined(INTEL_MKL_VERSION)
204
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_INT ) ==
sizeof
(
blas_int_t
) );
205
#endif
206
207
dgesv_( &n, &nrhs, A, &lda, ipiv, B, &ldb, info );
208
}
209
//*************************************************************************************************
210
211
212
//*************************************************************************************************
255
inline
void
gesv
(
blas_int_t
n,
blas_int_t
nrhs, complex<float>* A,
blas_int_t
lda,
256
blas_int_t
* ipiv, complex<float>* B,
blas_int_t
ldb,
blas_int_t
* info )
257
{
258
BLAZE_STATIC_ASSERT
(
sizeof
( complex<float> ) == 2UL*
sizeof
(
float
) );
259
260
#if defined(INTEL_MKL_VERSION)
261
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_INT ) ==
sizeof
(
blas_int_t
) );
262
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_Complex8 ) ==
sizeof
( complex<float> ) );
263
using
ET = MKL_Complex8;
264
#else
265
using
ET = float;
266
#endif
267
268
cgesv_( &n, &nrhs,
reinterpret_cast<
ET*
>
( A ), &lda, ipiv,
269
reinterpret_cast<
ET*
>
( B ), &ldb, info );
270
}
271
//*************************************************************************************************
272
273
274
//*************************************************************************************************
317
inline
void
gesv
(
blas_int_t
n,
blas_int_t
nrhs, complex<double>* A,
blas_int_t
lda,
318
blas_int_t
* ipiv, complex<double>* B,
blas_int_t
ldb,
blas_int_t
* info )
319
{
320
BLAZE_STATIC_ASSERT
(
sizeof
( complex<double> ) == 2UL*
sizeof
(
double
) );
321
322
#if defined(INTEL_MKL_VERSION)
323
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_INT ) ==
sizeof
(
blas_int_t
) );
324
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_Complex16 ) ==
sizeof
( complex<double> ) );
325
using
ET = MKL_Complex16;
326
#else
327
using
ET = double;
328
#endif
329
330
zgesv_( &n, &nrhs,
reinterpret_cast<
ET*
>
( A ), &lda, ipiv,
331
reinterpret_cast<
ET*
>
( B ), &ldb, info );
332
}
333
//*************************************************************************************************
334
335
}
// namespace blaze
336
337
#endif
Complex.h
Header file for the complex data type.
StaticAssert.h
Compile time assertion.
blaze::gesv
void gesv(blas_int_t n, blas_int_t nrhs, float *A, blas_int_t lda, blas_int_t *ipiv, float *B, blas_int_t ldb, blas_int_t *info)
LAPACK kernel for solving a general single precision linear system of equations ( ).
Definition
gesv.h:145
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