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

Definition at line 36 of file lapacke_zcposv.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_zcposv", -1 );
48  return -1;
49  }
50 #ifndef LAPACK_DISABLE_NAN_CHECK
51  /* Optionally check input matrices for NaNs */
52  if( LAPACKE_zpo_nancheck( matrix_layout, uplo, n, a, lda ) ) {
53  return -5;
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_zcposv_work( matrix_layout, uplo, n, nrhs, a, lda, 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_zcposv", 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_logical LAPACKE_zpo_nancheck(int matrix_layout, char uplo, lapack_int n, const lapack_complex_double *a, lapack_int lda)
#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
lapack_int LAPACKE_zcposv_work(int matrix_layout, char uplo, lapack_int n, lapack_int nrhs, lapack_complex_double *a, lapack_int lda, 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 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: