00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #include "lapacke.h"
00035 #include "lapacke_utils.h"
00036
00037 lapack_int LAPACKE_cherfsx( int matrix_order, char uplo, char equed,
00038 lapack_int n, lapack_int nrhs,
00039 const lapack_complex_float* a, lapack_int lda,
00040 const lapack_complex_float* af, lapack_int ldaf,
00041 const lapack_int* ipiv, const float* s,
00042 const lapack_complex_float* b, lapack_int ldb,
00043 lapack_complex_float* x, lapack_int ldx,
00044 float* rcond, float* berr, lapack_int n_err_bnds,
00045 float* err_bnds_norm, float* err_bnds_comp,
00046 lapack_int nparams, float* params )
00047 {
00048 lapack_int info = 0;
00049 float* rwork = NULL;
00050 lapack_complex_float* work = NULL;
00051 if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) {
00052 LAPACKE_xerbla( "LAPACKE_cherfsx", -1 );
00053 return -1;
00054 }
00055 #ifndef LAPACK_DISABLE_NAN_CHECK
00056
00057 if( LAPACKE_che_nancheck( matrix_order, uplo, n, a, lda ) ) {
00058 return -6;
00059 }
00060 if( LAPACKE_che_nancheck( matrix_order, uplo, n, af, ldaf ) ) {
00061 return -8;
00062 }
00063 if( LAPACKE_cge_nancheck( matrix_order, n, nrhs, b, ldb ) ) {
00064 return -12;
00065 }
00066 if( nparams>0 ) {
00067 if( LAPACKE_s_nancheck( nparams, params, 1 ) ) {
00068 return -22;
00069 }
00070 }
00071 if( LAPACKE_lsame( equed, 'y' ) ) {
00072 if( LAPACKE_s_nancheck( n, s, 1 ) ) {
00073 return -11;
00074 }
00075 }
00076 if( LAPACKE_cge_nancheck( matrix_order, n, nrhs, x, ldx ) ) {
00077 return -14;
00078 }
00079 #endif
00080
00081 rwork = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,3*n) );
00082 if( rwork == NULL ) {
00083 info = LAPACK_WORK_MEMORY_ERROR;
00084 goto exit_level_0;
00085 }
00086 work = (lapack_complex_float*)
00087 LAPACKE_malloc( sizeof(lapack_complex_float) * MAX(1,2*n) );
00088 if( work == NULL ) {
00089 info = LAPACK_WORK_MEMORY_ERROR;
00090 goto exit_level_1;
00091 }
00092
00093 info = LAPACKE_cherfsx_work( matrix_order, uplo, equed, n, nrhs, a, lda, af,
00094 ldaf, ipiv, s, b, ldb, x, ldx, rcond, berr,
00095 n_err_bnds, err_bnds_norm, err_bnds_comp,
00096 nparams, params, work, rwork );
00097
00098 LAPACKE_free( work );
00099 exit_level_1:
00100 LAPACKE_free( rwork );
00101 exit_level_0:
00102 if( info == LAPACK_WORK_MEMORY_ERROR ) {
00103 LAPACKE_xerbla( "LAPACKE_cherfsx", info );
00104 }
00105 return info;
00106 }