LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ LAPACKE_zggsvp()

lapack_int LAPACKE_zggsvp ( int  matrix_layout,
char  jobu,
char  jobv,
char  jobq,
lapack_int  m,
lapack_int  p,
lapack_int  n,
lapack_complex_double a,
lapack_int  lda,
lapack_complex_double b,
lapack_int  ldb,
double  tola,
double  tolb,
lapack_int k,
lapack_int l,
lapack_complex_double u,
lapack_int  ldu,
lapack_complex_double v,
lapack_int  ldv,
lapack_complex_double q,
lapack_int  ldq 
)

Definition at line 36 of file lapacke_zggsvp.c.

45 {
46  lapack_int info = 0;
47  lapack_int* iwork = NULL;
48  double* rwork = NULL;
49  lapack_complex_double* tau = NULL;
50  lapack_complex_double* work = NULL;
51  if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
52  LAPACKE_xerbla( "LAPACKE_zggsvp", -1 );
53  return -1;
54  }
55 #ifndef LAPACK_DISABLE_NAN_CHECK
56  if( LAPACKE_get_nancheck() ) {
57  /* Optionally check input matrices for NaNs */
58  if( LAPACKE_zge_nancheck( matrix_layout, m, n, a, lda ) ) {
59  return -8;
60  }
61  if( LAPACKE_zge_nancheck( matrix_layout, p, n, b, ldb ) ) {
62  return -10;
63  }
64  if( LAPACKE_d_nancheck( 1, &tola, 1 ) ) {
65  return -12;
66  }
67  if( LAPACKE_d_nancheck( 1, &tolb, 1 ) ) {
68  return -13;
69  }
70  }
71 #endif
72  /* Allocate memory for working array(s) */
73  iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * MAX(1,n) );
74  if( iwork == NULL ) {
76  goto exit_level_0;
77  }
78  rwork = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,2*n) );
79  if( rwork == NULL ) {
81  goto exit_level_1;
82  }
83  tau = (lapack_complex_double*)
84  LAPACKE_malloc( sizeof(lapack_complex_double) * MAX(1,n) );
85  if( tau == NULL ) {
87  goto exit_level_2;
88  }
89  work = (lapack_complex_double*)
90  LAPACKE_malloc( sizeof(lapack_complex_double) * MAX(1,MAX3(3*n,m,p)) );
91  if( work == NULL ) {
93  goto exit_level_3;
94  }
95  /* Call middle-level interface */
96  info = LAPACKE_zggsvp_work( matrix_layout, jobu, jobv, jobq, m, p, n, a, lda,
97  b, ldb, tola, tolb, k, l, u, ldu, v, ldv, q,
98  ldq, iwork, rwork, tau, work );
99  /* Release memory and exit */
100  LAPACKE_free( work );
101 exit_level_3:
102  LAPACKE_free( tau );
103 exit_level_2:
104  LAPACKE_free( rwork );
105 exit_level_1:
106  LAPACKE_free( iwork );
107 exit_level_0:
108  if( info == LAPACK_WORK_MEMORY_ERROR ) {
109  LAPACKE_xerbla( "LAPACKE_zggsvp", info );
110  }
111  return info;
112 }
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:119
lapack_int LAPACKE_zggsvp_work(int matrix_layout, char jobu, char jobv, char jobq, lapack_int m, lapack_int p, lapack_int n, lapack_complex_double *a, lapack_int lda, lapack_complex_double *b, lapack_int ldb, double tola, double tolb, lapack_int *k, lapack_int *l, lapack_complex_double *u, lapack_int ldu, lapack_complex_double *v, lapack_int ldv, lapack_complex_double *q, lapack_int ldq, lapack_int *iwork, double *rwork, lapack_complex_double *tau, lapack_complex_double *work)
#define LAPACK_WORK_MEMORY_ERROR
Definition: lapacke.h:122
#define LAPACKE_free(p)
Definition: lapacke.h:113
#define lapack_complex_double
Definition: lapacke.h:90
#define MAX3(x, y, z)
Definition: lapacke_utils.h:53
#define MAX(x, y)
Definition: lapacke_utils.h:47
#define LAPACKE_malloc(size)
Definition: lapacke.h:110
lapack_logical LAPACKE_d_nancheck(lapack_int n, const double *x, lapack_int incx)
#define LAPACK_COL_MAJOR
Definition: lapacke.h:120
void LAPACKE_xerbla(const char *name, lapack_int info)
#define lapack_int
Definition: lapacke.h:47
lapack_logical LAPACKE_zge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const lapack_complex_double *a, lapack_int lda)
int LAPACKE_get_nancheck()
Here is the call graph for this function: