Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
math
lapack
clapack
gesdd.h
Go to the documentation of this file.
1
//=================================================================================================
33
//=================================================================================================
34
35
#ifndef _BLAZE_MATH_LAPACK_CLAPACK_GESDD_H_
36
#define _BLAZE_MATH_LAPACK_CLAPACK_GESDD_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
sgesdd_(
char
* jobz,
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,
62
float
* V,
blaze::blas_int_t
* ldv,
float
* work,
blaze::blas_int_t
* lwork,
63
blaze::blas_int_t
* iwork,
blaze::blas_int_t
* info,
64
blaze::fortran_charlen_t
njobz );
65
void
dgesdd_(
char
* jobz,
blaze::blas_int_t
* m,
blaze::blas_int_t
* n,
double
* A,
66
blaze::blas_int_t
* lda,
double
* s,
double
* U,
blaze::blas_int_t
* ldu,
67
double
* V,
blaze::blas_int_t
* ldv,
double
* work,
blaze::blas_int_t
* lwork,
68
blaze::blas_int_t
* iwork,
blaze::blas_int_t
* info,
69
blaze::fortran_charlen_t
njobz );
70
void
cgesdd_(
char
* jobz,
blaze::blas_int_t
* m,
blaze::blas_int_t
* n,
float
* A,
71
blaze::blas_int_t
* lda,
float
* s,
float
* U,
blaze::blas_int_t
* ldu,
72
float
* V,
blaze::blas_int_t
* ldv,
float
* work,
blaze::blas_int_t
* lwork,
73
float
* rwork,
blaze::blas_int_t
* iwork,
blaze::blas_int_t
* info,
74
blaze::fortran_charlen_t
njobz );
75
void
zgesdd_(
char
* jobz,
blaze::blas_int_t
* m,
blaze::blas_int_t
* n,
double
* A,
76
blaze::blas_int_t
* lda,
double
* s,
double
* U,
blaze::blas_int_t
* ldu,
77
double
* V,
blaze::blas_int_t
* ldv,
double
* work,
blaze::blas_int_t
* lwork,
78
double
* rwork,
blaze::blas_int_t
* iwork,
blaze::blas_int_t
* info,
79
blaze::fortran_charlen_t
njobz );
80
81
}
82
#endif
84
//*************************************************************************************************
85
86
87
88
89
namespace
blaze {
90
91
//=================================================================================================
92
//
93
// LAPACK SVD FUNCTIONS (GESDD)
94
//
95
//=================================================================================================
96
97
//*************************************************************************************************
100
void
gesdd
(
char
jobz,
blas_int_t
m,
blas_int_t
n,
float
* A,
blas_int_t
lda,
101
float
* s,
float
* U,
blas_int_t
ldu,
float
* V,
blas_int_t
ldv,
102
float
* work,
blas_int_t
lwork,
blas_int_t
* iwork,
blas_int_t
* info );
103
104
void
gesdd
(
char
jobz,
blas_int_t
m,
blas_int_t
n,
double
* A,
blas_int_t
lda,
105
double
* s,
double
* U,
blas_int_t
ldu,
double
* V,
blas_int_t
ldv,
106
double
* work,
blas_int_t
lwork,
blas_int_t
* iwork,
blas_int_t
* info );
107
108
void
gesdd
(
char
jobz,
blas_int_t
m,
blas_int_t
n, complex<float>* A,
blas_int_t
lda,
109
float
* s, complex<float>* U,
blas_int_t
ldu, complex<float>* V,
blas_int_t
ldv,
110
complex<float>* work,
blas_int_t
lwork,
float
* rwork,
blas_int_t
* iwork,
111
blas_int_t
* info );
112
113
void
gesdd
(
char
jobz,
blas_int_t
m,
blas_int_t
n, complex<double>* A,
blas_int_t
lda,
114
double
* s, complex<double>* U,
blas_int_t
ldu, complex<double>* V,
blas_int_t
ldv,
115
complex<double>* work,
blas_int_t
lwork,
double
* rwork,
blas_int_t
* iwork,
116
blas_int_t
* info );
118
//*************************************************************************************************
119
120
121
//*************************************************************************************************
185
inline
void
gesdd
(
char
jobz,
blas_int_t
m,
blas_int_t
n,
float
* A,
blas_int_t
lda,
186
float
* s,
float
* U,
blas_int_t
ldu,
float
* V,
blas_int_t
ldv,
float
* work,
187
blas_int_t
lwork,
blas_int_t
* iwork,
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
sgesdd_( &jobz, &m, &n, A, &lda, s, U, &ldu, V, &ldv, work, &lwork, iwork, info
194
#
if
!defined(INTEL_MKL_VERSION)
195
,
blaze::fortran_charlen_t
(1)
196
#endif
197
);
198
}
199
//*************************************************************************************************
200
201
202
//*************************************************************************************************
266
inline
void
gesdd
(
char
jobz,
blas_int_t
m,
blas_int_t
n,
double
* A,
blas_int_t
lda,
267
double
* s,
double
* U,
blas_int_t
ldu,
double
* V,
blas_int_t
ldv,
268
double
* work,
blas_int_t
lwork,
blas_int_t
* iwork,
blas_int_t
* info )
269
{
270
#if defined(INTEL_MKL_VERSION)
271
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_INT ) ==
sizeof
(
blas_int_t
) );
272
#endif
273
274
dgesdd_( &jobz, &m, &n, A, &lda, s, U, &ldu, V, &ldv, work, &lwork, iwork, info
275
#
if
!defined(INTEL_MKL_VERSION)
276
,
blaze::fortran_charlen_t
(1)
277
#endif
278
);
279
}
280
//*************************************************************************************************
281
282
283
//*************************************************************************************************
348
inline
void
gesdd
(
char
jobz,
blas_int_t
m,
blas_int_t
n, complex<float>* A,
blas_int_t
lda,
349
float
* s, complex<float>* U,
blas_int_t
ldu, complex<float>* V,
blas_int_t
ldv,
350
complex<float>* work,
blas_int_t
lwork,
float
* rwork,
blas_int_t
* iwork,
351
blas_int_t
* info )
352
{
353
BLAZE_STATIC_ASSERT
(
sizeof
( complex<float> ) == 2UL*
sizeof
(
float
) );
354
355
#if defined(INTEL_MKL_VERSION)
356
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_INT ) ==
sizeof
(
blas_int_t
) );
357
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_Complex8 ) ==
sizeof
( complex<float> ) );
358
using
ET = MKL_Complex8;
359
#else
360
using
ET = float;
361
#endif
362
363
cgesdd_( &jobz, &m, &n,
reinterpret_cast<
ET*
>
( A ), &lda, s,
364
reinterpret_cast<
ET*
>
( U ), &ldu,
reinterpret_cast<
ET*
>
( V ), &ldv,
365
reinterpret_cast<
ET*
>
( work ), &lwork, rwork, iwork, info
366
#
if
!defined(INTEL_MKL_VERSION)
367
,
blaze::fortran_charlen_t
(1)
368
#endif
369
);
370
}
371
//*************************************************************************************************
372
373
374
//*************************************************************************************************
439
inline
void
gesdd
(
char
jobz,
blas_int_t
m,
blas_int_t
n, complex<double>* A,
blas_int_t
lda,
440
double
* s, complex<double>* U,
blas_int_t
ldu, complex<double>* V,
blas_int_t
ldv,
441
complex<double>* work,
blas_int_t
lwork,
double
* rwork,
blas_int_t
* iwork,
442
blas_int_t
* info )
443
{
444
BLAZE_STATIC_ASSERT
(
sizeof
( complex<double> ) == 2UL*
sizeof
(
double
) );
445
446
#if defined(INTEL_MKL_VERSION)
447
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_INT ) ==
sizeof
(
blas_int_t
) );
448
BLAZE_STATIC_ASSERT
(
sizeof
( MKL_Complex16 ) ==
sizeof
( complex<double> ) );
449
using
ET = MKL_Complex16;
450
#else
451
using
ET = double;
452
#endif
453
454
zgesdd_( &jobz, &m, &n,
reinterpret_cast<
ET*
>
( A ), &lda, s,
455
reinterpret_cast<
ET*
>
( U ), &ldu,
reinterpret_cast<
ET*
>
( V ), &ldv,
456
reinterpret_cast<
ET*
>
( work ), &lwork, rwork, iwork, info
457
#
if
!defined(INTEL_MKL_VERSION)
458
,
blaze::fortran_charlen_t
(1)
459
#endif
460
);
461
}
462
//*************************************************************************************************
463
464
}
// namespace blaze
465
466
#endif
Complex.h
Header file for the complex data type.
StaticAssert.h
Compile time assertion.
blaze::gesdd
void gesdd(char jobz, 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 *iwork, blas_int_t *info)
LAPACK kernel for the singular value decomposition (SVD) of the given dense general single precision ...
Definition
gesdd.h:185
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