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

Definition at line 36 of file lapacke_cunbdb.c.

47 {
48  lapack_int info = 0;
49  lapack_int lwork = -1;
50  lapack_complex_float* work = NULL;
51  lapack_complex_float 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_cunbdb", -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_cge_nancheck( matrix_layout, nrows_x11, q, x11, ldx11 ) ) {
64  return -7;
65  }
66  if( LAPACKE_cge_nancheck( matrix_layout, nrows_x12, m-q, x12, ldx12 ) ) {
67  return -9;
68  }
69  if( LAPACKE_cge_nancheck( matrix_layout, nrows_x21, q, x21, ldx21 ) ) {
70  return -11;
71  }
72  if( LAPACKE_cge_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_cunbdb_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_C2INT( work_query );
85  /* Allocate memory for work arrays */
86  work = (lapack_complex_float*)
87  LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
88  if( work == NULL ) {
90  goto exit_level_0;
91  }
92  /* Call middle-level interface */
93  info = LAPACKE_cunbdb_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_cunbdb", info );
101  }
102  return info;
103 }
lapack_int LAPACKE_cunbdb_work(int matrix_layout, char trans, char signs, lapack_int m, lapack_int p, lapack_int q, lapack_complex_float *x11, lapack_int ldx11, lapack_complex_float *x12, lapack_int ldx12, lapack_complex_float *x21, lapack_int ldx21, lapack_complex_float *x22, lapack_int ldx22, float *theta, float *phi, lapack_complex_float *taup1, lapack_complex_float *taup2, lapack_complex_float *tauq1, lapack_complex_float *tauq2, lapack_complex_float *work, lapack_int lwork)
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:119
#define LAPACK_WORK_MEMORY_ERROR
Definition: lapacke.h:122
#define lapack_complex_float
Definition: lapacke.h:74
lapack_logical LAPACKE_cge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const lapack_complex_float *a, lapack_int lda)
#define LAPACKE_free(p)
Definition: lapacke.h:113
#define LAPACKE_malloc(size)
Definition: lapacke.h:110
#define LAPACK_C2INT(x)
Definition: lapacke.h:116
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

Here is the call graph for this function: