LAPACK  3.10.1
LAPACK: Linear Algebra PACKage

◆ LAPACKE_zhpevx_work()

lapack_int LAPACKE_zhpevx_work ( int  matrix_layout,
char  jobz,
char  range,
char  uplo,
lapack_int  n,
lapack_complex_double ap,
double  vl,
double  vu,
lapack_int  il,
lapack_int  iu,
double  abstol,
lapack_int m,
double *  w,
lapack_complex_double z,
lapack_int  ldz,
lapack_complex_double work,
double *  rwork,
lapack_int iwork,
lapack_int ifail 
)

Definition at line 35 of file lapacke_zhpevx_work.c.

43 {
44  lapack_int info = 0;
45  if( matrix_layout == LAPACK_COL_MAJOR ) {
46  /* Call LAPACK function and adjust info */
47  LAPACK_zhpevx( &jobz, &range, &uplo, &n, ap, &vl, &vu, &il, &iu,
48  &abstol, m, w, z, &ldz, work, rwork, iwork, ifail,
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  lapack_complex_double* z_t = NULL;
59  lapack_complex_double* ap_t = NULL;
60  /* Check leading dimension(s) */
61  if( ldz < ncols_z ) {
62  info = -15;
63  LAPACKE_xerbla( "LAPACKE_zhpevx_work", info );
64  return info;
65  }
66  /* Allocate memory for temporary array(s) */
67  if( LAPACKE_lsame( jobz, 'v' ) ) {
68  z_t = (lapack_complex_double*)
70  ldz_t * MAX(1,ncols_z) );
71  if( z_t == NULL ) {
73  goto exit_level_0;
74  }
75  }
76  ap_t = (lapack_complex_double*)
78  ( MAX(1,n) * MAX(2,n+1) ) / 2 );
79  if( ap_t == NULL ) {
81  goto exit_level_1;
82  }
83  /* Transpose input matrices */
84  LAPACKE_zhp_trans( matrix_layout, uplo, n, ap, ap_t );
85  /* Call LAPACK function and adjust info */
86  LAPACK_zhpevx( &jobz, &range, &uplo, &n, ap_t, &vl, &vu, &il, &iu,
87  &abstol, m, w, z_t, &ldz_t, work, rwork, iwork, ifail,
88  &info );
89  if( info < 0 ) {
90  info = info - 1;
91  }
92  /* Transpose output matrices */
93  if( LAPACKE_lsame( jobz, 'v' ) ) {
94  LAPACKE_zge_trans( LAPACK_COL_MAJOR, n, ncols_z, z_t, ldz_t, z,
95  ldz );
96  }
97  LAPACKE_zhp_trans( LAPACK_COL_MAJOR, uplo, n, ap_t, ap );
98  /* Release memory and exit */
99  LAPACKE_free( ap_t );
100 exit_level_1:
101  if( LAPACKE_lsame( jobz, 'v' ) ) {
102  LAPACKE_free( z_t );
103  }
104 exit_level_0:
105  if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
106  LAPACKE_xerbla( "LAPACKE_zhpevx_work", info );
107  }
108  } else {
109  info = -1;
110  LAPACKE_xerbla( "LAPACKE_zhpevx_work", info );
111  }
112  return info;
113 }
#define lapack_int
Definition: lapack.h:83
#define LAPACK_zhpevx(...)
Definition: lapack.h:8591
#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)
void LAPACKE_zhp_trans(int matrix_layout, char uplo, lapack_int n, const lapack_complex_double *in, lapack_complex_double *out)
#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: