LAPACK  3.9.0
LAPACK: Linear Algebra PACKage

◆ LAPACKE_dgges3()

lapack_int LAPACKE_dgges3 ( int  matrix_layout,
char  jobvsl,
char  jobvsr,
char  sort,
LAPACK_D_SELECT3  selctg,
lapack_int  n,
double *  a,
lapack_int  lda,
double *  b,
lapack_int  ldb,
lapack_int sdim,
double *  alphar,
double *  alphai,
double *  beta,
double *  vsl,
lapack_int  ldvsl,
double *  vsr,
lapack_int  ldvsr 
)

Definition at line 35 of file lapacke_dgges3.c.

42 {
43  lapack_int info = 0;
44  lapack_int lwork = -1;
45  lapack_logical* bwork = NULL;
46  double* work = NULL;
47  double work_query;
48  if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
49  LAPACKE_xerbla( "LAPACKE_dgges3", -1 );
50  return -1;
51  }
52 #ifndef LAPACK_DISABLE_NAN_CHECK
53  if( LAPACKE_get_nancheck() ) {
54  /* Optionally check input matrices for NaNs */
55  if( LAPACKE_dge_nancheck( matrix_layout, n, n, a, lda ) ) {
56  return -7;
57  }
58  if( LAPACKE_dge_nancheck( matrix_layout, n, n, b, ldb ) ) {
59  return -9;
60  }
61  }
62 #endif
63  /* Allocate memory for working array(s) */
64  if( LAPACKE_lsame( sort, 's' ) ) {
65  bwork = (lapack_logical*)
66  LAPACKE_malloc( sizeof(lapack_logical) * MAX(1,n) );
67  if( bwork == NULL ) {
69  goto exit_level_0;
70  }
71  }
72  /* Query optimal working array(s) size */
73  info = LAPACKE_dgges3_work( matrix_layout, jobvsl, jobvsr, sort, selctg,
74  n, a, lda, b, ldb, sdim, alphar, alphai, beta,
75  vsl, ldvsl, vsr, ldvsr,
76  &work_query, lwork, bwork );
77  if( info != 0 ) {
78  goto exit_level_1;
79  }
80  lwork = (lapack_int)work_query;
81  /* Allocate memory for work arrays */
82  work = (double*)LAPACKE_malloc( sizeof(double) * lwork );
83  if( work == NULL ) {
85  goto exit_level_1;
86  }
87  /* Call middle-level interface */
88  info = LAPACKE_dgges3_work( matrix_layout, jobvsl, jobvsr, sort, selctg,
89  n, a, lda, b, ldb, sdim, alphar, alphai, beta,
90  vsl, ldvsl, vsr, ldvsr, work, lwork, bwork );
91  /* Release memory and exit */
92  LAPACKE_free( work );
93 exit_level_1:
94  if( LAPACKE_lsame( sort, 's' ) ) {
95  LAPACKE_free( bwork );
96  }
97 exit_level_0:
98  if( info == LAPACK_WORK_MEMORY_ERROR ) {
99  LAPACKE_xerbla( "LAPACKE_dgges3", info );
100  }
101  return info;
Here is the call graph for this function:
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
LAPACKE_dgges3_work
lapack_int LAPACKE_dgges3_work(int matrix_layout, char jobvsl, char jobvsr, char sort, LAPACK_D_SELECT3 selctg, lapack_int n, double *a, lapack_int lda, double *b, lapack_int ldb, lapack_int *sdim, double *alphar, double *alphai, double *beta, double *vsl, lapack_int ldvsl, double *vsr, lapack_int ldvsr, double *work, lapack_int lwork, lapack_logical *bwork)
Definition: lapacke_dgges3_work.c:35
LAPACK_COL_MAJOR
#define LAPACK_COL_MAJOR
Definition: lapacke.h:54