LAPACK  3.10.1
LAPACK: Linear Algebra PACKage

◆ LAPACKE_cgeesx_work()

lapack_int LAPACKE_cgeesx_work ( int  matrix_layout,
char  jobvs,
char  sort,
LAPACK_C_SELECT1  select,
char  sense,
lapack_int  n,
lapack_complex_float a,
lapack_int  lda,
lapack_int sdim,
lapack_complex_float w,
lapack_complex_float vs,
lapack_int  ldvs,
float *  rconde,
float *  rcondv,
lapack_complex_float work,
lapack_int  lwork,
float *  rwork,
lapack_logical bwork 
)

Definition at line 35 of file lapacke_cgeesx_work.c.

44 {
45  lapack_int info = 0;
46  if( matrix_layout == LAPACK_COL_MAJOR ) {
47  /* Call LAPACK function and adjust info */
48  LAPACK_cgeesx( &jobvs, &sort, select, &sense, &n, a, &lda, sdim, w, vs,
49  &ldvs, rconde, rcondv, work, &lwork, rwork, bwork,
50  &info );
51  if( info < 0 ) {
52  info = info - 1;
53  }
54  } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
55  lapack_int lda_t = MAX(1,n);
56  lapack_int ldvs_t = MAX(1,n);
57  lapack_complex_float* a_t = NULL;
58  lapack_complex_float* vs_t = NULL;
59  /* Check leading dimension(s) */
60  if( lda < n ) {
61  info = -8;
62  LAPACKE_xerbla( "LAPACKE_cgeesx_work", info );
63  return info;
64  }
65  if( ldvs < n ) {
66  info = -12;
67  LAPACKE_xerbla( "LAPACKE_cgeesx_work", info );
68  return info;
69  }
70  /* Query optimal working array(s) size if requested */
71  if( lwork == -1 ) {
72  LAPACK_cgeesx( &jobvs, &sort, select, &sense, &n, a, &lda_t, sdim,
73  w, vs, &ldvs_t, rconde, rcondv, work, &lwork, rwork,
74  bwork, &info );
75  return (info < 0) ? (info - 1) : info;
76  }
77  /* Allocate memory for temporary array(s) */
78  a_t = (lapack_complex_float*)
79  LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
80  if( a_t == NULL ) {
82  goto exit_level_0;
83  }
84  if( LAPACKE_lsame( jobvs, 'v' ) ) {
85  vs_t = (lapack_complex_float*)
87  ldvs_t * MAX(1,n) );
88  if( vs_t == NULL ) {
90  goto exit_level_1;
91  }
92  }
93  /* Transpose input matrices */
94  LAPACKE_cge_trans( matrix_layout, n, n, a, lda, a_t, lda_t );
95  /* Call LAPACK function and adjust info */
96  LAPACK_cgeesx( &jobvs, &sort, select, &sense, &n, a_t, &lda_t, sdim, w,
97  vs_t, &ldvs_t, rconde, rcondv, work, &lwork, rwork,
98  bwork, &info );
99  if( info < 0 ) {
100  info = info - 1;
101  }
102  /* Transpose output matrices */
103  LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
104  if( LAPACKE_lsame( jobvs, 'v' ) ) {
105  LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, vs_t, ldvs_t, vs, ldvs );
106  }
107  /* Release memory and exit */
108  if( LAPACKE_lsame( jobvs, 'v' ) ) {
109  LAPACKE_free( vs_t );
110  }
111 exit_level_1:
112  LAPACKE_free( a_t );
113 exit_level_0:
114  if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
115  LAPACKE_xerbla( "LAPACKE_cgeesx_work", info );
116  }
117  } else {
118  info = -1;
119  LAPACKE_xerbla( "LAPACKE_cgeesx_work", info );
120  }
121  return info;
122 }
#define LAPACK_cgeesx(...)
Definition: lapack.h:1717
#define lapack_int
Definition: lapack.h:83
#define lapack_complex_float
Definition: lapack.h:45
#define LAPACK_COL_MAJOR
Definition: lapacke.h:53
#define LAPACKE_free(p)
Definition: lapacke.h:46
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:52
#define LAPACKE_malloc(size)
Definition: lapacke.h:43
#define LAPACK_TRANSPOSE_MEMORY_ERROR
Definition: lapacke.h:56
lapack_logical LAPACKE_lsame(char ca, char cb)
Definition: lapacke_lsame.c:35
void LAPACKE_xerbla(const char *name, lapack_int info)
#define MAX(x, y)
Definition: lapacke_utils.h:46
void LAPACKE_cge_trans(int matrix_layout, lapack_int m, lapack_int n, const lapack_complex_float *in, lapack_int ldin, lapack_complex_float *out, lapack_int ldout)
Here is the call graph for this function:
Here is the caller graph for this function: