LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
lapack_int LAPACKE_sstegr_work ( int  matrix_layout,
char  jobz,
char  range,
lapack_int  n,
float *  d,
float *  e,
float  vl,
float  vu,
lapack_int  il,
lapack_int  iu,
float  abstol,
lapack_int m,
float *  w,
float *  z,
lapack_int  ldz,
lapack_int isuppz,
float *  work,
lapack_int  lwork,
lapack_int iwork,
lapack_int  liwork 
)

Definition at line 36 of file lapacke_sstegr_work.c.

43 {
44  lapack_int info = 0;
45  if( matrix_layout == LAPACK_COL_MAJOR ) {
46  /* Call LAPACK function and adjust info */
47  LAPACK_sstegr( &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 ldz_t = MAX(1,n);
55  float* z_t = NULL;
56  /* Check leading dimension(s) */
57  if( ( LAPACKE_lsame( jobz, 'v' ) && ( ldz < ldz_t ) ) || ( ldz < 1 ) ) {
58  info = -15;
59  LAPACKE_xerbla( "LAPACKE_sstegr_work", info );
60  return info;
61  }
62  /* Query optimal working array(s) size if requested */
63  if( liwork == -1 || lwork == -1 ) {
64  LAPACK_sstegr( &jobz, &range, &n, d, e, &vl, &vu, &il, &iu, &abstol,
65  m, w, z, &ldz_t, isuppz, work, &lwork, iwork,
66  &liwork, &info );
67  return (info < 0) ? (info - 1) : info;
68  }
69  /* Allocate memory for temporary array(s) */
70  if( LAPACKE_lsame( jobz, 'v' ) ) {
71  /* Let be always 'n' instead of 'm' */
72  z_t = (float*)LAPACKE_malloc( sizeof(float) * ldz_t * MAX(1,n) );
73  if( z_t == NULL ) {
75  goto exit_level_0;
76  }
77  }
78  /* Call LAPACK function and adjust info */
79  LAPACK_sstegr( &jobz, &range, &n, d, e, &vl, &vu, &il, &iu, &abstol, m,
80  w, z_t, &ldz_t, isuppz, work, &lwork, iwork, &liwork,
81  &info );
82  if( info < 0 ) {
83  info = info - 1;
84  }
85  /* Transpose output matrices */
86  if( LAPACKE_lsame( jobz, 'v' ) ) {
87  LAPACKE_sge_trans( LAPACK_COL_MAJOR, n, *m, z_t, ldz_t, z, ldz );
88  }
89  /* Release memory and exit */
90  if( LAPACKE_lsame( jobz, 'v' ) ) {
91  LAPACKE_free( z_t );
92  }
93 exit_level_0:
94  if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
95  LAPACKE_xerbla( "LAPACKE_sstegr_work", info );
96  }
97  } else {
98  info = -1;
99  LAPACKE_xerbla( "LAPACKE_sstegr_work", info );
100  }
101  return info;
102 }
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:119
void LAPACK_sstegr(char *jobz, char *range, lapack_int *n, float *d, float *e, float *vl, float *vu, lapack_int *il, lapack_int *iu, float *abstol, lapack_int *m, float *w, float *z, lapack_int *ldz, lapack_int *isuppz, float *work, lapack_int *lwork, lapack_int *iwork, lapack_int *liwork, lapack_int *info)
void LAPACKE_sge_trans(int matrix_layout, lapack_int m, lapack_int n, const float *in, lapack_int ldin, float *out, lapack_int ldout)
#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

Here is the call graph for this function:

Here is the caller graph for this function: