LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
lapack_int LAPACKE_zcgesv ( int  matrix_layout,
lapack_int  n,
lapack_int  nrhs,
lapack_complex_double a,
lapack_int  lda,
lapack_int ipiv,
lapack_complex_double b,
lapack_int  ldb,
lapack_complex_double x,
lapack_int  ldx,
lapack_int iter 
)

Definition at line 36 of file lapacke_zcgesv.c.

41 {
42  lapack_int info = 0;
43  double* rwork = NULL;
44  lapack_complex_float* swork = NULL;
45  lapack_complex_double* work = NULL;
46  if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
47  LAPACKE_xerbla( "LAPACKE_zcgesv", -1 );
48  return -1;
49  }
50 #ifndef LAPACK_DISABLE_NAN_CHECK
51  /* Optionally check input matrices for NaNs */
52  if( LAPACKE_zge_nancheck( matrix_layout, n, n, a, lda ) ) {
53  return -4;
54  }
55  if( LAPACKE_zge_nancheck( matrix_layout, n, nrhs, b, ldb ) ) {
56  return -7;
57  }
58 #endif
59  /* Allocate memory for working array(s) */
60  rwork = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,n) );
61  if( rwork == NULL ) {
63  goto exit_level_0;
64  }
65  swork = (lapack_complex_float*)
67  MAX(1,n) * MAX(1,n+nrhs) );
68  if( swork == NULL ) {
70  goto exit_level_1;
71  }
72  work = (lapack_complex_double*)
74  MAX(1,n) * MAX(1,nrhs) );
75  if( work == NULL ) {
77  goto exit_level_2;
78  }
79  /* Call middle-level interface */
80  info = LAPACKE_zcgesv_work( matrix_layout, n, nrhs, a, lda, ipiv, b, ldb, x,
81  ldx, work, swork, rwork, iter );
82  /* Release memory and exit */
83  LAPACKE_free( work );
84 exit_level_2:
85  LAPACKE_free( swork );
86 exit_level_1:
87  LAPACKE_free( rwork );
88 exit_level_0:
89  if( info == LAPACK_WORK_MEMORY_ERROR ) {
90  LAPACKE_xerbla( "LAPACKE_zcgesv", info );
91  }
92  return info;
93 }
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:119
#define LAPACK_WORK_MEMORY_ERROR
Definition: lapacke.h:122
#define lapack_complex_float
Definition: lapacke.h:74
#define lapack_complex_double
Definition: lapacke.h:90
lapack_int LAPACKE_zcgesv_work(int matrix_layout, lapack_int n, lapack_int nrhs, lapack_complex_double *a, lapack_int lda, lapack_int *ipiv, lapack_complex_double *b, lapack_int ldb, lapack_complex_double *x, lapack_int ldx, lapack_complex_double *work, lapack_complex_float *swork, double *rwork, lapack_int *iter)
#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
lapack_logical LAPACKE_zge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const lapack_complex_double *a, lapack_int lda)

Here is the call graph for this function: