LAPACK  3.7.1
LAPACK: Linear Algebra PACKage

◆ LAPACKE_cstegr_work()

lapack_int LAPACKE_cstegr_work ( int  matrix_layout,
char  jobz,
char  range,
lapack_int  n,
float *  d,
float *  e,
float  vl,
float  vu,
lapack_int  il,
lapack_int  iu,
float  abstol,
lapack_int m,
float *  w,
lapack_complex_float z,
lapack_int  ldz,
lapack_int isuppz,
float *  work,
lapack_int  lwork,
lapack_int iwork,
lapack_int  liwork 
)

Definition at line 36 of file lapacke_cstegr_work.c.

44 {
45  lapack_int info = 0;
46  if( matrix_layout == LAPACK_COL_MAJOR ) {
47  /* Call LAPACK function and adjust info */
48  LAPACK_cstegr( &jobz, &range, &n, d, e, &vl, &vu, &il, &iu, &abstol, m,
49  w, z, &ldz, isuppz, work, &lwork, iwork, &liwork,
50  &info );
51  if( info < 0 ) {
52  info = info - 1;
53  }
54  } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
55  lapack_int ldz_t = MAX(1,n);
56  lapack_complex_float* z_t = NULL;
57  /* Check leading dimension(s) */
58  if( ( LAPACKE_lsame( jobz, 'v' ) && ( ldz < ldz_t ) ) || ( ldz < 1 ) ) {
59  info = -15;
60  LAPACKE_xerbla( "LAPACKE_cstegr_work", info );
61  return info;
62  }
63  /* Query optimal working array(s) size if requested */
64  if( liwork == -1 || lwork == -1 ) {
65  LAPACK_cstegr( &jobz, &range, &n, d, e, &vl, &vu, &il, &iu, &abstol,
66  m, w, z, &ldz_t, isuppz, work, &lwork, iwork,
67  &liwork, &info );
68  return (info < 0) ? (info - 1) : info;
69  }
70  /* Allocate memory for temporary array(s) */
71  if( LAPACKE_lsame( jobz, 'v' ) ) {
72  /* Let be always 'n' instead of 'm' */
73  z_t = (lapack_complex_float*)
75  ldz_t * MAX(1,n) );
76  if( z_t == NULL ) {
78  goto exit_level_0;
79  }
80  }
81  /* Call LAPACK function and adjust info */
82  LAPACK_cstegr( &jobz, &range, &n, d, e, &vl, &vu, &il, &iu, &abstol, m,
83  w, z_t, &ldz_t, isuppz, work, &lwork, iwork, &liwork,
84  &info );
85  if( info < 0 ) {
86  info = info - 1;
87  }
88  /* Transpose output matrices */
89  if( LAPACKE_lsame( jobz, 'v' ) ) {
90  LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, *m, z_t, ldz_t, z, ldz );
91  }
92  /* Release memory and exit */
93  if( LAPACKE_lsame( jobz, 'v' ) ) {
94  LAPACKE_free( z_t );
95  }
96 exit_level_0:
97  if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
98  LAPACKE_xerbla( "LAPACKE_cstegr_work", info );
99  }
100  } else {
101  info = -1;
102  LAPACKE_xerbla( "LAPACKE_cstegr_work", info );
103  }
104  return info;
105 }
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 LAPACKE_free(p)
Definition: lapacke.h:113
#define lapack_complex_float
Definition: lapacke.h:74
#define MAX(x, y)
Definition: lapacke_utils.h:47
#define LAPACKE_malloc(size)
Definition: lapacke.h:110
void LAPACK_cstegr(char *jobz, char *range, lapack_int *n, float *d, float *e, float *vl, float *vu, lapack_int *il, lapack_int *iu, float *abstol, lapack_int *m, float *w, lapack_complex_float *z, lapack_int *ldz, lapack_int *isuppz, float *work, lapack_int *lwork, lapack_int *iwork, lapack_int *liwork, 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
Here is the call graph for this function:
Here is the caller graph for this function: