Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
math
lapack
clapack
gesvd.h
Go to the documentation of this file.
1
//=================================================================================================
33
//=================================================================================================
34
35
#ifndef _BLAZE_MATH_LAPACK_CLAPACK_GESVD_H_
36
#define _BLAZE_MATH_LAPACK_CLAPACK_GESVD_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)
58
extern
"C"
{
59
60
void
sgesvd_(
char
* jobu,
char
* jobv,
blaze::blas_int_t
* m,
blaze::blas_int_t
* n,
float
* A,
61
blaze::blas_int_t
* lda,
float
* s,
float
* U,
blaze::blas_int_t
* ldu,
float
* V,
62
blaze::blas_int_t
* ldv,
float
* work,
blaze::blas_int_t
* lwork,
blaze::blas_int_t
* info,
63
blaze::fortran_charlen_t
njobu,
blaze::fortran_charlen_t
njobv );
64
void
dgesvd_(
char
* jobu,
char
* jobv,
blaze::blas_int_t
* m,
blaze::blas_int_t
* n,
double
* A,
65
blaze::blas_int_t
* lda,
double
* s,
double
* U,
blaze::blas_int_t
* ldu,
double
* V,
66
blaze::blas_int_t
* ldv,
double
* work,
blaze::blas_int_t
* lwork,
blaze::blas_int_t
* info,
67
blaze::fortran_charlen_t
njobu,
blaze::fortran_charlen_t
njobv );
68
void
cgesvd_(
char
* jobu,
char
* jobv,
blaze::blas_int_t
* m,
blaze::blas_int_t
* n,
float
* A,
69
blaze::blas_int_t
* lda,
float
* s,
float
* U,
blaze::blas_int_t
* ldu,
float
* V,
70
blaze::blas_int_t
* ldv,
float
* work,
blaze::blas_int_t
* lwork,
float
* rwork,
71
blaze::blas_int_t
* info,
blaze::fortran_charlen_t
njobu,
blaze::fortran_charlen_t
njobv );
72
void
zgesvd_(
char
* jobu,
char
* jobv,
blaze::blas_int_t
* m,
blaze::blas_int_t
* n,
double
* A,
73
blaze::blas_int_t
* lda,
double
* s,
double
* U,
blaze::blas_int_t
* ldu,
double
* V,
74
blaze::blas_int_t
* ldv,
double
* work,
blaze::blas_int_t
* lwork,
double
* rwork,
75
blaze::blas_int_t
* info,
blaze::fortran_charlen_t
njobu,
blaze::fortran_charlen_t
njobv );
76
77
}
78
#endif
80
//*************************************************************************************************
81
82
83
84
85
namespace
blaze {
86
87
//=================================================================================================
88
//
89
// LAPACK SVD FUNCTIONS (GESVD)
90
//
91
//=================================================================================================
92
93
//*************************************************************************************************
96
void
gesvd
(
char
jobu,
char
jobv,
blas_int_t
m,
blas_int_t
n,
float
* A,
97
blas_int_t
lda,
float
* s,
float
* U,
blas_int_t
ldu,
float
* V,
98
blas_int_t
ldv,
float
* work,
blas_int_t
lwork,
blas_int_t
* info );
99
100
void
gesvd
(
char
jobu,
char
jobv,
blas_int_t
m,
blas_int_t
n,
double
* A,
101
blas_int_t
lda,
double
* s,
double
* U,
blas_int_t
ldu,
double
* V,
102
blas_int_t
ldv,
double
* work,
blas_int_t
lwork,
blas_int_t
* info );
103
104
void
gesvd
(
char
jobu,
char
jobv,
blas_int_t
m,
blas_int_t
n, complex<float>* A,
105
blas_int_t
lda,
float
* s, complex<float>* U,
blas_int_t
ldu,
106
complex<float>* V,
blas_int_t
ldv, complex<float>* work,
107
blas_int_t
lwork,
float
* rwork,
blas_int_t
* info );
108
109
void
gesvd
(
char
jobu,
char
jobv,
blas_int_t
m,
blas_int_t
n, complex<double>* A,
110
blas_int_t
lda,
double
* s, complex<double>* U,
blas_int_t
ldu,
111
complex<double>* V,
blas_int_t
ldv, complex<double>* work,
112
blas_int_t
lwork,
double
* rwork,
blas_int_t
* info );
114
//*************************************************************************************************
115
116
117
//*************************************************************************************************
179
inline
void
gesvd
(
char
jobu,
char
jobv,
blas_int_t
m,
blas_int_t
n,
float
* A,
180
blas_int_t
lda,
float
* s,
float
* U,
blas_int_t
ldu,
float
* V,
181
blas_int_t
ldv,
float
* work,
blas_int_t
lwork,
blas_int_t
* info )
182
{
183
#if defined(INTEL_MKL_VERSION)
184
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_INT ) ==
sizeof
(
blas_int_t
) );
185
#endif
186
187
sgesvd_( &jobu, &jobv, &m, &n, A, &lda, s, U, &ldu, V, &ldv, work, &lwork, info
188
#
if
!defined(INTEL_MKL_VERSION)
189
,
blaze::fortran_charlen_t
(1),
blaze::fortran_charlen_t
(1)
190
#endif
191
);
192
}
193
//*************************************************************************************************
194
195
196
//*************************************************************************************************
258
inline
void
gesvd
(
char
jobu,
char
jobv,
blas_int_t
m,
blas_int_t
n,
double
* A,
259
blas_int_t
lda,
double
* s,
double
* U,
blas_int_t
ldu,
double
* V,
260
blas_int_t
ldv,
double
* work,
blas_int_t
lwork,
blas_int_t
* info )
261
{
262
#if defined(INTEL_MKL_VERSION)
263
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_INT ) ==
sizeof
(
blas_int_t
) );
264
#endif
265
266
dgesvd_( &jobu, &jobv, &m, &n, A, &lda, s, U, &ldu, V, &ldv, work, &lwork, info
267
#
if
!defined(INTEL_MKL_VERSION)
268
,
blaze::fortran_charlen_t
(1),
blaze::fortran_charlen_t
(1)
269
#endif
270
);
271
}
272
//*************************************************************************************************
273
274
275
//*************************************************************************************************
338
inline
void
gesvd
(
char
jobu,
char
jobv,
blas_int_t
m,
blas_int_t
n, complex<float>* A,
339
blas_int_t
lda,
float
* s, complex<float>* U,
blas_int_t
ldu,
340
complex<float>* V,
blas_int_t
ldv, complex<float>* work,
341
blas_int_t
lwork,
float
* rwork,
blas_int_t
* info )
342
{
343
BLAZE_STATIC_ASSERT
(
sizeof
( complex<float> ) == 2UL*
sizeof
(
float
) );
344
345
#if defined(INTEL_MKL_VERSION)
346
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_INT ) ==
sizeof
(
blas_int_t
) );
347
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_Complex8 ) ==
sizeof
( complex<float> ) );
348
using
ET = MKL_Complex8;
349
#else
350
using
ET = float;
351
#endif
352
353
cgesvd_( &jobu, &jobv, &m, &n,
reinterpret_cast<
ET*
>
( A ), &lda, s,
354
reinterpret_cast<
ET*
>
( U ), &ldu,
reinterpret_cast<
ET*
>
( V ), &ldv,
355
reinterpret_cast<
ET*
>
( work ), &lwork, rwork, info
356
#
if
!defined(INTEL_MKL_VERSION)
357
,
blaze::fortran_charlen_t
(1),
blaze::fortran_charlen_t
(1)
358
#endif
359
);
360
}
361
//*************************************************************************************************
362
363
364
//*************************************************************************************************
427
inline
void
gesvd
(
char
jobu,
char
jobv,
blas_int_t
m,
blas_int_t
n, complex<double>* A,
428
blas_int_t
lda,
double
* s, complex<double>* U,
blas_int_t
ldu,
429
complex<double>* V,
blas_int_t
ldv, complex<double>* work,
430
blas_int_t
lwork,
double
* rwork,
blas_int_t
* info )
431
{
432
BLAZE_STATIC_ASSERT
(
sizeof
( complex<double> ) == 2UL*
sizeof
(
double
) );
433
434
#if defined(INTEL_MKL_VERSION)
435
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_INT ) ==
sizeof
(
blas_int_t
) );
436
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_Complex16 ) ==
sizeof
( complex<double> ) );
437
using
ET = MKL_Complex16;
438
#else
439
using
ET = double;
440
#endif
441
442
zgesvd_( &jobu, &jobv, &m, &n,
reinterpret_cast<
ET*
>
( A ), &lda, s,
443
reinterpret_cast<
ET*
>
( U ), &ldu,
reinterpret_cast<
ET*
>
( V ), &ldv,
444
reinterpret_cast<
ET*
>
( work ), &lwork, rwork, info
445
#
if
!defined(INTEL_MKL_VERSION)
446
,
blaze::fortran_charlen_t
(1),
blaze::fortran_charlen_t
(1)
447
#endif
448
);
449
}
450
//*************************************************************************************************
451
452
}
// namespace blaze
453
454
#endif
Complex.h
Header file for the complex data type.
StaticAssert.h
Compile time assertion.
blaze::gesvd
void gesvd(char jobu, char jobv, blas_int_t m, blas_int_t n, float *A, blas_int_t lda, float *s, float *U, blas_int_t ldu, float *V, blas_int_t ldv, float *work, blas_int_t lwork, blas_int_t *info)
LAPACK kernel for the singular value decomposition (SVD) of the given dense general single precision ...
Definition
gesvd.h:179
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