gesvdx.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_LAPACK_CLAPACK_GESVDX_H_
36 #define _BLAZE_MATH_LAPACK_CLAPACK_GESVDX_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 #if !defined(INTEL_MKL_VERSION) || (INTEL_MKL_VERSION < 20170000)
56 extern "C" {
57 
58 void sgesvdx_( char* jobu, char* jobv, char* range, int* m, int* n, float* A, int* lda, float* vl, float* vu, int* il, int* iu, int* ns, float* s, float* U, int* ldu, float* V, int* ldv, float* work, int* lwork, int* iwork, int* info );
59 void dgesvdx_( char* jobu, char* jobv, char* range, int* m, int* n, double* A, int* lda, double* vl, double* vu, int* il, int* iu, int* ns, double* s, double* U, int* ldu, double* V, int* ldv, double* work, int* lwork, int* iwork, int* info );
60 void cgesvdx_( char* jobu, char* jobv, char* range, int* m, int* n, float* A, int* lda, float* vl, float* vu, int* il, int* iu, int* ns, float* s, float* U, int* ldu, float* V, int* ldv, float* work, int* lwork, float* rwork, int* iwork, int* info );
61 void zgesvdx_( char* jobu, char* jobv, char* range, int* m, int* n, double* A, int* lda, double* vl, double* vu, int* il, int* iu, int* ns, double* s, double* U, int* ldu, double* V, int* ldv, double* work, int* lwork, double* rwork, int* iwork, int* info );
62 
63 }
64 #endif
65 
66 //*************************************************************************************************
67 
68 
69 
70 
71 namespace blaze {
72 
73 //=================================================================================================
74 //
75 // LAPACK SVD FUNCTIONS (GESVDX)
76 //
77 //=================================================================================================
78 
79 //*************************************************************************************************
82 inline void gesvdx( char jobu, char jobv, char range, int m, int n, float* A, int lda,
83  float vl, float vu, int il, int iu, int* ns,
84  float* s, float* U, int ldu, float* V, int ldv,
85  float* work, int lwork, int* iwork, int* info );
86 
87 inline void gesvdx( char jobu, char jobv, char range, int m, int n, double* A, int lda,
88  double vl, double vu, int il, int iu, int* ns,
89  double* s, double* U, int ldu, double* V, int ldv,
90  double* work, int lwork, int* iwork, int* info );
91 
92 inline void gesvdx( char jobu, char jobv, char range, int m, int n, complex<float>* A, int lda,
93  float vl, float vu, int il, int iu, int* ns,
94  float* s, complex<float>* U, int ldu, complex<float>* V, int ldv,
95  complex<float>* work, int lwork, float* rwork, int* iwork, int* info );
96 
97 inline void gesvdx( char jobu, char jobv, char range, int m, int n, complex<double>* A, int lda,
98  double vl, double vu, int il, int iu, int* ns,
99  double* s, complex<double>* U, int ldu, complex<double>* V, int ldv,
100  complex<double>* work, int lwork, double* rwork, int* iwork, int* info );
102 //*************************************************************************************************
103 
104 
105 //*************************************************************************************************
179 inline void gesvdx( char jobu, char jobv, char range, int m, int n, float* A, int lda,
180  float vl, float vu, int il, int iu, int* ns,
181  float* s, float* U, int ldu, float* V, int ldv,
182  float* work, int lwork, int* iwork, int* info )
183 {
184 #if defined(INTEL_MKL_VERSION) && (INTEL_MKL_VERSION >= 20170000)
185  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
186 #endif
187 
188  ++il;
189  ++iu;
190 
191  sgesvdx_( &jobu, &jobv, &range, &m, &n, A, &lda, &vl, &vu, &il, &iu, ns,
192  s, U, &ldu, V, &ldv, work, &lwork, iwork, info );
193 }
194 //*************************************************************************************************
195 
196 
197 //*************************************************************************************************
271 inline void gesvdx( char jobu, char jobv, char range, int m, int n, double* A, int lda,
272  double vl, double vu, int il, int iu, int* ns,
273  double* s, double* U, int ldu, double* V, int ldv,
274  double* work, int lwork, int* iwork, int* info )
275 {
276 #if defined(INTEL_MKL_VERSION) && (INTEL_MKL_VERSION >= 20170000)
277  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
278 #endif
279 
280  ++il;
281  ++iu;
282 
283  dgesvdx_( &jobu, &jobv, &range, &m, &n, A, &lda, &vl, &vu, &il, &iu, ns,
284  s, U, &ldu, V, &ldv, work, &lwork, iwork, info );
285 }
286 //*************************************************************************************************
287 
288 
289 //*************************************************************************************************
364 inline void gesvdx( char jobu, char jobv, char range, int m, int n, complex<float>* A, int lda,
365  float vl, float vu, int il, int iu, int* ns,
366  float* s, complex<float>* U, int ldu, complex<float>* V, int ldv,
367  complex<float>* work, int lwork, float* rwork, int* iwork, int* info )
368 {
369  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
370 
371 #if defined(INTEL_MKL_VERSION) && (INTEL_MKL_VERSION >= 20170000)
372  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
373  using ET = MKL_Complex8;
374 #else
375  using ET = float;
376 #endif
377 
378  ++il;
379  ++iu;
380 
381  cgesvdx_( &jobu, &jobv, &range, &m, &n, reinterpret_cast<ET*>( A ), &lda,
382  &vl, &vu, &il, &iu, ns, s,
383  reinterpret_cast<ET*>( U ), &ldu, reinterpret_cast<ET*>( V ), &ldv,
384  reinterpret_cast<ET*>( work ), &lwork, rwork, iwork, info );
385 }
386 //*************************************************************************************************
387 
388 
389 //*************************************************************************************************
464 inline void gesvdx( char jobu, char jobv, char range, int m, int n, complex<double>* A, int lda,
465  double vl, double vu, int il, int iu, int* ns,
466  double* s, complex<double>* U, int ldu, complex<double>* V, int ldv,
467  complex<double>* work, int lwork, double* rwork, int* iwork, int* info )
468 {
469  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
470 
471 #if defined(INTEL_MKL_VERSION) && (INTEL_MKL_VERSION >= 20170000)
472  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
473  using ET = MKL_Complex16;
474 #else
475  using ET = double;
476 #endif
477 
478  ++il;
479  ++iu;
480 
481  zgesvdx_( &jobu, &jobv, &range, &m, &n, reinterpret_cast<ET*>( A ), &lda,
482  &vl, &vu, &il, &iu, ns, s,
483  reinterpret_cast<ET*>( U ), &ldu, reinterpret_cast<ET*>( V ), &ldv,
484  reinterpret_cast<ET*>( work ), &lwork, rwork, iwork, info );
485 }
486 //*************************************************************************************************
487 
488 } // namespace blaze
489 
490 #endif
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Compile time assertion.
void gesvdx(char jobu, char jobv, char range, int m, int n, float *A, int lda, float vl, float vu, int il, int iu, int *ns, 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: gesvdx.h:179
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