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/util/Complex.h>
45 
46 
47 //=================================================================================================
48 //
49 // LAPACK FORWARD DECLARATIONS
50 //
51 //=================================================================================================
52 
53 //*************************************************************************************************
55 extern "C" {
56 
57 void sgesdd_( char* jobz, int* m, int* n, float* A, int* lda, float* s, float* U, int* ldu, float* V, int* ldv, float* work, int* lwork, int* iwork, int* info );
58 void dgesdd_( char* jobz, int* m, int* n, double* A, int* lda, double* s, double* U, int* ldu, double* V, int* ldv, double* work, int* lwork, int* iwork, int* info );
59 void cgesdd_( char* jobz, int* m, int* n, float* A, int* lda, float* s, float* U, int* ldu, float* V, int* ldv, float* work, int* lwork, float* rwork, int* iwork, int* info );
60 void zgesdd_( char* jobz, int* m, int* n, double* A, int* lda, double* s, double* U, int* ldu, double* V, int* ldv, double* work, int* lwork, double* rwork, int* iwork, int* info );
61 
62 }
64 //*************************************************************************************************
65 
66 
67 
68 
69 namespace blaze {
70 
71 //=================================================================================================
72 //
73 // LAPACK SVD FUNCTIONS (GESDD)
74 //
75 //=================================================================================================
76 
77 //*************************************************************************************************
80 inline void gesdd( char jobz, int m, int n, float* A, int lda,
81  float* s, float* U, int ldu, float* V, int ldv,
82  float* work, int lwork, int* iwork, int* info );
83 
84 inline void gesdd( char jobz, int m, int n, double* A, int lda,
85  double* s, double* U, int ldu, double* V, int ldv,
86  double* work, int lwork, int* iwork, int* info );
87 
88 inline void gesdd( char jobz, int m, int n, complex<float>* A, int lda, float* s,
89  complex<float>* U, int ldu, complex<float>* V, int ldv,
90  complex<float>* work, int lwork, float* rwork, int* iwork, int* info );
91 
92 inline void gesdd( char jobz, int m, int n, complex<double>* A, int lda, double* s,
93  complex<double>* U, int ldu, complex<double>* V, int ldv,
94  complex<double>* work, int lwork, double* rwork, int* iwork, int* info );
96 //*************************************************************************************************
97 
98 
99 //*************************************************************************************************
163 inline void gesdd( char jobz, int m, int n, float* A, int lda,
164  float* s, float* U, int ldu, float* V, int ldv,
165  float* work, int lwork, int* iwork, int* info )
166 {
167  sgesdd_( &jobz, &m, &n, A, &lda, s, U, &ldu, V, &ldv, work, &lwork, iwork, info );
168 }
169 //*************************************************************************************************
170 
171 
172 //*************************************************************************************************
236 inline void gesdd( char jobz, int m, int n, double* A, int lda,
237  double* s, double* U, int ldu, double* V, int ldv,
238  double* work, int lwork, int* iwork, int* info )
239 {
240  dgesdd_( &jobz, &m, &n, A, &lda, s, U, &ldu, V, &ldv, work, &lwork, iwork, info );
241 }
242 //*************************************************************************************************
243 
244 
245 //*************************************************************************************************
310 inline void gesdd( char jobz, int m, int n, complex<float>* A, int lda, float* s,
311  complex<float>* U, int ldu, complex<float>* V, int ldv,
312  complex<float>* work, int lwork, float* rwork, int* iwork, int* info )
313 {
314  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
315 
316  cgesdd_( &jobz, &m, &n, reinterpret_cast<float*>( A ), &lda, s,
317  reinterpret_cast<float*>( U ), &ldu, reinterpret_cast<float*>( V ), &ldv,
318  reinterpret_cast<float*>( work ), &lwork, rwork, iwork, info );
319 }
320 //*************************************************************************************************
321 
322 
323 //*************************************************************************************************
388 inline void gesdd( char jobz, int m, int n, complex<double>* A, int lda, double* s,
389  complex<double>* U, int ldu, complex<double>* V, int ldv,
390  complex<double>* work, int lwork, double* rwork, int* iwork, int* info )
391 {
392  zgesdd_( &jobz, &m, &n, reinterpret_cast<double*>( A ), &lda, s,
393  reinterpret_cast<double*>( U ), &ldu, reinterpret_cast<double*>( V ), &ldv,
394  reinterpret_cast<double*>( work ), &lwork, rwork, iwork, info );
395 }
396 //*************************************************************************************************
397 
398 } // namespace blaze
399 
400 #endif
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Compile time assertion.
void gesdd(char jobz, int m, int n, float *A, int lda, float *s, float *U, int ldu, float *V, int ldv, float *work, int lwork, int *iwork, int *info)
LAPACK kernel for the singular value decomposition (SVD) of the given dense general single precision ...
Definition: gesdd.h:163
Header file for the complex data type.
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:112