LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
lapack_int LAPACKE_dtbrfs_work ( int  matrix_layout,
char  uplo,
char  trans,
char  diag,
lapack_int  n,
lapack_int  kd,
lapack_int  nrhs,
const double *  ab,
lapack_int  ldab,
const double *  b,
lapack_int  ldb,
const double *  x,
lapack_int  ldx,
double *  ferr,
double *  berr,
double *  work,
lapack_int iwork 
)

Definition at line 36 of file lapacke_dtbrfs_work.c.

43 {
44  lapack_int info = 0;
45  if( matrix_layout == LAPACK_COL_MAJOR ) {
46  /* Call LAPACK function and adjust info */
47  LAPACK_dtbrfs( &uplo, &trans, &diag, &n, &kd, &nrhs, ab, &ldab, b, &ldb,
48  x, &ldx, ferr, berr, work, iwork, &info );
49  if( info < 0 ) {
50  info = info - 1;
51  }
52  } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
53  lapack_int ldab_t = MAX(1,kd+1);
54  lapack_int ldb_t = MAX(1,n);
55  lapack_int ldx_t = MAX(1,n);
56  double* ab_t = NULL;
57  double* b_t = NULL;
58  double* x_t = NULL;
59  /* Check leading dimension(s) */
60  if( ldab < n ) {
61  info = -9;
62  LAPACKE_xerbla( "LAPACKE_dtbrfs_work", info );
63  return info;
64  }
65  if( ldb < nrhs ) {
66  info = -11;
67  LAPACKE_xerbla( "LAPACKE_dtbrfs_work", info );
68  return info;
69  }
70  if( ldx < nrhs ) {
71  info = -13;
72  LAPACKE_xerbla( "LAPACKE_dtbrfs_work", info );
73  return info;
74  }
75  /* Allocate memory for temporary array(s) */
76  ab_t = (double*)LAPACKE_malloc( sizeof(double) * ldab_t * MAX(1,n) );
77  if( ab_t == NULL ) {
79  goto exit_level_0;
80  }
81  b_t = (double*)LAPACKE_malloc( sizeof(double) * ldb_t * MAX(1,nrhs) );
82  if( b_t == NULL ) {
84  goto exit_level_1;
85  }
86  x_t = (double*)LAPACKE_malloc( sizeof(double) * ldx_t * MAX(1,nrhs) );
87  if( x_t == NULL ) {
89  goto exit_level_2;
90  }
91  /* Transpose input matrices */
92  LAPACKE_dtb_trans( matrix_layout, uplo, diag, n, kd, ab, ldab, ab_t,
93  ldab_t );
94  LAPACKE_dge_trans( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
95  LAPACKE_dge_trans( matrix_layout, n, nrhs, x, ldx, x_t, ldx_t );
96  /* Call LAPACK function and adjust info */
97  LAPACK_dtbrfs( &uplo, &trans, &diag, &n, &kd, &nrhs, ab_t, &ldab_t, b_t,
98  &ldb_t, x_t, &ldx_t, ferr, berr, work, iwork, &info );
99  if( info < 0 ) {
100  info = info - 1;
101  }
102  /* Release memory and exit */
103  LAPACKE_free( x_t );
104 exit_level_2:
105  LAPACKE_free( b_t );
106 exit_level_1:
107  LAPACKE_free( ab_t );
108 exit_level_0:
109  if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
110  LAPACKE_xerbla( "LAPACKE_dtbrfs_work", info );
111  }
112  } else {
113  info = -1;
114  LAPACKE_xerbla( "LAPACKE_dtbrfs_work", info );
115  }
116  return info;
117 }
void LAPACK_dtbrfs(char *uplo, char *trans, char *diag, lapack_int *n, lapack_int *kd, lapack_int *nrhs, const double *ab, lapack_int *ldab, const double *b, lapack_int *ldb, const double *x, lapack_int *ldx, double *ferr, double *berr, double *work, lapack_int *iwork, lapack_int *info)
void LAPACKE_dge_trans(int matrix_layout, lapack_int m, lapack_int n, const double *in, lapack_int ldin, double *out, lapack_int ldout)
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:119
void LAPACKE_dtb_trans(int matrix_layout, char uplo, char diag, lapack_int n, lapack_int kd, const double *in, lapack_int ldin, double *out, lapack_int ldout)
#define MAX(x, y)
Definition: lapacke_utils.h:47
#define LAPACKE_free(p)
Definition: lapacke.h:113
#define LAPACKE_malloc(size)
Definition: lapacke.h:110
#define LAPACK_COL_MAJOR
Definition: lapacke.h:120
void LAPACKE_xerbla(const char *name, lapack_int info)
#define lapack_int
Definition: lapacke.h:47
#define LAPACK_TRANSPOSE_MEMORY_ERROR
Definition: lapacke.h:123

Here is the call graph for this function:

Here is the caller graph for this function: