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

◆ LAPACKE_sgees()

lapack_int LAPACKE_sgees ( int  matrix_layout,
char  jobvs,
char  sort,
LAPACK_S_SELECT2  select,
lapack_int  n,
float *  a,
lapack_int  lda,
lapack_int sdim,
float *  wr,
float *  wi,
float *  vs,
lapack_int  ldvs 
)

Definition at line 35 of file lapacke_sgees.c.

39{
40 lapack_int info = 0;
41 lapack_int lwork = -1;
42 lapack_logical* bwork = NULL;
43 float* work = NULL;
44 float work_query;
45 if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
46 LAPACKE_xerbla( "LAPACKE_sgees", -1 );
47 return -1;
48 }
49#ifndef LAPACK_DISABLE_NAN_CHECK
50 if( LAPACKE_get_nancheck() ) {
51 /* Optionally check input matrices for NaNs */
52 if( LAPACKE_sge_nancheck( matrix_layout, n, n, a, lda ) ) {
53 return -6;
54 }
55 }
56#endif
57 /* Allocate memory for working array(s) */
58 if( LAPACKE_lsame( sort, 's' ) ) {
59 bwork = (lapack_logical*)
60 LAPACKE_malloc( sizeof(lapack_logical) * MAX(1,n) );
61 if( bwork == NULL ) {
63 goto exit_level_0;
64 }
65 }
66 /* Query optimal working array(s) size */
67 info = LAPACKE_sgees_work( matrix_layout, jobvs, sort, select, n, a, lda,
68 sdim, wr, wi, vs, ldvs, &work_query, lwork,
69 bwork );
70 if( info != 0 ) {
71 goto exit_level_1;
72 }
73 lwork = (lapack_int)work_query;
74 /* Allocate memory for work arrays */
75 work = (float*)LAPACKE_malloc( sizeof(float) * lwork );
76 if( work == NULL ) {
78 goto exit_level_1;
79 }
80 /* Call middle-level interface */
81 info = LAPACKE_sgees_work( matrix_layout, jobvs, sort, select, n, a, lda,
82 sdim, wr, wi, vs, ldvs, work, lwork, bwork );
83 /* Release memory and exit */
84 LAPACKE_free( work );
85exit_level_1:
86 if( LAPACKE_lsame( sort, 's' ) ) {
87 LAPACKE_free( bwork );
88 }
89exit_level_0:
90 if( info == LAPACK_WORK_MEMORY_ERROR ) {
91 LAPACKE_xerbla( "LAPACKE_sgees", info );
92 }
93 return info;
94}
#define lapack_int
Definition: lapack.h:87
#define lapack_logical
Definition: lapack.h:103
#define LAPACK_WORK_MEMORY_ERROR
Definition: lapacke.h:55
lapack_int LAPACKE_sgees_work(int matrix_layout, char jobvs, char sort, LAPACK_S_SELECT2 select, lapack_int n, float *a, lapack_int lda, lapack_int *sdim, float *wr, float *wi, float *vs, lapack_int ldvs, float *work, lapack_int lwork, lapack_logical *bwork)
#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: