LAPACK  3.9.0
LAPACK: Linear Algebra PACKage

◆ LAPACKE_zstemr_work()

lapack_int LAPACKE_zstemr_work ( int  matrix_layout,
char  jobz,
char  range,
lapack_int  n,
double *  d,
double *  e,
double  vl,
double  vu,
lapack_int  il,
lapack_int  iu,
lapack_int m,
double *  w,
lapack_complex_double z,
lapack_int  ldz,
lapack_int  nzc,
lapack_int isuppz,
lapack_logical tryrac,
double *  work,
lapack_int  lwork,
lapack_int iwork,
lapack_int  liwork 
)

Definition at line 35 of file lapacke_zstemr_work.c.

45 {
46  lapack_int info = 0;
47  if( matrix_layout == LAPACK_COL_MAJOR ) {
48  /* Call LAPACK function and adjust info */
49  LAPACK_zstemr( &jobz, &range, &n, d, e, &vl, &vu, &il, &iu, m, w, z,
50  &ldz, &nzc, isuppz, tryrac, work, &lwork, iwork, &liwork,
51  &info );
52  if( info < 0 ) {
53  info = info - 1;
54  }
55  } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
56  lapack_int ldz_t = MAX(1,n);
57  lapack_complex_double* z_t = NULL;
58  /* Check leading dimension(s) */
59  if( ldz < 1 || ( LAPACKE_lsame( jobz, 'v' ) && ldz < n ) ) {
60  info = -14;
61  LAPACKE_xerbla( "LAPACKE_zstemr_work", info );
62  return info;
63  }
64  /* Query optimal working array(s) size if requested */
65  if( liwork == -1 || lwork == -1 ) {
66  LAPACK_zstemr( &jobz, &range, &n, d, e, &vl, &vu, &il, &iu, m, w, z,
67  &ldz_t, &nzc, isuppz, tryrac, work, &lwork, iwork,
68  &liwork, &info );
69  return (info < 0) ? (info - 1) : info;
70  }
71  /* Allocate memory for temporary array(s) */
72  if( LAPACKE_lsame( jobz, 'v' ) ) {
73  z_t = (lapack_complex_double*)
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_zstemr( &jobz, &range, &n, d, e, &vl, &vu, &il, &iu, m, w, z_t,
83  &ldz_t, &nzc, isuppz, tryrac, work, &lwork, iwork,
84  &liwork, &info );
85  if( info < 0 ) {
86  info = info - 1;
87  }
88  /* Transpose output matrices */
89  if( LAPACKE_lsame( jobz, 'v' ) ) {
90  LAPACKE_zge_trans( LAPACK_COL_MAJOR, n, n, 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_zstemr_work", info );
99  }
100  } else {
101  info = -1;
102  LAPACKE_xerbla( "LAPACKE_zstemr_work", info );
103  }
104  return info;
Here is the call graph for this function:
Here is the caller graph for this function:
LAPACKE_free
#define LAPACKE_free(p)
Definition: lapacke.h:47
lapack_int
#define lapack_int
Definition: lapack.h:21
LAPACKE_xerbla
void LAPACKE_xerbla(const char *name, lapack_int info)
Definition: lapacke_xerbla.c:36
MAX
#define MAX(x, y)
Definition: lapacke_utils.h:47
LAPACK_TRANSPOSE_MEMORY_ERROR
#define LAPACK_TRANSPOSE_MEMORY_ERROR
Definition: lapacke.h:57
lapack_complex_double
#define lapack_complex_double
Definition: lapack.h:70
LAPACK_zstemr
void LAPACK_zstemr(char const *jobz, char const *range, lapack_int const *n, double *D, double *E, double const *vl, double const *vu, lapack_int const *il, lapack_int const *iu, lapack_int *m, double *W, lapack_complex_double *Z, lapack_int const *ldz, lapack_int const *nzc, lapack_int *ISUPPZ, lapack_logical *tryrac, double *work, lapack_int const *lwork, lapack_int *iwork, lapack_int const *liwork, lapack_int *info)
LAPACKE_malloc
#define LAPACKE_malloc(size)
Definition: lapacke.h:44
LAPACKE_lsame
lapack_logical LAPACKE_lsame(char ca, char cb)
Definition: lapacke_lsame.c:35
LAPACK_ROW_MAJOR
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:53
LAPACK_COL_MAJOR
#define LAPACK_COL_MAJOR
Definition: lapacke.h:54
LAPACKE_zge_trans
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)
Definition: lapacke_zge_trans.c:39