Blaze  3.6
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 #include <blaze/util/Types.h>
46 
47 
48 //=================================================================================================
49 //
50 // LAPACK FORWARD DECLARATIONS
51 //
52 //=================================================================================================
53 
54 //*************************************************************************************************
56 #if !defined(INTEL_MKL_VERSION) || (INTEL_MKL_VERSION < 20170000)
57 extern "C" {
58 
59 void sgesvdx_( char* jobu, char* jobv, char* range, int* m, int* n, float* A, int* lda,
60  float* vl, float* vu, int* il, int* iu, int* ns, float* s, float* U, int* ldu,
61  float* V, int* ldv, float* work, int* lwork, int* iwork, int* info,
63 void dgesvdx_( char* jobu, char* jobv, char* range, int* m, int* n, double* A, int* lda,
64  double* vl, double* vu, int* il, int* iu, int* ns, double* s, double* U, int* ldu,
65  double* V, int* ldv, double* work, int* lwork, int* iwork, int* info,
67 void cgesvdx_( char* jobu, char* jobv, char* range, int* m, int* n, float* A, int* lda,
68  float* vl, float* vu, int* il, int* iu, int* ns, float* s, float* U, int* ldu,
69  float* V, int* ldv, float* work, int* lwork, float* rwork, int* iwork, int* info,
71 void zgesvdx_( char* jobu, char* jobv, char* range, int* m, int* n, double* A, int* lda,
72  double* vl, double* vu, int* il, int* iu, int* ns, double* s, double* U, int* ldu,
73  double* V, int* ldv, double* work, int* lwork, double* rwork, int* iwork, int* info,
75 
76 }
77 #endif
78 
79 //*************************************************************************************************
80 
81 
82 
83 
84 namespace blaze {
85 
86 //=================================================================================================
87 //
88 // LAPACK SVD FUNCTIONS (GESVDX)
89 //
90 //=================================================================================================
91 
92 //*************************************************************************************************
95 void gesvdx( char jobu, char jobv, char range, int m, int n, float* A, int lda,
96  float vl, float vu, int il, int iu, int* ns,
97  float* s, float* U, int ldu, float* V, int ldv,
98  float* work, int lwork, int* iwork, int* info );
99 
100 void gesvdx( char jobu, char jobv, char range, int m, int n, double* A, int lda,
101  double vl, double vu, int il, int iu, int* ns,
102  double* s, double* U, int ldu, double* V, int ldv,
103  double* work, int lwork, int* iwork, int* info );
104 
105 void gesvdx( char jobu, char jobv, char range, int m, int n, complex<float>* A, int lda,
106  float vl, float vu, int il, int iu, int* ns,
107  float* s, complex<float>* U, int ldu, complex<float>* V, int ldv,
108  complex<float>* work, int lwork, float* rwork, int* iwork, int* info );
109 
110 void gesvdx( char jobu, char jobv, char range, int m, int n, complex<double>* A, int lda,
111  double vl, double vu, int il, int iu, int* ns,
112  double* s, complex<double>* U, int ldu, complex<double>* V, int ldv,
113  complex<double>* work, int lwork, double* rwork, int* iwork, int* info );
115 //*************************************************************************************************
116 
117 
118 //*************************************************************************************************
192 inline void gesvdx( char jobu, char jobv, char range, int m, int n, float* A, int lda,
193  float vl, float vu, int il, int iu, int* ns,
194  float* s, float* U, int ldu, float* V, int ldv,
195  float* work, int lwork, int* iwork, int* info )
196 {
197 #if defined(INTEL_MKL_VERSION) && (INTEL_MKL_VERSION >= 20170000)
198  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
199 #endif
200 
201  ++il;
202  ++iu;
203 
204  sgesvdx_( &jobu, &jobv, &range, &m, &n, A, &lda, &vl, &vu, &il, &iu, ns,
205  s, U, &ldu, V, &ldv, work, &lwork, iwork, info,
207 }
208 //*************************************************************************************************
209 
210 
211 //*************************************************************************************************
285 inline void gesvdx( char jobu, char jobv, char range, int m, int n, double* A, int lda,
286  double vl, double vu, int il, int iu, int* ns,
287  double* s, double* U, int ldu, double* V, int ldv,
288  double* work, int lwork, int* iwork, int* info )
289 {
290 #if defined(INTEL_MKL_VERSION) && (INTEL_MKL_VERSION >= 20170000)
291  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
292 #endif
293 
294  ++il;
295  ++iu;
296 
297  dgesvdx_( &jobu, &jobv, &range, &m, &n, A, &lda, &vl, &vu, &il, &iu, ns,
298  s, U, &ldu, V, &ldv, work, &lwork, iwork, info,
300 }
301 //*************************************************************************************************
302 
303 
304 //*************************************************************************************************
379 inline void gesvdx( char jobu, char jobv, char range, int m, int n, complex<float>* A, int lda,
380  float vl, float vu, int il, int iu, int* ns,
381  float* s, complex<float>* U, int ldu, complex<float>* V, int ldv,
382  complex<float>* work, int lwork, float* rwork, int* iwork, int* info )
383 {
384  BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
385 
386 #if defined(INTEL_MKL_VERSION) && (INTEL_MKL_VERSION >= 20170000)
387  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
388  using ET = MKL_Complex8;
389 #else
390  using ET = float;
391 #endif
392 
393  ++il;
394  ++iu;
395 
396  cgesvdx_( &jobu, &jobv, &range, &m, &n, reinterpret_cast<ET*>( A ), &lda,
397  &vl, &vu, &il, &iu, ns, s,
398  reinterpret_cast<ET*>( U ), &ldu, reinterpret_cast<ET*>( V ), &ldv,
399  reinterpret_cast<ET*>( work ), &lwork, rwork, iwork, info,
401 }
402 //*************************************************************************************************
403 
404 
405 //*************************************************************************************************
480 inline void gesvdx( char jobu, char jobv, char range, int m, int n, complex<double>* A, int lda,
481  double vl, double vu, int il, int iu, int* ns,
482  double* s, complex<double>* U, int ldu, complex<double>* V, int ldv,
483  complex<double>* work, int lwork, double* rwork, int* iwork, int* info )
484 {
485  BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
486 
487 #if defined(INTEL_MKL_VERSION) && (INTEL_MKL_VERSION >= 20170000)
488  BLAZE_STATIC_ASSERT( sizeof( MKL_INT ) == sizeof( int ) );
489  using ET = MKL_Complex16;
490 #else
491  using ET = double;
492 #endif
493 
494  ++il;
495  ++iu;
496 
497  zgesvdx_( &jobu, &jobv, &range, &m, &n, reinterpret_cast<ET*>( A ), &lda,
498  &vl, &vu, &il, &iu, ns, s,
499  reinterpret_cast<ET*>( U ), &ldu, reinterpret_cast<ET*>( V ), &ldv,
500  reinterpret_cast<ET*>( work ), &lwork, rwork, iwork, info,
502 }
503 //*************************************************************************************************
504 
505 } // namespace blaze
506 
507 #endif
Header file for basic type definitions.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
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:192
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
Size type of the Blaze library.