LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ LAPACKE_zunbdb()

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  int lapack_layout;
53  if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
54  LAPACKE_xerbla( "LAPACKE_zunbdb", -1 );
55  return -1;
56  }
57  if( LAPACKE_lsame( trans, 'n' ) && matrix_layout == LAPACK_COL_MAJOR ) {
58  lapack_layout = LAPACK_COL_MAJOR;
59  } else {
60  lapack_layout = LAPACK_ROW_MAJOR;
61  }
62 #ifndef LAPACK_DISABLE_NAN_CHECK
63  if( LAPACKE_get_nancheck() ) {
64  /* Optionally check input matrices for NaNs */
65  if( LAPACKE_zge_nancheck( lapack_layout, p, q, x11, ldx11 ) ) {
66  return -7;
67  }
68  if( LAPACKE_zge_nancheck( lapack_layout, p, m-q, x12, ldx12 ) ) {
69  return -9;
70  }
71  if( LAPACKE_zge_nancheck( lapack_layout, m-p, q, x21, ldx21 ) ) {
72  return -11;
73  }
74  if( LAPACKE_zge_nancheck( lapack_layout, m-p, m-q, x22, ldx22 ) ) {
75  return -13;
76  }
77  }
78 #endif
79  /* Query optimal working array(s) size */
80  info = LAPACKE_zunbdb_work( matrix_layout, trans, signs, m, p, q, x11, ldx11,
81  x12, ldx12, x21, ldx21, x22, ldx22, theta, phi,
82  taup1, taup2, tauq1, tauq2, &work_query,
83  lwork );
84  if( info != 0 ) {
85  goto exit_level_0;
86  }
87  lwork = LAPACK_Z2INT( work_query );
88  /* Allocate memory for work arrays */
89  work = (lapack_complex_double*)
90  LAPACKE_malloc( sizeof(lapack_complex_double) * lwork );
91  if( work == NULL ) {
93  goto exit_level_0;
94  }
95  /* Call middle-level interface */
96  info = LAPACKE_zunbdb_work( matrix_layout, trans, signs, m, p, q, x11, ldx11,
97  x12, ldx12, x21, ldx21, x22, ldx22, theta, phi,
98  taup1, taup2, tauq1, tauq2, work, lwork );
99  /* Release memory and exit */
100  LAPACKE_free( work );
101 exit_level_0:
102  if( info == LAPACK_WORK_MEMORY_ERROR ) {
103  LAPACKE_xerbla( "LAPACKE_zunbdb", info );
104  }
105  return info;
106 }
#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 LAPACKE_free(p)
Definition: lapacke.h:113
#define lapack_complex_double
Definition: lapacke.h:90
#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)
int LAPACKE_get_nancheck()
Here is the call graph for this function: