LAPACK  3.10.1
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 35 of file lapacke_zcgesv.c.

40 {
41  lapack_int info = 0;
42  double* rwork = NULL;
43  lapack_complex_float* swork = NULL;
44  lapack_complex_double* work = NULL;
45  if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
46  LAPACKE_xerbla( "LAPACKE_zcgesv", -1 );
47  return -1;
48  }
49 #ifndef LAPACK_DISABLE_NAN_CHECK
50  if( LAPACKE_get_nancheck() ) {
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  }
59 #endif
60  /* Allocate memory for working array(s) */
61  rwork = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,n) );
62  if( rwork == NULL ) {
64  goto exit_level_0;
65  }
66  swork = (lapack_complex_float*)
68  MAX(1,n) * MAX(1,n+nrhs) );
69  if( swork == NULL ) {
71  goto exit_level_1;
72  }
73  work = (lapack_complex_double*)
75  MAX(1,n) * MAX(1,nrhs) );
76  if( work == NULL ) {
78  goto exit_level_2;
79  }
80  /* Call middle-level interface */
81  info = LAPACKE_zcgesv_work( matrix_layout, n, nrhs, a, lda, ipiv, b, ldb, x,
82  ldx, work, swork, rwork, iter );
83  /* Release memory and exit */
84  LAPACKE_free( work );
85 exit_level_2:
86  LAPACKE_free( swork );
87 exit_level_1:
88  LAPACKE_free( rwork );
89 exit_level_0:
90  if( info == LAPACK_WORK_MEMORY_ERROR ) {
91  LAPACKE_xerbla( "LAPACKE_zcgesv", info );
92  }
93  return info;
94 }
#define lapack_int
Definition: lapack.h:83
#define lapack_complex_double
Definition: lapack.h:63
#define lapack_complex_float
Definition: lapack.h:45
#define LAPACK_WORK_MEMORY_ERROR
Definition: lapacke.h:55
#define LAPACK_COL_MAJOR
Definition: lapacke.h:53
#define LAPACKE_free(p)
Definition: lapacke.h:46
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:52
int LAPACKE_get_nancheck(void)
#define LAPACKE_malloc(size)
Definition: lapacke.h:43
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)
void LAPACKE_xerbla(const char *name, lapack_int info)
lapack_logical LAPACKE_zge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const lapack_complex_double *a, lapack_int lda)
#define MAX(x, y)
Definition: lapacke_utils.h:46
Here is the call graph for this function: