LAPACK 3.11.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ LAPACKE_zgees()

lapack_int LAPACKE_zgees ( int  matrix_layout,
char  jobvs,
char  sort,
LAPACK_Z_SELECT1  select,
lapack_int  n,
lapack_complex_double a,
lapack_int  lda,
lapack_int sdim,
lapack_complex_double w,
lapack_complex_double vs,
lapack_int  ldvs 
)

Definition at line 35 of file lapacke_zgees.c.

40{
41 lapack_int info = 0;
42 lapack_int lwork = -1;
43 lapack_logical* bwork = NULL;
44 double* rwork = NULL;
45 lapack_complex_double* work = NULL;
46 lapack_complex_double work_query;
47 if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
48 LAPACKE_xerbla( "LAPACKE_zgees", -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_zge_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 = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,n) );
69 if( rwork == NULL ) {
71 goto exit_level_1;
72 }
73 /* Query optimal working array(s) size */
74 info = LAPACKE_zgees_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_Z2INT( work_query );
81 /* Allocate memory for work arrays */
82 work = (lapack_complex_double*)
83 LAPACKE_malloc( sizeof(lapack_complex_double) * lwork );
84 if( work == NULL ) {
86 goto exit_level_2;
87 }
88 /* Call middle-level interface */
89 info = LAPACKE_zgees_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 );
93exit_level_2:
94 LAPACKE_free( rwork );
95exit_level_1:
96 if( LAPACKE_lsame( sort, 's' ) ) {
97 LAPACKE_free( bwork );
98 }
99exit_level_0:
100 if( info == LAPACK_WORK_MEMORY_ERROR ) {
101 LAPACKE_xerbla( "LAPACKE_zgees", info );
102 }
103 return info;
104}
#define lapack_int
Definition: lapack.h:87
#define lapack_complex_double
Definition: lapack.h:64
#define lapack_logical
Definition: lapack.h:103
lapack_int LAPACKE_zgees_work(int matrix_layout, char jobvs, char sort, LAPACK_Z_SELECT1 select, lapack_int n, lapack_complex_double *a, lapack_int lda, lapack_int *sdim, lapack_complex_double *w, lapack_complex_double *vs, lapack_int ldvs, lapack_complex_double *work, lapack_int lwork, double *rwork, lapack_logical *bwork)
#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 LAPACK_Z2INT(x)
Definition: lapacke.h:50
#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_zge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const lapack_complex_double *a, lapack_int lda)
#define MAX(x, y)
Definition: lapacke_utils.h:46
Here is the call graph for this function: