LAPACK  3.9.1
LAPACK: Linear Algebra PACKage

◆ LAPACKE_dstevx_work()

lapack_int LAPACKE_dstevx_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,
double *  work,
lapack_int iwork,
lapack_int ifail 
)

Definition at line 35 of file lapacke_dstevx_work.c.

41 {
42  lapack_int info = 0;
43  if( matrix_layout == LAPACK_COL_MAJOR ) {
44  /* Call LAPACK function and adjust info */
45  LAPACK_dstevx( &jobz, &range, &n, d, e, &vl, &vu, &il, &iu, &abstol, m,
46  w, z, &ldz, work, iwork, ifail, &info );
47  if( info < 0 ) {
48  info = info - 1;
49  }
50  } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
51  lapack_int ncols_z = ( LAPACKE_lsame( range, 'a' ) ||
52  LAPACKE_lsame( range, 'v' ) ) ? n :
53  ( LAPACKE_lsame( range, 'i' ) ? (iu-il+1) : 1);
54  lapack_int ldz_t = MAX(1,n);
55  double* z_t = NULL;
56  /* Check leading dimension(s) */
57  if( ldz < ncols_z ) {
58  info = -15;
59  LAPACKE_xerbla( "LAPACKE_dstevx_work", info );
60  return info;
61  }
62  /* Allocate memory for temporary array(s) */
63  if( LAPACKE_lsame( jobz, 'v' ) ) {
64  z_t = (double*)
65  LAPACKE_malloc( sizeof(double) * ldz_t * MAX(1,ncols_z) );
66  if( z_t == NULL ) {
68  goto exit_level_0;
69  }
70  }
71  /* Call LAPACK function and adjust info */
72  LAPACK_dstevx( &jobz, &range, &n, d, e, &vl, &vu, &il, &iu, &abstol, m,
73  w, z_t, &ldz_t, work, iwork, ifail, &info );
74  if( info < 0 ) {
75  info = info - 1;
76  }
77  /* Transpose output matrices */
78  if( LAPACKE_lsame( jobz, 'v' ) ) {
79  LAPACKE_dge_trans( LAPACK_COL_MAJOR, n, ncols_z, z_t, ldz_t, z,
80  ldz );
81  }
82  /* Release memory and exit */
83  if( LAPACKE_lsame( jobz, 'v' ) ) {
84  LAPACKE_free( z_t );
85  }
86 exit_level_0:
87  if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
88  LAPACKE_xerbla( "LAPACKE_dstevx_work", info );
89  }
90  } else {
91  info = -1;
92  LAPACKE_xerbla( "LAPACKE_dstevx_work", info );
93  }
94  return info;
95 }
void LAPACK_dstevx(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, double *work, lapack_int *iwork, lapack_int *IFAIL, lapack_int *info)
#define lapack_int
Definition: lapack.h:83
#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)
#define MAX(x, y)
Definition: lapacke_utils.h:46
void LAPACKE_dge_trans(int matrix_layout, lapack_int m, lapack_int n, const double *in, lapack_int ldin, double *out, lapack_int ldout)
Here is the call graph for this function:
Here is the caller graph for this function: