LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
lapack_int LAPACKE_zgbbrd_work ( int  matrix_layout,
char  vect,
lapack_int  m,
lapack_int  n,
lapack_int  ncc,
lapack_int  kl,
lapack_int  ku,
lapack_complex_double ab,
lapack_int  ldab,
double *  d,
double *  e,
lapack_complex_double q,
lapack_int  ldq,
lapack_complex_double pt,
lapack_int  ldpt,
lapack_complex_double c,
lapack_int  ldc,
lapack_complex_double work,
double *  rwork 
)

Definition at line 36 of file lapacke_zgbbrd_work.c.

44 {
45  lapack_int info = 0;
46  if( matrix_layout == LAPACK_COL_MAJOR ) {
47  /* Call LAPACK function and adjust info */
48  LAPACK_zgbbrd( &vect, &m, &n, &ncc, &kl, &ku, ab, &ldab, d, e, q, &ldq,
49  pt, &ldpt, c, &ldc, work, rwork, &info );
50  if( info < 0 ) {
51  info = info - 1;
52  }
53  } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
54  lapack_int ldab_t = MAX(1,kl+ku+1);
55  lapack_int ldc_t = MAX(1,m);
56  lapack_int ldpt_t = MAX(1,n);
57  lapack_int ldq_t = MAX(1,m);
58  lapack_complex_double* ab_t = NULL;
59  lapack_complex_double* q_t = NULL;
60  lapack_complex_double* pt_t = NULL;
61  lapack_complex_double* c_t = NULL;
62  /* Check leading dimension(s) */
63  if( ldab < n ) {
64  info = -9;
65  LAPACKE_xerbla( "LAPACKE_zgbbrd_work", info );
66  return info;
67  }
68  if( ldc < ncc ) {
69  info = -17;
70  LAPACKE_xerbla( "LAPACKE_zgbbrd_work", info );
71  return info;
72  }
73  if( ldpt < n ) {
74  info = -15;
75  LAPACKE_xerbla( "LAPACKE_zgbbrd_work", info );
76  return info;
77  }
78  if( ldq < m ) {
79  info = -13;
80  LAPACKE_xerbla( "LAPACKE_zgbbrd_work", info );
81  return info;
82  }
83  /* Allocate memory for temporary array(s) */
84  ab_t = (lapack_complex_double*)
85  LAPACKE_malloc( sizeof(lapack_complex_double) * ldab_t * MAX(1,n) );
86  if( ab_t == NULL ) {
88  goto exit_level_0;
89  }
90  if( LAPACKE_lsame( vect, 'b' ) || LAPACKE_lsame( vect, 'q' ) ) {
91  q_t = (lapack_complex_double*)
93  ldq_t * MAX(1,m) );
94  if( q_t == NULL ) {
96  goto exit_level_1;
97  }
98  }
99  if( LAPACKE_lsame( vect, 'b' ) || LAPACKE_lsame( vect, 'p' ) ) {
100  pt_t = (lapack_complex_double*)
102  ldpt_t * MAX(1,n) );
103  if( pt_t == NULL ) {
105  goto exit_level_2;
106  }
107  }
108  if( ncc != 0 ) {
109  c_t = (lapack_complex_double*)
111  ldc_t * MAX(1,ncc) );
112  if( c_t == NULL ) {
114  goto exit_level_3;
115  }
116  }
117  /* Transpose input matrices */
118  LAPACKE_zgb_trans( matrix_layout, m, n, kl, ku, ab, ldab, ab_t, ldab_t );
119  if( ncc != 0 ) {
120  LAPACKE_zge_trans( matrix_layout, m, ncc, c, ldc, c_t, ldc_t );
121  }
122  /* Call LAPACK function and adjust info */
123  LAPACK_zgbbrd( &vect, &m, &n, &ncc, &kl, &ku, ab_t, &ldab_t, d, e, q_t,
124  &ldq_t, pt_t, &ldpt_t, c_t, &ldc_t, work, rwork, &info );
125  if( info < 0 ) {
126  info = info - 1;
127  }
128  /* Transpose output matrices */
129  LAPACKE_zgb_trans( LAPACK_COL_MAJOR, m, n, kl, ku, ab_t, ldab_t, ab,
130  ldab );
131  if( LAPACKE_lsame( vect, 'b' ) || LAPACKE_lsame( vect, 'q' ) ) {
132  LAPACKE_zge_trans( LAPACK_COL_MAJOR, m, m, q_t, ldq_t, q, ldq );
133  }
134  if( LAPACKE_lsame( vect, 'b' ) || LAPACKE_lsame( vect, 'p' ) ) {
135  LAPACKE_zge_trans( LAPACK_COL_MAJOR, n, n, pt_t, ldpt_t, pt, ldpt );
136  }
137  if( ncc != 0 ) {
138  LAPACKE_zge_trans( LAPACK_COL_MAJOR, m, ncc, c_t, ldc_t, c, ldc );
139  }
140  /* Release memory and exit */
141  if( ncc != 0 ) {
142  LAPACKE_free( c_t );
143  }
144 exit_level_3:
145  if( LAPACKE_lsame( vect, 'b' ) || LAPACKE_lsame( vect, 'p' ) ) {
146  LAPACKE_free( pt_t );
147  }
148 exit_level_2:
149  if( LAPACKE_lsame( vect, 'b' ) || LAPACKE_lsame( vect, 'q' ) ) {
150  LAPACKE_free( q_t );
151  }
152 exit_level_1:
153  LAPACKE_free( ab_t );
154 exit_level_0:
155  if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
156  LAPACKE_xerbla( "LAPACKE_zgbbrd_work", info );
157  }
158  } else {
159  info = -1;
160  LAPACKE_xerbla( "LAPACKE_zgbbrd_work", info );
161  }
162  return info;
163 }
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:119
#define lapack_complex_double
Definition: lapacke.h:90
void LAPACKE_zgb_trans(int matrix_layout, lapack_int m, lapack_int n, lapack_int kl, lapack_int ku, const lapack_complex_double *in, lapack_int ldin, lapack_complex_double *out, lapack_int ldout)
#define MAX(x, y)
Definition: lapacke_utils.h:47
#define LAPACKE_free(p)
Definition: lapacke.h:113
#define LAPACKE_malloc(size)
Definition: lapacke.h:110
void LAPACK_zgbbrd(char *vect, lapack_int *m, lapack_int *n, lapack_int *ncc, lapack_int *kl, lapack_int *ku, lapack_complex_double *ab, lapack_int *ldab, double *d, double *e, lapack_complex_double *q, lapack_int *ldq, lapack_complex_double *pt, lapack_int *ldpt, lapack_complex_double *c, lapack_int *ldc, lapack_complex_double *work, double *rwork, lapack_int *info)
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
#define LAPACK_TRANSPOSE_MEMORY_ERROR
Definition: lapacke.h:123
void LAPACKE_zge_trans(int matrix_layout, lapack_int m, lapack_int n, const lapack_complex_double *in, lapack_int ldin, lapack_complex_double *out, lapack_int ldout)

Here is the call graph for this function:

Here is the caller graph for this function: