LAPACK  3.7.1
LAPACK: Linear Algebra PACKage

◆ LAPACKE_slarfb()

lapack_int LAPACKE_slarfb ( int  matrix_layout,
char  side,
char  trans,
char  direct,
char  storev,
lapack_int  m,
lapack_int  n,
lapack_int  k,
const float *  v,
lapack_int  ldv,
const float *  t,
lapack_int  ldt,
float *  c,
lapack_int  ldc 
)

Definition at line 36 of file lapacke_slarfb.c.

41 {
42  lapack_int info = 0;
43  lapack_int ldwork;
44  float* work = NULL;
45  lapack_int ncols_v, nrows_v;
46  if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
47  LAPACKE_xerbla( "LAPACKE_slarfb", -1 );
48  return -1;
49  }
50 #ifndef LAPACK_DISABLE_NAN_CHECK
51  /* Optionally check input matrices for NaNs */
52  ncols_v = LAPACKE_lsame( storev, 'c' ) ? k :
53  ( ( LAPACKE_lsame( storev, 'r' ) &&
54  LAPACKE_lsame( side, 'l' ) ) ? m :
55  ( ( LAPACKE_lsame( storev, 'r' ) &&
56  LAPACKE_lsame( side, 'r' ) ) ? n : 1) );
57  nrows_v = ( LAPACKE_lsame( storev, 'c' ) &&
58  LAPACKE_lsame( side, 'l' ) ) ? m :
59  ( ( LAPACKE_lsame( storev, 'c' ) &&
60  LAPACKE_lsame( side, 'r' ) ) ? n :
61  ( LAPACKE_lsame( storev, 'r' ) ? k : 1) );
62  if( LAPACKE_sge_nancheck( matrix_layout, m, n, c, ldc ) ) {
63  return -13;
64  }
65  if( LAPACKE_sge_nancheck( matrix_layout, k, k, t, ldt ) ) {
66  return -11;
67  }
68  if( LAPACKE_lsame( storev, 'c' ) && LAPACKE_lsame( direct, 'f' ) ) {
69  if( LAPACKE_str_nancheck( matrix_layout, 'l', 'u', k, v, ldv ) )
70  return -9;
71  if( LAPACKE_sge_nancheck( matrix_layout, nrows_v-k, ncols_v, &v[k*ldv],
72  ldv ) )
73  return -9;
74  } else if( LAPACKE_lsame( storev, 'c' ) && LAPACKE_lsame( direct, 'b' ) ) {
75  if( k > nrows_v ) {
76  LAPACKE_xerbla( "LAPACKE_slarfb", -8 );
77  return -8;
78  }
79  if( LAPACKE_str_nancheck( matrix_layout, 'u', 'u', k,
80  &v[(nrows_v-k)*ldv], ldv ) )
81  return -9;
82  if( LAPACKE_sge_nancheck( matrix_layout, nrows_v-k, ncols_v, v, ldv ) )
83  return -9;
84  } else if( LAPACKE_lsame( storev, 'r' ) && LAPACKE_lsame( direct, 'f' ) ) {
85  if( LAPACKE_str_nancheck( matrix_layout, 'u', 'u', k, v, ldv ) )
86  return -9;
87  if( LAPACKE_sge_nancheck( matrix_layout, nrows_v, ncols_v-k, &v[k],
88  ldv ) )
89  return -9;
90  } else if( LAPACKE_lsame( storev, 'r' ) && LAPACKE_lsame( direct, 'f' ) ) {
91  if( k > ncols_v ) {
92  LAPACKE_xerbla( "LAPACKE_slarfb", -8 );
93  return -8;
94  }
95  if( LAPACKE_str_nancheck( matrix_layout, 'l', 'u', k, &v[ncols_v-k],
96  ldv ) )
97  return -9;
98  if( LAPACKE_sge_nancheck( matrix_layout, nrows_v, ncols_v-k, v, ldv ) )
99  return -9;
100  }
101 #endif
102  if( LAPACKE_lsame( side, 'l' ) ) {
103  ldwork = n;
104  } else if( LAPACKE_lsame( side, 'r' ) ) {
105  ldwork = m;
106  } else {
107  ldwork = 1;
108  }
109  /* Allocate memory for working array(s) */
110  work = (float*)LAPACKE_malloc( sizeof(float) * ldwork * MAX(1,k) );
111  if( work == NULL ) {
113  goto exit_level_0;
114  }
115  /* Call middle-level interface */
116  info = LAPACKE_slarfb_work( matrix_layout, side, trans, direct, storev, m, n,
117  k, v, ldv, t, ldt, c, ldc, work, ldwork );
118  /* Release memory and exit */
119  LAPACKE_free( work );
120 exit_level_0:
121  if( info == LAPACK_WORK_MEMORY_ERROR ) {
122  LAPACKE_xerbla( "LAPACKE_slarfb", info );
123  }
124  return info;
125 }
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:119
#define LAPACK_WORK_MEMORY_ERROR
Definition: lapacke.h:122
#define LAPACKE_free(p)
Definition: lapacke.h:113
lapack_logical LAPACKE_sge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const float *a, lapack_int lda)
lapack_int LAPACKE_slarfb_work(int matrix_layout, char side, char trans, char direct, char storev, lapack_int m, lapack_int n, lapack_int k, const float *v, lapack_int ldv, const float *t, lapack_int ldt, float *c, lapack_int ldc, float *work, lapack_int ldwork)
#define MAX(x, y)
Definition: lapacke_utils.h:47
#define LAPACKE_malloc(size)
Definition: lapacke.h:110
lapack_logical LAPACKE_str_nancheck(int matrix_layout, char uplo, char diag, lapack_int n, const float *a, lapack_int lda)
lapack_logical LAPACKE_lsame(char ca, char cb)
Definition: lapacke_lsame.c:36
#define LAPACK_COL_MAJOR
Definition: lapacke.h:120
void LAPACKE_xerbla(const char *name, lapack_int info)
#define lapack_int
Definition: lapacke.h:47
Here is the call graph for this function: