LAPACK  3.10.0
LAPACK: Linear Algebra PACKage

◆ LAPACKE_strexc_work()

lapack_int LAPACKE_strexc_work ( int  matrix_layout,
char  compq,
lapack_int  n,
float *  t,
lapack_int  ldt,
float *  q,
lapack_int  ldq,
lapack_int ifst,
lapack_int ilst,
float *  work 
)

Definition at line 35 of file lapacke_strexc_work.c.

39 {
40  lapack_int info = 0;
41  if( matrix_layout == LAPACK_COL_MAJOR ) {
42  /* Call LAPACK function and adjust info */
43  LAPACK_strexc( &compq, &n, t, &ldt, q, &ldq, ifst, ilst, work, &info );
44  if( info < 0 ) {
45  info = info - 1;
46  }
47  } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
48  lapack_int ldq_t = MAX(1,n);
49  lapack_int ldt_t = MAX(1,n);
50  float* t_t = NULL;
51  float* q_t = NULL;
52  /* Check leading dimension(s) */
53  if( ldq < n && LAPACKE_lsame( compq, 'v' ) ) {
54  info = -7;
55  LAPACKE_xerbla( "LAPACKE_strexc_work", info );
56  return info;
57  }
58  if( ldt < n ) {
59  info = -5;
60  LAPACKE_xerbla( "LAPACKE_strexc_work", info );
61  return info;
62  }
63  /* Allocate memory for temporary array(s) */
64  t_t = (float*)LAPACKE_malloc( sizeof(float) * ldt_t * MAX(1,n) );
65  if( t_t == NULL ) {
67  goto exit_level_0;
68  }
69  if( LAPACKE_lsame( compq, 'v' ) ) {
70  q_t = (float*)LAPACKE_malloc( sizeof(float) * ldq_t * MAX(1,n) );
71  if( q_t == NULL ) {
73  goto exit_level_1;
74  }
75  }
76  /* Transpose input matrices */
77  LAPACKE_sge_trans( matrix_layout, n, n, t, ldt, t_t, ldt_t );
78  if( LAPACKE_lsame( compq, 'v' ) ) {
79  LAPACKE_sge_trans( matrix_layout, n, n, q, ldq, q_t, ldq_t );
80  }
81  /* Call LAPACK function and adjust info */
82  LAPACK_strexc( &compq, &n, t_t, &ldt_t, q_t, &ldq_t, ifst, ilst, work,
83  &info );
84  if( info < 0 ) {
85  info = info - 1;
86  }
87  /* Transpose output matrices */
88  LAPACKE_sge_trans( LAPACK_COL_MAJOR, n, n, t_t, ldt_t, t, ldt );
89  if( LAPACKE_lsame( compq, 'v' ) ) {
90  LAPACKE_sge_trans( LAPACK_COL_MAJOR, n, n, q_t, ldq_t, q, ldq );
91  }
92  /* Release memory and exit */
93  if( LAPACKE_lsame( compq, 'v' ) ) {
94  LAPACKE_free( q_t );
95  }
96 exit_level_1:
97  LAPACKE_free( t_t );
98 exit_level_0:
99  if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
100  LAPACKE_xerbla( "LAPACKE_strexc_work", info );
101  }
102  } else {
103  info = -1;
104  LAPACKE_xerbla( "LAPACKE_strexc_work", info );
105  }
106  return info;
107 }
#define lapack_int
Definition: lapack.h:83
#define LAPACK_strexc(...)
Definition: lapack.h:21619
#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)
void LAPACKE_sge_trans(int matrix_layout, lapack_int m, lapack_int n, const float *in, lapack_int ldin, float *out, lapack_int ldout)
#define MAX(x, y)
Definition: lapacke_utils.h:46
Here is the call graph for this function:
Here is the caller graph for this function: