LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
lapack_int LAPACKE_dlarfb ( int  matrix_layout,
char  side,
char  trans,
char  direct,
char  storev,
lapack_int  m,
lapack_int  n,
lapack_int  k,
const double *  v,
lapack_int  ldv,
const double *  t,
lapack_int  ldt,
double *  c,
lapack_int  ldc 
)

Definition at line 36 of file lapacke_dlarfb.c.

41 {
42  lapack_int info = 0;
43  lapack_int ldwork = ( side=='l')?n:(( side=='r')?m:1);
44  double* 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_dlarfb", -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_dge_nancheck( matrix_layout, m, n, c, ldc ) ) {
63  return -13;
64  }
65  if( LAPACKE_dge_nancheck( matrix_layout, k, k, t, ldt ) ) {
66  return -11;
67  }
68  if( LAPACKE_lsame( storev, 'c' ) && LAPACKE_lsame( direct, 'f' ) ) {
69  if( LAPACKE_dtr_nancheck( matrix_layout, 'l', 'u', k, v, ldv ) )
70  return -9;
71  if( LAPACKE_dge_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_dlarfb", -8 );
77  return -8;
78  }
79  if( LAPACKE_dtr_nancheck( matrix_layout, 'u', 'u', k,
80  &v[(nrows_v-k)*ldv], ldv ) )
81  return -9;
82  if( LAPACKE_dge_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_dtr_nancheck( matrix_layout, 'u', 'u', k, v, ldv ) )
86  return -9;
87  if( LAPACKE_dge_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_dlarfb", -8 );
93  return -8;
94  }
95  if( LAPACKE_dtr_nancheck( matrix_layout, 'l', 'u', k, &v[ncols_v-k],
96  ldv ) )
97  return -9;
98  if( LAPACKE_dge_nancheck( matrix_layout, nrows_v, ncols_v-k, v, ldv ) )
99  return -9;
100  }
101 #endif
102  /* Allocate memory for working array(s) */
103  work = (double*)LAPACKE_malloc( sizeof(double) * ldwork * MAX(1,k) );
104  if( work == NULL ) {
106  goto exit_level_0;
107  }
108  /* Call middle-level interface */
109  info = LAPACKE_dlarfb_work( matrix_layout, side, trans, direct, storev, m, n,
110  k, v, ldv, t, ldt, c, ldc, work, ldwork );
111  /* Release memory and exit */
112  LAPACKE_free( work );
113 exit_level_0:
114  if( info == LAPACK_WORK_MEMORY_ERROR ) {
115  LAPACKE_xerbla( "LAPACKE_dlarfb", info );
116  }
117  return info;
118 }
lapack_int LAPACKE_dlarfb_work(int matrix_layout, char side, char trans, char direct, char storev, lapack_int m, lapack_int n, lapack_int k, const double *v, lapack_int ldv, const double *t, lapack_int ldt, double *c, lapack_int ldc, double *work, lapack_int ldwork)
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:119
#define LAPACK_WORK_MEMORY_ERROR
Definition: lapacke.h:122
lapack_logical LAPACKE_dtr_nancheck(int matrix_layout, char uplo, char diag, lapack_int n, const double *a, lapack_int lda)
#define MAX(x, y)
Definition: lapacke_utils.h:47
lapack_logical LAPACKE_dge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const double *a, lapack_int lda)
#define LAPACKE_free(p)
Definition: lapacke.h:113
#define LAPACKE_malloc(size)
Definition: lapacke.h:110
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: