LAPACK  3.7.1
LAPACK: Linear Algebra PACKage

◆ LAPACKE_dtprfb()

lapack_int LAPACKE_dtprfb ( int  matrix_layout,
char  side,
char  trans,
char  direct,
char  storev,
lapack_int  m,
lapack_int  n,
lapack_int  k,
lapack_int  l,
const double *  v,
lapack_int  ldv,
const double *  t,
lapack_int  ldt,
double *  a,
lapack_int  lda,
double *  b,
lapack_int  ldb 
)

Definition at line 36 of file lapacke_dtprfb.c.

41 {
42  lapack_int ncols_v, nrows_v;
43  lapack_int info = 0;
44  lapack_int ldwork;
45  lapack_int work_size;
46  double* work = NULL;
47  if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
48  LAPACKE_xerbla( "LAPACKE_dtprfb", -1 );
49  return -1;
50  }
51 #ifndef LAPACK_DISABLE_NAN_CHECK
52  /* Optionally check input matrices for NaNs */
53  if( LAPACKE_lsame( storev, 'C' ) ) {
54  ncols_v = k;
55  nrows_v = LAPACKE_lsame( side, 'L' ) ? m :
56  ( LAPACKE_lsame( side, 'R' ) ? n : 0 );
57  } else if( LAPACKE_lsame( storev, 'R' ) ) {
58  ncols_v = LAPACKE_lsame( side, 'L' ) ? m :
59  ( LAPACKE_lsame( side, 'R' ) ? n : 0 );
60  nrows_v = k;
61  } else {
62  ncols_v = 0;
63  nrows_v = 0;
64  }
65  if( LAPACKE_dge_nancheck( matrix_layout, k, m, a, lda ) ) {
66  return -14;
67  }
68  if( LAPACKE_dge_nancheck( matrix_layout, m, n, b, ldb ) ) {
69  return -16;
70  }
71  if( LAPACKE_dge_nancheck( matrix_layout, k, k, t, ldt ) ) {
72  return -12;
73  }
74  if( LAPACKE_dge_nancheck( matrix_layout, nrows_v, ncols_v, v, ldv ) ) {
75  return -10;
76  }
77 #endif
78  if (side=='l' || side=='L') {
79  ldwork = k;
80  work_size = MAX(1,ldwork) * MAX(1,n);
81  }
82  else {
83  ldwork = m;
84  work_size = MAX(1,ldwork) * MAX(1,k);
85  }
86  /* Allocate memory for working array(s) */
87  work = (double*)
88  LAPACKE_malloc( sizeof(double) * work_size );
89  if( work == NULL ) {
91  goto exit_level_0;
92  }
93  /* Call middle-level interface */
94  info = LAPACKE_dtprfb_work( matrix_layout, side, trans, direct, storev, m, n,
95  k, l, v, ldv, t, ldt, a, lda, b, ldb, work,
96  ldwork );
97  /* Release memory and exit */
98  LAPACKE_free( work );
99 exit_level_0:
100  if( info == LAPACK_WORK_MEMORY_ERROR ) {
101  LAPACKE_xerbla( "LAPACKE_dtprfb", info );
102  }
103  return info;
104 }
#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_int LAPACKE_dtprfb_work(int matrix_layout, char side, char trans, char direct, char storev, lapack_int m, lapack_int n, lapack_int k, lapack_int l, const double *v, lapack_int ldv, const double *t, lapack_int ldt, double *a, lapack_int lda, double *b, lapack_int ldb, double *work, lapack_int ldwork)
#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_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: