LAPACK  3.10.1
LAPACK: Linear Algebra PACKage

◆ LAPACKE_sormbr()

lapack_int LAPACKE_sormbr ( int  matrix_layout,
char  vect,
char  side,
char  trans,
lapack_int  m,
lapack_int  n,
lapack_int  k,
const float *  a,
lapack_int  lda,
const float *  tau,
float *  c,
lapack_int  ldc 
)

Definition at line 35 of file lapacke_sormbr.c.

39 {
40  lapack_int info = 0;
41  lapack_int lwork = -1;
42  float* work = NULL;
43  float work_query;
44  lapack_int nq, ar, ac;
45  if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
46  LAPACKE_xerbla( "LAPACKE_sormbr", -1 );
47  return -1;
48  }
49 #ifndef LAPACK_DISABLE_NAN_CHECK
50  if( LAPACKE_get_nancheck() ) {
51  /* Optionally check input matrices for NaNs */
52  nq = LAPACKE_lsame( side, 'l' ) ? m : n;
53  ar = LAPACKE_lsame( vect, 'q' ) ? nq : MIN(nq,k);
54  ac = LAPACKE_lsame( vect, 'q' ) ? MIN(nq,k) : nq;
55  if( LAPACKE_sge_nancheck( matrix_layout, ar, ac, a, lda ) ) {
56  return -8;
57  }
58  if( LAPACKE_sge_nancheck( matrix_layout, m, n, c, ldc ) ) {
59  return -11;
60  }
61  if( LAPACKE_s_nancheck( MIN(nq,k), tau, 1 ) ) {
62  return -10;
63  }
64  }
65 #endif
66  /* Query optimal working array(s) size */
67  info = LAPACKE_sormbr_work( matrix_layout, vect, side, trans, m, n, k, a,
68  lda, tau, c, ldc, &work_query, lwork );
69  if( info != 0 ) {
70  goto exit_level_0;
71  }
72  lwork = (lapack_int)work_query;
73  /* Allocate memory for work arrays */
74  work = (float*)LAPACKE_malloc( sizeof(float) * lwork );
75  if( work == NULL ) {
77  goto exit_level_0;
78  }
79  /* Call middle-level interface */
80  info = LAPACKE_sormbr_work( matrix_layout, vect, side, trans, m, n, k, a,
81  lda, tau, c, ldc, work, lwork );
82  /* Release memory and exit */
83  LAPACKE_free( work );
84 exit_level_0:
85  if( info == LAPACK_WORK_MEMORY_ERROR ) {
86  LAPACKE_xerbla( "LAPACKE_sormbr", info );
87  }
88  return info;
89 }
#define lapack_int
Definition: lapack.h:83
#define LAPACK_WORK_MEMORY_ERROR
Definition: lapacke.h:55
#define LAPACK_COL_MAJOR
Definition: lapacke.h:53
#define LAPACKE_free(p)
Definition: lapacke.h:46
lapack_int LAPACKE_sormbr_work(int matrix_layout, char vect, char side, char trans, lapack_int m, lapack_int n, lapack_int k, const float *a, lapack_int lda, const float *tau, float *c, lapack_int ldc, float *work, lapack_int lwork)
#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_s_nancheck(lapack_int n, const float *x, lapack_int incx)
lapack_logical LAPACKE_sge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const float *a, lapack_int lda)
#define MIN(x, y)
Definition: lapacke_utils.h:49
Here is the call graph for this function: