LAPACK  3.7.1
LAPACK: Linear Algebra PACKage

◆ LAPACKE_dsysvx()

lapack_int LAPACKE_dsysvx ( int  matrix_layout,
char  fact,
char  uplo,
lapack_int  n,
lapack_int  nrhs,
const double *  a,
lapack_int  lda,
double *  af,
lapack_int  ldaf,
lapack_int ipiv,
const double *  b,
lapack_int  ldb,
double *  x,
lapack_int  ldx,
double *  rcond,
double *  ferr,
double *  berr 
)

Definition at line 36 of file lapacke_dsysvx.c.

42 {
43  lapack_int info = 0;
44  lapack_int lwork = -1;
45  lapack_int* iwork = NULL;
46  double* work = NULL;
47  double work_query;
48  if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
49  LAPACKE_xerbla( "LAPACKE_dsysvx", -1 );
50  return -1;
51  }
52 #ifndef LAPACK_DISABLE_NAN_CHECK
53  /* Optionally check input matrices for NaNs */
54  if( LAPACKE_dsy_nancheck( matrix_layout, uplo, n, a, lda ) ) {
55  return -6;
56  }
57  if( LAPACKE_lsame( fact, 'f' ) ) {
58  if( LAPACKE_dsy_nancheck( matrix_layout, uplo, n, af, ldaf ) ) {
59  return -8;
60  }
61  }
62  if( LAPACKE_dge_nancheck( matrix_layout, n, nrhs, b, ldb ) ) {
63  return -11;
64  }
65 #endif
66  /* Allocate memory for working array(s) */
67  iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * MAX(1,n) );
68  if( iwork == NULL ) {
70  goto exit_level_0;
71  }
72  /* Query optimal working array(s) size */
73  info = LAPACKE_dsysvx_work( matrix_layout, fact, uplo, n, nrhs, a, lda, af,
74  ldaf, ipiv, b, ldb, x, ldx, rcond, ferr, berr,
75  &work_query, lwork, iwork );
76  if( info != 0 ) {
77  goto exit_level_1;
78  }
79  lwork = (lapack_int)work_query;
80  /* Allocate memory for work arrays */
81  work = (double*)LAPACKE_malloc( sizeof(double) * lwork );
82  if( work == NULL ) {
84  goto exit_level_1;
85  }
86  /* Call middle-level interface */
87  info = LAPACKE_dsysvx_work( matrix_layout, fact, uplo, n, nrhs, a, lda, af,
88  ldaf, ipiv, b, ldb, x, ldx, rcond, ferr, berr,
89  work, lwork, iwork );
90  /* Release memory and exit */
91  LAPACKE_free( work );
92 exit_level_1:
93  LAPACKE_free( iwork );
94 exit_level_0:
95  if( info == LAPACK_WORK_MEMORY_ERROR ) {
96  LAPACKE_xerbla( "LAPACKE_dsysvx", info );
97  }
98  return info;
99 }
#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 MAX(x, y)
Definition: lapacke_utils.h:47
lapack_logical LAPACKE_dge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const double *a, lapack_int lda)
#define LAPACKE_malloc(size)
Definition: lapacke.h:110
lapack_logical LAPACKE_lsame(char ca, char cb)
Definition: lapacke_lsame.c:36
lapack_int LAPACKE_dsysvx_work(int matrix_layout, char fact, char uplo, lapack_int n, lapack_int nrhs, const double *a, lapack_int lda, double *af, lapack_int ldaf, lapack_int *ipiv, const double *b, lapack_int ldb, double *x, lapack_int ldx, double *rcond, double *ferr, double *berr, double *work, lapack_int lwork, lapack_int *iwork)
#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_dsy_nancheck(int matrix_layout, char uplo, lapack_int n, const double *a, lapack_int lda)
Here is the call graph for this function: