OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
lapacke_dsysvx.c File Reference
#include "lapacke_utils.h"

Go to the source code of this file.

Functions

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)

Function Documentation

◆ 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 35 of file lapacke_dsysvx.c.

41{
42 lapack_int info = 0;
43 lapack_int lwork = -1;
44 lapack_int* iwork = NULL;
45 double* work = NULL;
46 double work_query;
47 if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
48 LAPACKE_xerbla( "LAPACKE_dsysvx", -1 );
49 return -1;
50 }
51#ifndef LAPACK_DISABLE_NAN_CHECK
52 if( LAPACKE_get_nancheck() ) {
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 }
66#endif
67 /* Allocate memory for working array(s) */
68 iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * MAX(1,n) );
69 if( iwork == NULL ) {
71 goto exit_level_0;
72 }
73 /* Query optimal working array(s) size */
74 info = LAPACKE_dsysvx_work( matrix_layout, fact, uplo, n, nrhs, a, lda, af,
75 ldaf, ipiv, b, ldb, x, ldx, rcond, ferr, berr,
76 &work_query, lwork, iwork );
77 if( info != 0 ) {
78 goto exit_level_1;
79 }
80 lwork = (lapack_int)work_query;
81 /* Allocate memory for work arrays */
82 work = (double*)LAPACKE_malloc( sizeof(double) * lwork );
83 if( work == NULL ) {
85 goto exit_level_1;
86 }
87 /* Call middle-level interface */
88 info = LAPACKE_dsysvx_work( matrix_layout, fact, uplo, n, nrhs, a, lda, af,
89 ldaf, ipiv, b, ldb, x, ldx, rcond, ferr, berr,
90 work, lwork, iwork );
91 /* Release memory and exit */
92 LAPACKE_free( work );
93exit_level_1:
94 LAPACKE_free( iwork );
95exit_level_0:
96 if( info == LAPACK_WORK_MEMORY_ERROR ) {
97 LAPACKE_xerbla( "LAPACKE_dsysvx", info );
98 }
99 return info;
100}
#define lapack_int
Definition lapack.h:83
#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
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_ROW_MAJOR
Definition lapacke.h:52
int LAPACKE_get_nancheck(void)
#define LAPACKE_malloc(size)
Definition lapacke.h:43
lapack_logical LAPACKE_lsame(char ca, char cb)
void LAPACKE_xerbla(const char *name, lapack_int info)
lapack_logical LAPACKE_dsy_nancheck(int matrix_layout, char uplo, lapack_int n, const double *a, lapack_int lda)
#define MAX(x, y)
lapack_logical LAPACKE_dge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const double *a, lapack_int lda)
n