Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
math
lapack
clapack
getrs.h
Go to the documentation of this file.
1
//=================================================================================================
33
//=================================================================================================
34
35
#ifndef _BLAZE_MATH_LAPACK_CLAPACK_GETRS_H_
36
#define _BLAZE_MATH_LAPACK_CLAPACK_GETRS_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
#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)
58
extern
"C"
{
59
60
void
sgetrs_(
char
* trans,
blaze::blas_int_t
* n,
blaze::blas_int_t
* nrhs,
float
* A,
61
blaze::blas_int_t
* lda,
blaze::blas_int_t
* ipiv,
float
* B,
blaze::blas_int_t
* ldb,
62
blaze::blas_int_t
* info,
blaze::fortran_charlen_t
ntrans );
63
void
dgetrs_(
char
* trans,
blaze::blas_int_t
* n,
blaze::blas_int_t
* nrhs,
double
* A,
64
blaze::blas_int_t
* lda,
blaze::blas_int_t
* ipiv,
double
* B,
blaze::blas_int_t
* ldb,
65
blaze::blas_int_t
* info,
blaze::fortran_charlen_t
ntrans );
66
void
cgetrs_(
char
* trans,
blaze::blas_int_t
* n,
blaze::blas_int_t
* nrhs,
float
* A,
67
blaze::blas_int_t
* lda,
blaze::blas_int_t
* ipiv,
float
* B,
blaze::blas_int_t
* ldb,
68
blaze::blas_int_t
* info,
blaze::fortran_charlen_t
ntrans );
69
void
zgetrs_(
char
* trans,
blaze::blas_int_t
* n,
blaze::blas_int_t
* nrhs,
double
* A,
70
blaze::blas_int_t
* lda,
blaze::blas_int_t
* ipiv,
double
* B,
blaze::blas_int_t
* ldb,
71
blaze::blas_int_t
* info,
blaze::fortran_charlen_t
ntrans );
72
73
}
74
#endif
76
//*************************************************************************************************
77
78
79
80
81
namespace
blaze {
82
83
//=================================================================================================
84
//
85
// LAPACK LU-BASED SUBSTITUTION FUNCTIONS (GETRS)
86
//
87
//=================================================================================================
88
89
//*************************************************************************************************
92
void
getrs
(
char
trans
,
blas_int_t
n,
blas_int_t
nrhs,
const
float
* A,
93
blas_int_t
lda,
const
blas_int_t
* ipiv,
float
* B,
94
blas_int_t
ldb,
blas_int_t
* info );
95
96
void
getrs
(
char
trans
,
blas_int_t
n,
blas_int_t
nrhs,
const
double
* A,
97
blas_int_t
lda,
const
blas_int_t
* ipiv,
double
* B,
98
blas_int_t
ldb,
blas_int_t
* info );
99
100
void
getrs
(
char
trans
,
blas_int_t
n,
blas_int_t
nrhs,
const
complex<float>* A,
101
blas_int_t
lda,
const
blas_int_t
* ipiv, complex<float>* B,
102
blas_int_t
ldb,
blas_int_t
* info );
103
104
void
getrs
(
char
trans
,
blas_int_t
n,
blas_int_t
nrhs,
const
complex<double>* A,
105
blas_int_t
lda,
const
blas_int_t
* ipiv, complex<double>* B,
106
blas_int_t
ldb,
blas_int_t
* info );
108
//*************************************************************************************************
109
110
111
//*************************************************************************************************
150
inline
void
getrs
(
char
trans
,
blas_int_t
n,
blas_int_t
nrhs,
const
float
* A,
151
blas_int_t
lda,
const
blas_int_t
* ipiv,
float
* B,
152
blas_int_t
ldb,
blas_int_t
* info )
153
{
154
#if defined(INTEL_MKL_VERSION)
155
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_INT ) ==
sizeof
(
blas_int_t
) );
156
#endif
157
158
sgetrs_( &
trans
, &n, &nrhs,
const_cast<
float
*
>
( A ), &lda,
159
const_cast<
blas_int_t
*
>
( ipiv ), B, &ldb, info
160
#
if
!defined(INTEL_MKL_VERSION) && !defined(BLAS_H)
161
,
blaze::fortran_charlen_t
(1)
162
#endif
163
);
164
}
165
//*************************************************************************************************
166
167
168
//*************************************************************************************************
207
inline
void
getrs
(
char
trans
,
blas_int_t
n,
blas_int_t
nrhs,
const
double
* A,
208
blas_int_t
lda,
const
blas_int_t
* ipiv,
double
* B,
209
blas_int_t
ldb,
blas_int_t
* info )
210
{
211
#if defined(INTEL_MKL_VERSION)
212
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_INT ) ==
sizeof
(
blas_int_t
) );
213
#endif
214
215
dgetrs_( &
trans
, &n, &nrhs,
const_cast<
double
*
>
( A ), &lda,
216
const_cast<
blas_int_t
*
>
( ipiv ), B, &ldb, info
217
#
if
!defined(INTEL_MKL_VERSION) && !defined(BLAS_H)
218
,
blaze::fortran_charlen_t
(1)
219
#endif
220
);
221
}
222
//*************************************************************************************************
223
224
225
//*************************************************************************************************
264
inline
void
getrs
(
char
trans
,
blas_int_t
n,
blas_int_t
nrhs,
const
complex<float>* A,
265
blas_int_t
lda,
const
blas_int_t
* ipiv, complex<float>* B,
266
blas_int_t
ldb,
blas_int_t
* info )
267
{
268
BLAZE_STATIC_ASSERT
(
sizeof
( complex<float> ) == 2UL*
sizeof
(
float
) );
269
270
#if defined(INTEL_MKL_VERSION)
271
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_INT ) ==
sizeof
(
blas_int_t
) );
272
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_Complex8 ) ==
sizeof
( complex<float> ) );
273
using
ET = MKL_Complex8;
274
#else
275
using
ET = float;
276
#endif
277
278
cgetrs_( &
trans
, &n, &nrhs,
const_cast<
ET*
>
(
reinterpret_cast<
const
ET*
>
( A ) ),
279
&lda,
const_cast<
blas_int_t
*
>
( ipiv ),
reinterpret_cast<
ET*
>
( B ), &ldb, info
280
#
if
!defined(INTEL_MKL_VERSION) && !defined(BLAS_H)
281
,
blaze::fortran_charlen_t
(1)
282
#endif
283
);
284
}
285
//*************************************************************************************************
286
287
288
//*************************************************************************************************
327
inline
void
getrs
(
char
trans
,
blas_int_t
n,
blas_int_t
nrhs,
const
complex<double>* A,
328
blas_int_t
lda,
const
blas_int_t
* ipiv, complex<double>* B,
329
blas_int_t
ldb,
blas_int_t
* info )
330
{
331
BLAZE_STATIC_ASSERT
(
sizeof
( complex<double> ) == 2UL*
sizeof
(
double
) );
332
333
#if defined(INTEL_MKL_VERSION)
334
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_INT ) ==
sizeof
(
blas_int_t
) );
335
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_Complex16 ) ==
sizeof
( complex<double> ) );
336
using
ET = MKL_Complex16;
337
#else
338
using
ET = double;
339
#endif
340
341
zgetrs_( &
trans
, &n, &nrhs,
const_cast<
ET*
>
(
reinterpret_cast<
const
ET*
>
( A ) ),
342
&lda,
const_cast<
blas_int_t
*
>
( ipiv ),
reinterpret_cast<
ET*
>
( B ), &ldb, info
343
#
if
!defined(INTEL_MKL_VERSION) && !defined(BLAS_H)
344
,
blaze::fortran_charlen_t
(1)
345
#endif
346
);
347
}
348
//*************************************************************************************************
349
350
}
// namespace blaze
351
352
#endif
Complex.h
Header file for the complex data type.
StaticAssert.h
Compile time assertion.
blaze::trans
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition
DMatTransExpr.h:766
blaze::getrs
void getrs(char trans, blas_int_t n, blas_int_t nrhs, const float *A, blas_int_t lda, const blas_int_t *ipiv, float *B, blas_int_t ldb, blas_int_t *info)
LAPACK kernel for the substitution step of solving a general single precision linear system of equati...
Definition
getrs.h:150
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
blaze::fortran_charlen_t
size_t fortran_charlen_t
Type of the hidden arguments of character type within a Fortran forward declaration.
Definition
Types.h:186
Types.h
Header file for basic BLAS type definitions.
Types.h
Header file for basic type definitions.
Generated by
1.18.0