LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
lapack_int LAPACKE_zunbdb ( int  matrix_layout,
char  trans,
char  signs,
lapack_int  m,
lapack_int  p,
lapack_int  q,
lapack_complex_double x11,
lapack_int  ldx11,
lapack_complex_double x12,
lapack_int  ldx12,
lapack_complex_double x21,
lapack_int  ldx21,
lapack_complex_double x22,
lapack_int  ldx22,
double *  theta,
double *  phi,
lapack_complex_double taup1,
lapack_complex_double taup2,
lapack_complex_double tauq1,
lapack_complex_double tauq2 
)

Definition at line 36 of file lapacke_zunbdb.c.

47 {
48  lapack_int info = 0;
49  lapack_int lwork = -1;
50  lapack_complex_double* work = NULL;
51  lapack_complex_double work_query;
52  lapack_int nrows_x11, nrows_x12, nrows_x21, nrows_x22;
53  if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
54  LAPACKE_xerbla( "LAPACKE_zunbdb", -1 );
55  return -1;
56  }
57 #ifndef LAPACK_DISABLE_NAN_CHECK
58  /* Optionally check input matrices for NaNs */
59  nrows_x11 = ( LAPACKE_lsame( trans, 'n' ) ? p : q);
60  nrows_x12 = ( LAPACKE_lsame( trans, 'n' ) ? p : m-q);
61  nrows_x21 = ( LAPACKE_lsame( trans, 'n' ) ? m-p : q);
62  nrows_x22 = ( LAPACKE_lsame( trans, 'n' ) ? m-p : m-q);
63  if( LAPACKE_zge_nancheck( matrix_layout, nrows_x11, q, x11, ldx11 ) ) {
64  return -7;
65  }
66  if( LAPACKE_zge_nancheck( matrix_layout, nrows_x12, m-q, x12, ldx12 ) ) {
67  return -9;
68  }
69  if( LAPACKE_zge_nancheck( matrix_layout, nrows_x21, q, x21, ldx21 ) ) {
70  return -11;
71  }
72  if( LAPACKE_zge_nancheck( matrix_layout, nrows_x22, m-q, x22, ldx22 ) ) {
73  return -13;
74  }
75 #endif
76  /* Query optimal working array(s) size */
77  info = LAPACKE_zunbdb_work( matrix_layout, trans, signs, m, p, q, x11, ldx11,
78  x12, ldx12, x21, ldx21, x22, ldx22, theta, phi,
79  taup1, taup2, tauq1, tauq2, &work_query,
80  lwork );
81  if( info != 0 ) {
82  goto exit_level_0;
83  }
84  lwork = LAPACK_Z2INT( work_query );
85  /* Allocate memory for work arrays */
86  work = (lapack_complex_double*)
87  LAPACKE_malloc( sizeof(lapack_complex_double) * lwork );
88  if( work == NULL ) {
90  goto exit_level_0;
91  }
92  /* Call middle-level interface */
93  info = LAPACKE_zunbdb_work( matrix_layout, trans, signs, m, p, q, x11, ldx11,
94  x12, ldx12, x21, ldx21, x22, ldx22, theta, phi,
95  taup1, taup2, tauq1, tauq2, work, lwork );
96  /* Release memory and exit */
97  LAPACKE_free( work );
98 exit_level_0:
99  if( info == LAPACK_WORK_MEMORY_ERROR ) {
100  LAPACKE_xerbla( "LAPACKE_zunbdb", info );
101  }
102  return info;
103 }
#define LAPACK_Z2INT(x)
Definition: lapacke.h:117
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:119
#define LAPACK_WORK_MEMORY_ERROR
Definition: lapacke.h:122
#define lapack_complex_double
Definition: lapacke.h:90
#define LAPACKE_free(p)
Definition: lapacke.h:113
#define LAPACKE_malloc(size)
Definition: lapacke.h:110
lapack_logical LAPACKE_lsame(char ca, char cb)
Definition: lapacke_lsame.c:36
#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)
lapack_int LAPACKE_zunbdb_work(int matrix_layout, char trans, char signs, lapack_int m, lapack_int p, lapack_int q, lapack_complex_double *x11, lapack_int ldx11, lapack_complex_double *x12, lapack_int ldx12, lapack_complex_double *x21, lapack_int ldx21, lapack_complex_double *x22, lapack_int ldx22, double *theta, double *phi, lapack_complex_double *taup1, lapack_complex_double *taup2, lapack_complex_double *tauq1, lapack_complex_double *tauq2, lapack_complex_double *work, lapack_int lwork)

Here is the call graph for this function: