LAPACK  3.10.1
LAPACK: Linear Algebra PACKage

◆ LAPACKE_sgeevx()

lapack_int LAPACKE_sgeevx ( int  matrix_layout,
char  balanc,
char  jobvl,
char  jobvr,
char  sense,
lapack_int  n,
float *  a,
lapack_int  lda,
float *  wr,
float *  wi,
float *  vl,
lapack_int  ldvl,
float *  vr,
lapack_int  ldvr,
lapack_int ilo,
lapack_int ihi,
float *  scale,
float *  abnrm,
float *  rconde,
float *  rcondv 
)

Definition at line 35 of file lapacke_sgeevx.c.

41 {
42  lapack_int info = 0;
43  lapack_int lwork = -1;
44  lapack_int* iwork = NULL;
45  float* work = NULL;
46  float work_query;
47  if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
48  LAPACKE_xerbla( "LAPACKE_sgeevx", -1 );
49  return -1;
50  }
51 #ifndef LAPACK_DISABLE_NAN_CHECK
52  if( LAPACKE_get_nancheck() ) {
53  /* Optionally check input matrices for NaNs */
54  if( LAPACKE_sge_nancheck( matrix_layout, n, n, a, lda ) ) {
55  return -7;
56  }
57  }
58 #endif
59  /* Allocate memory for working array(s) */
60  if( LAPACKE_lsame( sense, 'b' ) || LAPACKE_lsame( sense, 'v' ) ) {
61  iwork = (lapack_int*)
62  LAPACKE_malloc( sizeof(lapack_int) * MAX(1,2*n-2) );
63  if( iwork == NULL ) {
65  goto exit_level_0;
66  }
67  }
68  /* Query optimal working array(s) size */
69  info = LAPACKE_sgeevx_work( matrix_layout, balanc, jobvl, jobvr, sense, n, a,
70  lda, wr, wi, vl, ldvl, vr, ldvr, ilo, ihi,
71  scale, abnrm, rconde, rcondv, &work_query,
72  lwork, iwork );
73  if( info != 0 ) {
74  goto exit_level_1;
75  }
76  lwork = (lapack_int)work_query;
77  /* Allocate memory for work arrays */
78  work = (float*)LAPACKE_malloc( sizeof(float) * lwork );
79  if( work == NULL ) {
81  goto exit_level_1;
82  }
83  /* Call middle-level interface */
84  info = LAPACKE_sgeevx_work( matrix_layout, balanc, jobvl, jobvr, sense, n, a,
85  lda, wr, wi, vl, ldvl, vr, ldvr, ilo, ihi,
86  scale, abnrm, rconde, rcondv, work, lwork,
87  iwork );
88  /* Release memory and exit */
89  LAPACKE_free( work );
90 exit_level_1:
91  if( LAPACKE_lsame( sense, 'b' ) || LAPACKE_lsame( sense, 'v' ) ) {
92  LAPACKE_free( iwork );
93  }
94 exit_level_0:
95  if( info == LAPACK_WORK_MEMORY_ERROR ) {
96  LAPACKE_xerbla( "LAPACKE_sgeevx", info );
97  }
98  return info;
99 }
#define lapack_int
Definition: lapack.h:83
lapack_int LAPACKE_sgeevx_work(int matrix_layout, char balanc, char jobvl, char jobvr, char sense, lapack_int n, float *a, lapack_int lda, float *wr, float *wi, float *vl, lapack_int ldvl, float *vr, lapack_int ldvr, lapack_int *ilo, lapack_int *ihi, float *scale, float *abnrm, float *rconde, float *rcondv, float *work, lapack_int lwork, lapack_int *iwork)
#define LAPACK_WORK_MEMORY_ERROR
Definition: lapacke.h:55
#define LAPACK_COL_MAJOR
Definition: lapacke.h:53
#define LAPACKE_free(p)
Definition: lapacke.h:46
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:52
int LAPACKE_get_nancheck(void)
#define LAPACKE_malloc(size)
Definition: lapacke.h:43
lapack_logical LAPACKE_lsame(char ca, char cb)
Definition: lapacke_lsame.c:35
void LAPACKE_xerbla(const char *name, lapack_int info)
lapack_logical LAPACKE_sge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const float *a, lapack_int lda)
#define MAX(x, y)
Definition: lapacke_utils.h:46
Here is the call graph for this function: