LAPACK  3.10.0
LAPACK: Linear Algebra PACKage

◆ LAPACKE_cgtsvx_work()

lapack_int LAPACKE_cgtsvx_work ( int  matrix_layout,
char  fact,
char  trans,
lapack_int  n,
lapack_int  nrhs,
const lapack_complex_float dl,
const lapack_complex_float d,
const lapack_complex_float du,
lapack_complex_float dlf,
lapack_complex_float df,
lapack_complex_float duf,
lapack_complex_float du2,
lapack_int ipiv,
const lapack_complex_float b,
lapack_int  ldb,
lapack_complex_float x,
lapack_int  ldx,
float *  rcond,
float *  ferr,
float *  berr,
lapack_complex_float work,
float *  rwork 
)

Definition at line 35 of file lapacke_cgtsvx_work.c.

48 {
49  lapack_int info = 0;
50  if( matrix_layout == LAPACK_COL_MAJOR ) {
51  /* Call LAPACK function and adjust info */
52  LAPACK_cgtsvx( &fact, &trans, &n, &nrhs, dl, d, du, dlf, df, duf, du2,
53  ipiv, b, &ldb, x, &ldx, rcond, ferr, berr, work, rwork,
54  &info );
55  if( info < 0 ) {
56  info = info - 1;
57  }
58  } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
59  lapack_int ldb_t = MAX(1,n);
60  lapack_int ldx_t = MAX(1,n);
61  lapack_complex_float* b_t = NULL;
62  lapack_complex_float* x_t = NULL;
63  /* Check leading dimension(s) */
64  if( ldb < nrhs ) {
65  info = -15;
66  LAPACKE_xerbla( "LAPACKE_cgtsvx_work", info );
67  return info;
68  }
69  if( ldx < nrhs ) {
70  info = -17;
71  LAPACKE_xerbla( "LAPACKE_cgtsvx_work", info );
72  return info;
73  }
74  /* Allocate memory for temporary array(s) */
75  b_t = (lapack_complex_float*)
77  ldb_t * MAX(1,nrhs) );
78  if( b_t == NULL ) {
80  goto exit_level_0;
81  }
82  x_t = (lapack_complex_float*)
84  ldx_t * MAX(1,nrhs) );
85  if( x_t == NULL ) {
87  goto exit_level_1;
88  }
89  /* Transpose input matrices */
90  LAPACKE_cge_trans( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
91  /* Call LAPACK function and adjust info */
92  LAPACK_cgtsvx( &fact, &trans, &n, &nrhs, dl, d, du, dlf, df, duf, du2,
93  ipiv, b_t, &ldb_t, x_t, &ldx_t, rcond, ferr, berr, work,
94  rwork, &info );
95  if( info < 0 ) {
96  info = info - 1;
97  }
98  /* Transpose output matrices */
99  LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, nrhs, x_t, ldx_t, x, ldx );
100  /* Release memory and exit */
101  LAPACKE_free( x_t );
102 exit_level_1:
103  LAPACKE_free( b_t );
104 exit_level_0:
105  if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
106  LAPACKE_xerbla( "LAPACKE_cgtsvx_work", info );
107  }
108  } else {
109  info = -1;
110  LAPACKE_xerbla( "LAPACKE_cgtsvx_work", info );
111  }
112  return info;
113 }
#define LAPACK_cgtsvx(...)
Definition: lapack.h:5912
#define lapack_int
Definition: lapack.h:83
#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: