LAPACK  3.10.1
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.

44 {
45  lapack_int info = 0;
46  if( matrix_layout == LAPACK_COL_MAJOR ) {
47  /* Call LAPACK function and adjust info */
48  LAPACK_zstemr( &jobz, &range, &n, d, e, &vl, &vu, &il, &iu, m, w, z,
49  &ldz, &nzc, isuppz, tryrac, 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_double* z_t = NULL;
57  /* Check leading dimension(s) */
58  if( ldz < 1 || ( LAPACKE_lsame( jobz, 'v' ) && ldz < n ) ) {
59  info = -14;
60  LAPACKE_xerbla( "LAPACKE_zstemr_work", info );
61  return info;
62  }
63  /* Query optimal working array(s) size if requested */
64  if( liwork == -1 || lwork == -1 ) {
65  LAPACK_zstemr( &jobz, &range, &n, d, e, &vl, &vu, &il, &iu, m, w, z,
66  &ldz_t, &nzc, isuppz, tryrac, 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  z_t = (lapack_complex_double*)
74  ldz_t * MAX(1,n) );
75  if( z_t == NULL ) {
77  goto exit_level_0;
78  }
79  }
80  /* Call LAPACK function and adjust info */
81  LAPACK_zstemr( &jobz, &range, &n, d, e, &vl, &vu, &il, &iu, m, w, z_t,
82  &ldz_t, &nzc, isuppz, tryrac, work, &lwork, iwork,
83  &liwork, &info );
84  if( info < 0 ) {
85  info = info - 1;
86  }
87  /* Transpose output matrices */
88  if( LAPACKE_lsame( jobz, 'v' ) ) {
89  LAPACKE_zge_trans( LAPACK_COL_MAJOR, n, n, z_t, ldz_t, z, ldz );
90  }
91  /* Release memory and exit */
92  if( LAPACKE_lsame( jobz, 'v' ) ) {
93  LAPACKE_free( z_t );
94  }
95 exit_level_0:
96  if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
97  LAPACKE_xerbla( "LAPACKE_zstemr_work", info );
98  }
99  } else {
100  info = -1;
101  LAPACKE_xerbla( "LAPACKE_zstemr_work", info );
102  }
103  return info;
104 }
#define LAPACK_zstemr(...)
Definition: lapack.h:16430
#define lapack_int
Definition: lapack.h:83
#define lapack_complex_double
Definition: lapack.h:63
#define LAPACK_COL_MAJOR
Definition: lapacke.h:53
#define LAPACKE_free(p)
Definition: lapacke.h:46
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:52
#define LAPACKE_malloc(size)
Definition: lapacke.h:43
#define LAPACK_TRANSPOSE_MEMORY_ERROR
Definition: lapacke.h:56
lapack_logical LAPACKE_lsame(char ca, char cb)
Definition: lapacke_lsame.c:35
void LAPACKE_xerbla(const char *name, lapack_int info)
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)
#define MAX(x, y)
Definition: lapacke_utils.h:46
Here is the call graph for this function:
Here is the caller graph for this function: