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

◆ LAPACKE_sggevx()

lapack_int LAPACKE_sggevx ( int  matrix_layout,
char  balanc,
char  jobvl,
char  jobvr,
char  sense,
lapack_int  n,
float *  a,
lapack_int  lda,
float *  b,
lapack_int  ldb,
float *  alphar,
float *  alphai,
float *  beta,
float *  vl,
lapack_int  ldvl,
float *  vr,
lapack_int  ldvr,
lapack_int ilo,
lapack_int ihi,
float *  lscale,
float *  rscale,
float *  abnrm,
float *  bbnrm,
float *  rconde,
float *  rcondv 
)

Definition at line 35 of file lapacke_sggevx.c.

43{
44 lapack_int info = 0;
45 lapack_int lwork = -1;
46 lapack_logical* bwork = NULL;
47 lapack_int* iwork = NULL;
48 float* work = NULL;
49 float work_query;
50 if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
51 LAPACKE_xerbla( "LAPACKE_sggevx", -1 );
52 return -1;
53 }
54#ifndef LAPACK_DISABLE_NAN_CHECK
55 if( LAPACKE_get_nancheck() ) {
56 /* Optionally check input matrices for NaNs */
57 if( LAPACKE_sge_nancheck( matrix_layout, n, n, a, lda ) ) {
58 return -7;
59 }
60 if( LAPACKE_sge_nancheck( matrix_layout, n, n, b, ldb ) ) {
61 return -9;
62 }
63 }
64#endif
65 /* Allocate memory for working array(s) */
66 if( LAPACKE_lsame( sense, 'b' ) || LAPACKE_lsame( sense, 'e' ) ||
67 LAPACKE_lsame( sense, 'v' ) ) {
68 bwork = (lapack_logical*)
69 LAPACKE_malloc( sizeof(lapack_logical) * MAX(1,n) );
70 if( bwork == NULL ) {
72 goto exit_level_0;
73 }
74 }
75 if( LAPACKE_lsame( sense, 'b' ) || LAPACKE_lsame( sense, 'n' ) ||
76 LAPACKE_lsame( sense, 'v' ) ) {
77 iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * MAX(1,n+6) );
78 if( iwork == NULL ) {
80 goto exit_level_1;
81 }
82 }
83 /* Query optimal working array(s) size */
84 info = LAPACKE_sggevx_work( matrix_layout, balanc, jobvl, jobvr, sense, n, a,
85 lda, b, ldb, alphar, alphai, beta, vl, ldvl, vr,
86 ldvr, ilo, ihi, lscale, rscale, abnrm, bbnrm,
87 rconde, rcondv, &work_query, lwork, iwork,
88 bwork );
89 if( info != 0 ) {
90 goto exit_level_2;
91 }
92 lwork = (lapack_int)work_query;
93 /* Allocate memory for work arrays */
94 work = (float*)LAPACKE_malloc( sizeof(float) * lwork );
95 if( work == NULL ) {
97 goto exit_level_2;
98 }
99 /* Call middle-level interface */
100 info = LAPACKE_sggevx_work( matrix_layout, balanc, jobvl, jobvr, sense, n, a,
101 lda, b, ldb, alphar, alphai, beta, vl, ldvl, vr,
102 ldvr, ilo, ihi, lscale, rscale, abnrm, bbnrm,
103 rconde, rcondv, work, lwork, iwork, bwork );
104 /* Release memory and exit */
105 LAPACKE_free( work );
106exit_level_2:
107 if( LAPACKE_lsame( sense, 'b' ) || LAPACKE_lsame( sense, 'n' ) ||
108 LAPACKE_lsame( sense, 'v' ) ) {
109 LAPACKE_free( iwork );
110 }
111exit_level_1:
112 if( LAPACKE_lsame( sense, 'b' ) || LAPACKE_lsame( sense, 'e' ) ||
113 LAPACKE_lsame( sense, 'v' ) ) {
114 LAPACKE_free( bwork );
115 }
116exit_level_0:
117 if( info == LAPACK_WORK_MEMORY_ERROR ) {
118 LAPACKE_xerbla( "LAPACKE_sggevx", info );
119 }
120 return info;
121}
#define lapack_int
Definition: lapack.h:87
#define lapack_logical
Definition: lapack.h:103
#define LAPACK_WORK_MEMORY_ERROR
Definition: lapacke.h:55
#define LAPACK_COL_MAJOR
Definition: lapacke.h:53
lapack_int LAPACKE_sggevx_work(int matrix_layout, char balanc, char jobvl, char jobvr, char sense, lapack_int n, float *a, lapack_int lda, float *b, lapack_int ldb, float *alphar, float *alphai, float *beta, float *vl, lapack_int ldvl, float *vr, lapack_int ldvr, lapack_int *ilo, lapack_int *ihi, float *lscale, float *rscale, float *abnrm, float *bbnrm, float *rconde, float *rcondv, float *work, lapack_int lwork, lapack_int *iwork, 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)
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: