LAPACK  3.10.1
LAPACK: Linear Algebra PACKage

◆ LAPACKE_cgees()

lapack_int LAPACKE_cgees ( int  matrix_layout,
char  jobvs,
char  sort,
LAPACK_C_SELECT1  select,
lapack_int  n,
lapack_complex_float a,
lapack_int  lda,
lapack_int sdim,
lapack_complex_float w,
lapack_complex_float vs,
lapack_int  ldvs 
)

Definition at line 35 of file lapacke_cgees.c.

40 {
41  lapack_int info = 0;
42  lapack_int lwork = -1;
43  lapack_logical* bwork = NULL;
44  float* rwork = NULL;
45  lapack_complex_float* work = NULL;
46  lapack_complex_float work_query;
47  if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
48  LAPACKE_xerbla( "LAPACKE_cgees", -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_cge_nancheck( matrix_layout, n, n, a, lda ) ) {
55  return -6;
56  }
57  }
58 #endif
59  /* Allocate memory for working array(s) */
60  if( LAPACKE_lsame( sort, 's' ) ) {
61  bwork = (lapack_logical*)
62  LAPACKE_malloc( sizeof(lapack_logical) * MAX(1,n) );
63  if( bwork == NULL ) {
65  goto exit_level_0;
66  }
67  }
68  rwork = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,n) );
69  if( rwork == NULL ) {
71  goto exit_level_1;
72  }
73  /* Query optimal working array(s) size */
74  info = LAPACKE_cgees_work( matrix_layout, jobvs, sort, select, n, a, lda,
75  sdim, w, vs, ldvs, &work_query, lwork, rwork,
76  bwork );
77  if( info != 0 ) {
78  goto exit_level_2;
79  }
80  lwork = LAPACK_C2INT( work_query );
81  /* Allocate memory for work arrays */
82  work = (lapack_complex_float*)
83  LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
84  if( work == NULL ) {
86  goto exit_level_2;
87  }
88  /* Call middle-level interface */
89  info = LAPACKE_cgees_work( matrix_layout, jobvs, sort, select, n, a, lda,
90  sdim, w, vs, ldvs, work, lwork, rwork, bwork );
91  /* Release memory and exit */
92  LAPACKE_free( work );
93 exit_level_2:
94  LAPACKE_free( rwork );
95 exit_level_1:
96  if( LAPACKE_lsame( sort, 's' ) ) {
97  LAPACKE_free( bwork );
98  }
99 exit_level_0:
100  if( info == LAPACK_WORK_MEMORY_ERROR ) {
101  LAPACKE_xerbla( "LAPACKE_cgees", info );
102  }
103  return info;
104 }
#define lapack_int
Definition: lapack.h:83
#define lapack_complex_float
Definition: lapack.h:45
#define lapack_logical
Definition: lapack.h:87
#define LAPACK_WORK_MEMORY_ERROR
Definition: lapacke.h:55
#define LAPACK_COL_MAJOR
Definition: lapacke.h:53
#define LAPACK_C2INT(x)
Definition: lapacke.h:49
lapack_int LAPACKE_cgees_work(int matrix_layout, char jobvs, char sort, LAPACK_C_SELECT1 select, lapack_int n, lapack_complex_float *a, lapack_int lda, lapack_int *sdim, lapack_complex_float *w, lapack_complex_float *vs, lapack_int ldvs, lapack_complex_float *work, lapack_int lwork, float *rwork, lapack_logical *bwork)
#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)
#define MAX(x, y)
Definition: lapacke_utils.h:46
lapack_logical LAPACKE_cge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const lapack_complex_float *a, lapack_int lda)
Here is the call graph for this function: