LAPACK  3.9.0
LAPACK: Linear Algebra PACKage

◆ LAPACKE_dstevr_work()

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 35 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;
Here is the call graph for this function:
Here is the caller graph for this function:
LAPACK_dstevr
void LAPACK_dstevr(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, double const *abstol, lapack_int *m, double *W, double *Z, lapack_int const *ldz, lapack_int *ISUPPZ, double *work, lapack_int const *lwork, lapack_int *iwork, lapack_int const *liwork, lapack_int *info)
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
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
LAPACKE_dge_trans
void LAPACKE_dge_trans(int matrix_layout, lapack_int m, lapack_int n, const double *in, lapack_int ldin, double *out, lapack_int ldout)
Definition: lapacke_dge_trans.c:39
LAPACK_COL_MAJOR
#define LAPACK_COL_MAJOR
Definition: lapacke.h:54