LAPACK  3.10.1
LAPACK: Linear Algebra PACKage

◆ LAPACKE_cgttrs_work()

lapack_int LAPACKE_cgttrs_work ( int  matrix_layout,
char  trans,
lapack_int  n,
lapack_int  nrhs,
const lapack_complex_float dl,
const lapack_complex_float d,
const lapack_complex_float du,
const lapack_complex_float du2,
const lapack_int ipiv,
lapack_complex_float b,
lapack_int  ldb 
)

Definition at line 35 of file lapacke_cgttrs_work.c.

42 {
43  lapack_int info = 0;
44  if( matrix_layout == LAPACK_COL_MAJOR ) {
45  /* Call LAPACK function and adjust info */
46  LAPACK_cgttrs( &trans, &n, &nrhs, dl, d, du, du2, ipiv, b, &ldb,
47  &info );
48  if( info < 0 ) {
49  info = info - 1;
50  }
51  } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
52  lapack_int ldb_t = MAX(1,n);
53  lapack_complex_float* b_t = NULL;
54  /* Check leading dimension(s) */
55  if( ldb < nrhs ) {
56  info = -11;
57  LAPACKE_xerbla( "LAPACKE_cgttrs_work", info );
58  return info;
59  }
60  /* Allocate memory for temporary array(s) */
61  b_t = (lapack_complex_float*)
63  ldb_t * MAX(1,nrhs) );
64  if( b_t == NULL ) {
66  goto exit_level_0;
67  }
68  /* Transpose input matrices */
69  LAPACKE_cge_trans( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
70  /* Call LAPACK function and adjust info */
71  LAPACK_cgttrs( &trans, &n, &nrhs, dl, d, du, du2, ipiv, b_t, &ldb_t,
72  &info );
73  if( info < 0 ) {
74  info = info - 1;
75  }
76  /* Transpose output matrices */
77  LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, nrhs, b_t, ldb_t, b, ldb );
78  /* Release memory and exit */
79  LAPACKE_free( b_t );
80 exit_level_0:
81  if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
82  LAPACKE_xerbla( "LAPACKE_cgttrs_work", info );
83  }
84  } else {
85  info = -1;
86  LAPACKE_xerbla( "LAPACKE_cgttrs_work", info );
87  }
88  return info;
89 }
#define lapack_int
Definition: lapack.h:83
#define LAPACK_cgttrs(...)
Definition: lapack.h:6055
#define lapack_complex_float
Definition: lapack.h:45
#define LAPACK_COL_MAJOR
Definition: lapacke.h:53
#define LAPACKE_free(p)
Definition: lapacke.h:46
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:52
#define LAPACKE_malloc(size)
Definition: lapacke.h:43
#define LAPACK_TRANSPOSE_MEMORY_ERROR
Definition: lapacke.h:56
void LAPACKE_xerbla(const char *name, lapack_int info)
#define MAX(x, y)
Definition: lapacke_utils.h:46
void LAPACKE_cge_trans(int matrix_layout, lapack_int m, lapack_int n, const lapack_complex_float *in, lapack_int ldin, lapack_complex_float *out, lapack_int ldout)
Here is the call graph for this function:
Here is the caller graph for this function: