Blaze 3.9
sytrs.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_LAPACK_CLAPACK_SYTRS_H_
36#define _BLAZE_MATH_LAPACK_CLAPACK_SYTRS_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 ssytrs_( char* uplo, 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,
63void dsytrs_( char* uplo, 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,
66void csytrs_( char* uplo, 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,
69void zsytrs_( char* uplo, 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,
72
73}
74#endif
76//*************************************************************************************************
77
78
79
80
81namespace blaze {
82
83//=================================================================================================
84//
85// LAPACK LDLT-BASED SUBSTITUTION FUNCTIONS (SYTRS)
86//
87//=================================================================================================
88
89//*************************************************************************************************
92void sytrs( char uplo, blas_int_t n, blas_int_t nrhs, const float* A, blas_int_t lda,
93 const blas_int_t* ipiv, float* B, blas_int_t ldb, blas_int_t* info );
94
95void sytrs( char uplo, blas_int_t n, blas_int_t nrhs, const double* A, blas_int_t lda,
96 const blas_int_t* ipiv, double* B, blas_int_t ldb, blas_int_t* info );
97
98void sytrs( char uplo, blas_int_t n, blas_int_t nrhs, const complex<float>* A, blas_int_t lda,
99 const blas_int_t* ipiv, complex<float>* B, blas_int_t ldb, blas_int_t* info );
100
101void sytrs( char uplo, blas_int_t n, blas_int_t nrhs, const complex<double>* A, blas_int_t lda,
102 const blas_int_t* ipiv, complex<double>* B, blas_int_t ldb, blas_int_t* info );
104//*************************************************************************************************
105
106
107//*************************************************************************************************
141inline void sytrs( char uplo, blas_int_t n, blas_int_t nrhs, const float* A, blas_int_t lda,
142 const blas_int_t* ipiv, float* B, blas_int_t ldb, blas_int_t* info )
143{
144#if defined(INTEL_MKL_VERSION)
145 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
146#endif
147
148 ssytrs_( &uplo, &n, &nrhs, const_cast<float*>( A ), &lda,
149 const_cast<blas_int_t*>( ipiv ), B, &ldb, info
150#if !defined(INTEL_MKL_VERSION)
152#endif
153 );
154}
155//*************************************************************************************************
156
157
158//*************************************************************************************************
192inline void sytrs( char uplo, blas_int_t n, blas_int_t nrhs, const double* A, blas_int_t lda,
193 const blas_int_t* ipiv, double* B, blas_int_t ldb, blas_int_t* info )
194{
195#if defined(INTEL_MKL_VERSION)
196 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
197#endif
198
199 dsytrs_( &uplo, &n, &nrhs, const_cast<double*>( A ), &lda,
200 const_cast<blas_int_t*>( ipiv ), B, &ldb, info
201#if !defined(INTEL_MKL_VERSION)
203#endif
204 );
205}
206//*************************************************************************************************
207
208
209//*************************************************************************************************
243inline void sytrs( char uplo, blas_int_t n, blas_int_t nrhs, const complex<float>* A, blas_int_t lda,
244 const blas_int_t* ipiv, complex<float>* B, blas_int_t ldb, blas_int_t* info )
245{
246 BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
247
248#if defined(INTEL_MKL_VERSION)
249 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
250 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex8 ) == sizeof( complex<float> ) );
251 using ET = MKL_Complex8;
252#else
253 using ET = float;
254#endif
255
256 csytrs_( &uplo, &n, &nrhs, const_cast<ET*>( reinterpret_cast<const ET*>( A ) ),
257 &lda, const_cast<blas_int_t*>( ipiv ), reinterpret_cast<ET*>( B ), &ldb, info
258#if !defined(INTEL_MKL_VERSION)
260#endif
261 );
262}
263//*************************************************************************************************
264
265
266//*************************************************************************************************
300inline void sytrs( char uplo, blas_int_t n, blas_int_t nrhs, const complex<double>* A, blas_int_t lda,
301 const blas_int_t* ipiv, complex<double>* B, blas_int_t ldb, blas_int_t* info )
302{
303 BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
304
305#if defined(INTEL_MKL_VERSION)
306 BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( blas_int_t ) );
307 BLAZE_STATIC_ASSERT( sizeof( MKL_Complex16 ) == sizeof( complex<double> ) );
308 using ET = MKL_Complex16;
309#else
310 using ET = double;
311#endif
312
313 zsytrs_( &uplo, &n, &nrhs, const_cast<ET*>( reinterpret_cast<const ET*>( A ) ),
314 &lda, const_cast<blas_int_t*>( ipiv ), reinterpret_cast<ET*>( B ), &ldb, info
315#if !defined(INTEL_MKL_VERSION)
317#endif
318 );
319}
320//*************************************************************************************************
321
322} // namespace blaze
323
324#endif
Header file for the complex data type.
Compile time assertion.
Complex data type of the Blaze library.
void sytrs(const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO2 > &B, char uplo, const blas_int_t *ipiv)
LAPACK kernel for the substitution step of solving a symmetric indefinite linear system of equations ...
Definition: sytrs.h:311
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.