LAPACK  3.9.0
LAPACK: Linear Algebra PACKage

◆ LAPACKE_strsen()

lapack_int LAPACKE_strsen ( int  matrix_layout,
char  job,
char  compq,
const lapack_logical select,
lapack_int  n,
float *  t,
lapack_int  ldt,
float *  q,
lapack_int  ldq,
float *  wr,
float *  wi,
lapack_int m,
float *  s,
float *  sep 
)

Definition at line 35 of file lapacke_strsen.c.

40 {
41  lapack_int info = 0;
42  lapack_int liwork = -1;
43  lapack_int lwork = -1;
44  lapack_int* iwork = NULL;
45  float* work = NULL;
46  lapack_int iwork_query;
47  float work_query;
48  if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
49  LAPACKE_xerbla( "LAPACKE_strsen", -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_lsame( compq, 'v' ) ) {
56  if( LAPACKE_sge_nancheck( matrix_layout, n, n, q, ldq ) ) {
57  return -8;
58  }
59  }
60  if( LAPACKE_sge_nancheck( matrix_layout, n, n, t, ldt ) ) {
61  return -6;
62  }
63  }
64 #endif
65  /* Query optimal working array(s) size */
66  info = LAPACKE_strsen_work( matrix_layout, job, compq, select, n, t, ldt, q,
67  ldq, wr, wi, m, s, sep, &work_query, lwork,
68  &iwork_query, liwork );
69  if( info != 0 ) {
70  goto exit_level_0;
71  }
72  liwork = (lapack_int)iwork_query;
73  lwork = (lapack_int)work_query;
74  /* Allocate memory for work arrays */
75  if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'v' ) ) {
76  iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * liwork );
77  if( iwork == NULL ) {
79  goto exit_level_0;
80  }
81  }
82  work = (float*)LAPACKE_malloc( sizeof(float) * lwork );
83  if( work == NULL ) {
85  goto exit_level_1;
86  }
87  /* Call middle-level interface */
88  info = LAPACKE_strsen_work( matrix_layout, job, compq, select, n, t, ldt, q,
89  ldq, wr, wi, m, s, sep, work, lwork, iwork,
90  liwork );
91  /* Release memory and exit */
92  LAPACKE_free( work );
93 exit_level_1:
94  if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'v' ) ) {
95  LAPACKE_free( iwork );
96  }
97 exit_level_0:
98  if( info == LAPACK_WORK_MEMORY_ERROR ) {
99  LAPACKE_xerbla( "LAPACKE_strsen", 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
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
LAPACKE_strsen_work
lapack_int LAPACKE_strsen_work(int matrix_layout, char job, char compq, const lapack_logical *select, lapack_int n, float *t, lapack_int ldt, float *q, lapack_int ldq, float *wr, float *wi, lapack_int *m, float *s, float *sep, float *work, lapack_int lwork, lapack_int *iwork, lapack_int liwork)
Definition: lapacke_strsen_work.c:35
LAPACKE_sge_nancheck
lapack_logical LAPACKE_sge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const float *a, lapack_int lda)
Definition: lapacke_sge_nancheck.c:36
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
LAPACK_COL_MAJOR
#define LAPACK_COL_MAJOR
Definition: lapacke.h:54