LAPACK  3.10.0
LAPACK: Linear Algebra PACKage

◆ LAPACKE_sstegr_work()

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 35 of file lapacke_sstegr_work.c.

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