LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
lapack_int LAPACKE_dstevr_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,
double  abstol,
lapack_int m,
double *  w,
double *  z,
lapack_int  ldz,
lapack_int isuppz,
double *  work,
lapack_int  lwork,
lapack_int iwork,
lapack_int  liwork 
)

Definition at line 36 of file lapacke_dstevr_work.c.

43 {
44  lapack_int info = 0;
45  if( matrix_layout == LAPACK_COL_MAJOR ) {
46  /* Call LAPACK function and adjust info */
47  LAPACK_dstevr( &jobz, &range, &n, d, e, &vl, &vu, &il, &iu, &abstol, m,
48  w, z, &ldz, isuppz, work, &lwork, iwork, &liwork,
49  &info );
50  if( info < 0 ) {
51  info = info - 1;
52  }
53  } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
54  lapack_int ncols_z = ( LAPACKE_lsame( range, 'a' ) ||
55  LAPACKE_lsame( range, 'v' ) ) ? n :
56  ( LAPACKE_lsame( range, 'i' ) ? (iu-il+1) : 1);
57  lapack_int ldz_t = MAX(1,n);
58  double* z_t = NULL;
59  /* Check leading dimension(s) */
60  if( ldz < ncols_z ) {
61  info = -15;
62  LAPACKE_xerbla( "LAPACKE_dstevr_work", info );
63  return info;
64  }
65  /* Query optimal working array(s) size if requested */
66  if( liwork == -1 || lwork == -1 ) {
67  LAPACK_dstevr( &jobz, &range, &n, d, e, &vl, &vu, &il, &iu, &abstol,
68  m, w, z, &ldz_t, isuppz, work, &lwork, iwork,
69  &liwork, &info );
70  return (info < 0) ? (info - 1) : info;
71  }
72  /* Allocate memory for temporary array(s) */
73  if( LAPACKE_lsame( jobz, 'v' ) ) {
74  z_t = (double*)
75  LAPACKE_malloc( sizeof(double) * ldz_t * MAX(1,ncols_z) );
76  if( z_t == NULL ) {
78  goto exit_level_0;
79  }
80  }
81  /* Call LAPACK function and adjust info */
82  LAPACK_dstevr( &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_dge_trans( LAPACK_COL_MAJOR, n, ncols_z, z_t, ldz_t, z,
91  ldz );
92  }
93  /* Release memory and exit */
94  if( LAPACKE_lsame( jobz, 'v' ) ) {
95  LAPACKE_free( z_t );
96  }
97 exit_level_0:
98  if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
99  LAPACKE_xerbla( "LAPACKE_dstevr_work", info );
100  }
101  } else {
102  info = -1;
103  LAPACKE_xerbla( "LAPACKE_dstevr_work", info );
104  }
105  return info;
106 }
void LAPACKE_dge_trans(int matrix_layout, lapack_int m, lapack_int n, const double *in, lapack_int ldin, double *out, lapack_int ldout)
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:119
#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)
#define lapack_int
Definition: lapacke.h:47
#define LAPACK_TRANSPOSE_MEMORY_ERROR
Definition: lapacke.h:123
void LAPACK_dstevr(char *jobz, char *range, lapack_int *n, double *d, double *e, double *vl, double *vu, lapack_int *il, lapack_int *iu, double *abstol, lapack_int *m, double *w, double *z, lapack_int *ldz, lapack_int *isuppz, double *work, lapack_int *lwork, lapack_int *iwork, lapack_int *liwork, lapack_int *info)

Here is the call graph for this function:

Here is the caller graph for this function: