LAPACK  3.9.0
LAPACK: Linear Algebra PACKage

◆ LAPACKE_dgees()

lapack_int LAPACKE_dgees ( int  matrix_layout,
char  jobvs,
char  sort,
LAPACK_D_SELECT2  select,
lapack_int  n,
double *  a,
lapack_int  lda,
lapack_int sdim,
double *  wr,
double *  wi,
double *  vs,
lapack_int  ldvs 
)

Definition at line 35 of file lapacke_dgees.c.

40 {
41  lapack_int info = 0;
42  lapack_int lwork = -1;
43  lapack_logical* bwork = NULL;
44  double* work = NULL;
45  double work_query;
46  if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
47  LAPACKE_xerbla( "LAPACKE_dgees", -1 );
48  return -1;
49  }
50 #ifndef LAPACK_DISABLE_NAN_CHECK
51  if( LAPACKE_get_nancheck() ) {
52  /* Optionally check input matrices for NaNs */
53  if( LAPACKE_dge_nancheck( matrix_layout, n, n, a, lda ) ) {
54  return -6;
55  }
56  }
57 #endif
58  /* Allocate memory for working array(s) */
59  if( LAPACKE_lsame( sort, 's' ) ) {
60  bwork = (lapack_logical*)
61  LAPACKE_malloc( sizeof(lapack_logical) * MAX(1,n) );
62  if( bwork == NULL ) {
64  goto exit_level_0;
65  }
66  }
67  /* Query optimal working array(s) size */
68  info = LAPACKE_dgees_work( matrix_layout, jobvs, sort, select, n, a, lda,
69  sdim, wr, wi, vs, ldvs, &work_query, lwork,
70  bwork );
71  if( info != 0 ) {
72  goto exit_level_1;
73  }
74  lwork = (lapack_int)work_query;
75  /* Allocate memory for work arrays */
76  work = (double*)LAPACKE_malloc( sizeof(double) * lwork );
77  if( work == NULL ) {
79  goto exit_level_1;
80  }
81  /* Call middle-level interface */
82  info = LAPACKE_dgees_work( matrix_layout, jobvs, sort, select, n, a, lda,
83  sdim, wr, wi, vs, ldvs, work, lwork, bwork );
84  /* Release memory and exit */
85  LAPACKE_free( work );
86 exit_level_1:
87  if( LAPACKE_lsame( sort, 's' ) ) {
88  LAPACKE_free( bwork );
89  }
90 exit_level_0:
91  if( info == LAPACK_WORK_MEMORY_ERROR ) {
92  LAPACKE_xerbla( "LAPACKE_dgees", info );
93  }
94  return info;
Here is the call graph for this function:
LAPACKE_dgees_work
lapack_int LAPACKE_dgees_work(int matrix_layout, char jobvs, char sort, LAPACK_D_SELECT2 select, lapack_int n, double *a, lapack_int lda, lapack_int *sdim, double *wr, double *wi, double *vs, lapack_int ldvs, double *work, lapack_int lwork, lapack_logical *bwork)
Definition: lapacke_dgees_work.c:35
LAPACKE_free
#define LAPACKE_free(p)
Definition: lapacke.h:47
lapack_int
#define lapack_int
Definition: lapack.h:21
LAPACKE_dge_nancheck
lapack_logical LAPACKE_dge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const double *a, lapack_int lda)
Definition: lapacke_dge_nancheck.c:36
LAPACK_WORK_MEMORY_ERROR
#define LAPACK_WORK_MEMORY_ERROR
Definition: lapacke.h:56
LAPACKE_xerbla
void LAPACKE_xerbla(const char *name, lapack_int info)
Definition: lapacke_xerbla.c:36
MAX
#define MAX(x, y)
Definition: lapacke_utils.h:47
lapack_logical
#define lapack_logical
Definition: lapack.h:25
LAPACKE_malloc
#define LAPACKE_malloc(size)
Definition: lapacke.h:44
LAPACKE_get_nancheck
int LAPACKE_get_nancheck()
Definition: lapacke_nancheck.c:42
LAPACKE_lsame
lapack_logical LAPACKE_lsame(char ca, char cb)
Definition: lapacke_lsame.c:35
LAPACK_ROW_MAJOR
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:53
LAPACK_COL_MAJOR
#define LAPACK_COL_MAJOR
Definition: lapacke.h:54