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/util/Complex.h>
45 
46 
47 //=================================================================================================
48 //
49 // LAPACK FORWARD DECLARATIONS
50 //
51 //=================================================================================================
52 
53 //*************************************************************************************************
55 extern "C" {
56 
57 void sgesvd_( char* jobu, char* jobv, int* m, int* n, float* A, int* lda, float* s, float* U, int* ldu, float* V, int* ldv, float* work, int* lwork, int* info );
58 void dgesvd_( char* jobu, char* jobv, int* m, int* n, double* A, int* lda, double* s, double* U, int* ldu, double* V, int* ldv, double* work, int* lwork, int* info );
59 void cgesvd_( char* jobu, char* jobv, 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* info );
60 void zgesvd_( char* jobu, char* jobv, 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* info );
61 
62 }
64 //*************************************************************************************************
65 
66 
67 
68 
69 namespace blaze {
70 
71 //=================================================================================================
72 //
73 // LAPACK SVD FUNCTIONS (GESVD)
74 //
75 //=================================================================================================
76 
77 //*************************************************************************************************
80 inline void gesvd( char jobu, char jobv, 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* info );
83 
84 inline void gesvd( char jobu, char jobv, 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* info );
87 
88 inline void gesvd( char jobu, char jobv, int m, int n, complex<float>* A, int lda,
89  float* s, complex<float>* U, int ldu, complex<float>* V, int ldv,
90  complex<float>* work, int lwork, float* rwork, int* info );
91 
92 inline void gesvd( char jobu, char jobv, int m, int n, complex<double>* A, int lda,
93  double* s, complex<double>* U, int ldu, complex<double>* V, int ldv,
94  complex<double>* work, int lwork, double* rwork, int* info );
96 //*************************************************************************************************
97 
98 
99 //*************************************************************************************************
161 inline void gesvd( char jobu, char jobv, int m, int n, float* A, int lda,
162  float* s, float* U, int ldu, float* V, int ldv,
163  float* work, int lwork, int* info )
164 {
165  sgesvd_( &jobu, &jobv, &m, &n, A, &lda, s, U, &ldu, V, &ldv, work, &lwork, info );
166 }
167 //*************************************************************************************************
168 
169 
170 //*************************************************************************************************
232 inline void gesvd( char jobu, char jobv, int m, int n, double* A, int lda,
233  double* s, double* U, int ldu, double* V, int ldv,
234  double* work, int lwork, int* info )
235 {
236  dgesvd_( &jobu, &jobv, &m, &n, A, &lda, s, U, &ldu, V, &ldv, work, &lwork, info );
237 }
238 //*************************************************************************************************
239 
240 
241 //*************************************************************************************************
304 inline void gesvd( char jobu, char jobv, int m, int n, complex<float>* A, int lda,
305  float* s, complex<float>* U, int ldu, complex<float>* V, int ldv,
306  complex<float>* work, int lwork, float* rwork, int* info )
307 {
308  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
309 
310  cgesvd_( &jobu, &jobv, &m, &n, reinterpret_cast<float*>( A ), &lda, s,
311  reinterpret_cast<float*>( U ), &ldu, reinterpret_cast<float*>( V ), &ldv,
312  reinterpret_cast<float*>( work ), &lwork, rwork, info );
313 }
314 //*************************************************************************************************
315 
316 
317 //*************************************************************************************************
380 inline void gesvd( char jobu, char jobv, int m, int n, complex<double>* A, int lda,
381  double* s, complex<double>* U, int ldu, complex<double>* V, int ldv,
382  complex<double>* work, int lwork, double* rwork, int* info )
383 {
384  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
385 
386  zgesvd_( &jobu, &jobv, &m, &n, reinterpret_cast<double*>( A ), &lda, s,
387  reinterpret_cast<double*>( U ), &ldu, reinterpret_cast<double*>( V ), &ldv,
388  reinterpret_cast<double*>( work ), &lwork, rwork, info );
389 }
390 //*************************************************************************************************
391 
392 } // namespace blaze
393 
394 #endif
void gesvd(char jobu, char jobv, int m, int n, float *A, int lda, float *s, float *U, int ldu, float *V, int ldv, float *work, int lwork, int *info)
LAPACK kernel for the singular value decomposition (SVD) of the given dense general single precision ...
Definition: gesvd.h:161
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Compile time assertion.
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