LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ LAPACKE_zcgesv()

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  if( LAPACKE_get_nancheck() ) {
52  /* Optionally check input matrices for NaNs */
53  if( LAPACKE_zge_nancheck( matrix_layout, n, n, a, lda ) ) {
54  return -4;
55  }
56  if( LAPACKE_zge_nancheck( matrix_layout, n, nrhs, b, ldb ) ) {
57  return -7;
58  }
59  }
60 #endif
61  /* Allocate memory for working array(s) */
62  rwork = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,n) );
63  if( rwork == NULL ) {
65  goto exit_level_0;
66  }
67  swork = (lapack_complex_float*)
69  MAX(1,n) * MAX(1,n+nrhs) );
70  if( swork == NULL ) {
72  goto exit_level_1;
73  }
74  work = (lapack_complex_double*)
76  MAX(1,n) * MAX(1,nrhs) );
77  if( work == NULL ) {
79  goto exit_level_2;
80  }
81  /* Call middle-level interface */
82  info = LAPACKE_zcgesv_work( matrix_layout, n, nrhs, a, lda, ipiv, b, ldb, x,
83  ldx, work, swork, rwork, iter );
84  /* Release memory and exit */
85  LAPACKE_free( work );
86 exit_level_2:
87  LAPACKE_free( swork );
88 exit_level_1:
89  LAPACKE_free( rwork );
90 exit_level_0:
91  if( info == LAPACK_WORK_MEMORY_ERROR ) {
92  LAPACKE_xerbla( "LAPACKE_zcgesv", info );
93  }
94  return info;
95 }
#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
#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_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)
int LAPACKE_get_nancheck()
Here is the call graph for this function: