LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
lapack_int LAPACKE_chbevd_work ( int  matrix_layout,
char  jobz,
char  uplo,
lapack_int  n,
lapack_int  kd,
lapack_complex_float ab,
lapack_int  ldab,
float *  w,
lapack_complex_float z,
lapack_int  ldz,
lapack_complex_float work,
lapack_int  lwork,
float *  rwork,
lapack_int  lrwork,
lapack_int iwork,
lapack_int  liwork 
)

Definition at line 36 of file lapacke_chbevd_work.c.

44 {
45  lapack_int info = 0;
46  if( matrix_layout == LAPACK_COL_MAJOR ) {
47  /* Call LAPACK function and adjust info */
48  LAPACK_chbevd( &jobz, &uplo, &n, &kd, ab, &ldab, w, z, &ldz, work,
49  &lwork, rwork, &lrwork, iwork, &liwork, &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,kd+1);
55  lapack_int ldz_t = MAX(1,n);
56  lapack_complex_float* ab_t = NULL;
57  lapack_complex_float* z_t = NULL;
58  /* Check leading dimension(s) */
59  if( ldab < n ) {
60  info = -7;
61  LAPACKE_xerbla( "LAPACKE_chbevd_work", info );
62  return info;
63  }
64  if( ldz < n ) {
65  info = -10;
66  LAPACKE_xerbla( "LAPACKE_chbevd_work", info );
67  return info;
68  }
69  /* Query optimal working array(s) size if requested */
70  if( liwork == -1 || lrwork == -1 || lwork == -1 ) {
71  LAPACK_chbevd( &jobz, &uplo, &n, &kd, ab, &ldab_t, w, z, &ldz_t,
72  work, &lwork, rwork, &lrwork, iwork, &liwork,
73  &info );
74  return (info < 0) ? (info - 1) : info;
75  }
76  /* Allocate memory for temporary array(s) */
77  ab_t = (lapack_complex_float*)
78  LAPACKE_malloc( sizeof(lapack_complex_float) * ldab_t * MAX(1,n) );
79  if( ab_t == NULL ) {
81  goto exit_level_0;
82  }
83  if( LAPACKE_lsame( jobz, 'v' ) ) {
84  z_t = (lapack_complex_float*)
86  ldz_t * MAX(1,n) );
87  if( z_t == NULL ) {
89  goto exit_level_1;
90  }
91  }
92  /* Transpose input matrices */
93  LAPACKE_chb_trans( matrix_layout, uplo, n, kd, ab, ldab, ab_t, ldab_t );
94  /* Call LAPACK function and adjust info */
95  LAPACK_chbevd( &jobz, &uplo, &n, &kd, ab_t, &ldab_t, w, z_t, &ldz_t,
96  work, &lwork, rwork, &lrwork, iwork, &liwork, &info );
97  if( info < 0 ) {
98  info = info - 1;
99  }
100  /* Transpose output matrices */
101  LAPACKE_chb_trans( LAPACK_COL_MAJOR, uplo, n, kd, ab_t, ldab_t, ab,
102  ldab );
103  if( LAPACKE_lsame( jobz, 'v' ) ) {
104  LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, z_t, ldz_t, z, ldz );
105  }
106  /* Release memory and exit */
107  if( LAPACKE_lsame( jobz, 'v' ) ) {
108  LAPACKE_free( z_t );
109  }
110 exit_level_1:
111  LAPACKE_free( ab_t );
112 exit_level_0:
113  if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
114  LAPACKE_xerbla( "LAPACKE_chbevd_work", info );
115  }
116  } else {
117  info = -1;
118  LAPACKE_xerbla( "LAPACKE_chbevd_work", info );
119  }
120  return info;
121 }
void LAPACKE_cge_trans(int matrix_layout, lapack_int m, lapack_int n, const lapack_complex_float *in, lapack_int ldin, lapack_complex_float *out, lapack_int ldout)
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:119
#define lapack_complex_float
Definition: lapacke.h:74
#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
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)
void LAPACK_chbevd(char *jobz, char *uplo, lapack_int *n, lapack_int *kd, lapack_complex_float *ab, lapack_int *ldab, float *w, lapack_complex_float *z, lapack_int *ldz, lapack_complex_float *work, lapack_int *lwork, float *rwork, lapack_int *lrwork, lapack_int *iwork, lapack_int *liwork, lapack_int *info)
#define lapack_int
Definition: lapacke.h:47
#define LAPACK_TRANSPOSE_MEMORY_ERROR
Definition: lapacke.h:123
void LAPACKE_chb_trans(int matrix_layout, char uplo, lapack_int n, lapack_int kd, const lapack_complex_float *in, lapack_int ldin, lapack_complex_float *out, lapack_int ldout)

Here is the call graph for this function:

Here is the caller graph for this function: