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_cgbrfsx( int matrix_order, char trans, char equed,
00038 lapack_int n, lapack_int kl, lapack_int ku,
00039 lapack_int nrhs, const lapack_complex_float* ab,
00040 lapack_int ldab, const lapack_complex_float* afb,
00041 lapack_int ldafb, const lapack_int* ipiv,
00042 const float* r, const float* c,
00043 const lapack_complex_float* b, lapack_int ldb,
00044 lapack_complex_float* x, lapack_int ldx,
00045 float* rcond, float* berr, lapack_int n_err_bnds,
00046 float* err_bnds_norm, float* err_bnds_comp,
00047 lapack_int nparams, float* params )
00048 {
00049 lapack_int info = 0;
00050 float* rwork = NULL;
00051 lapack_complex_float* work = NULL;
00052 if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) {
00053 LAPACKE_xerbla( "LAPACKE_cgbrfsx", -1 );
00054 return -1;
00055 }
00056 #ifndef LAPACK_DISABLE_NAN_CHECK
00057
00058 if( LAPACKE_cgb_nancheck( matrix_order, n, n, kl, ku, ab, ldab ) ) {
00059 return -8;
00060 }
00061 if( LAPACKE_cgb_nancheck( matrix_order, n, n, kl, kl+ku, afb, ldafb ) ) {
00062 return -10;
00063 }
00064 if( LAPACKE_cge_nancheck( matrix_order, n, nrhs, b, ldb ) ) {
00065 return -15;
00066 }
00067 if( LAPACKE_lsame( equed, 'b' ) || LAPACKE_lsame( equed, 'c' ) ) {
00068 if( LAPACKE_s_nancheck( n, c, 1 ) ) {
00069 return -14;
00070 }
00071 }
00072 if( nparams>0 ) {
00073 if( LAPACKE_s_nancheck( nparams, params, 1 ) ) {
00074 return -25;
00075 }
00076 }
00077 if( LAPACKE_lsame( equed, 'b' ) || LAPACKE_lsame( equed, 'r' ) ) {
00078 if( LAPACKE_s_nancheck( n, r, 1 ) ) {
00079 return -13;
00080 }
00081 }
00082 if( LAPACKE_cge_nancheck( matrix_order, n, nrhs, x, ldx ) ) {
00083 return -17;
00084 }
00085 #endif
00086
00087 rwork = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,3*n) );
00088 if( rwork == NULL ) {
00089 info = LAPACK_WORK_MEMORY_ERROR;
00090 goto exit_level_0;
00091 }
00092 work = (lapack_complex_float*)
00093 LAPACKE_malloc( sizeof(lapack_complex_float) * MAX(1,2*n) );
00094 if( work == NULL ) {
00095 info = LAPACK_WORK_MEMORY_ERROR;
00096 goto exit_level_1;
00097 }
00098
00099 info = LAPACKE_cgbrfsx_work( matrix_order, trans, equed, n, kl, ku, nrhs,
00100 ab, ldab, afb, ldafb, ipiv, r, c, b, ldb, x,
00101 ldx, rcond, berr, n_err_bnds, err_bnds_norm,
00102 err_bnds_comp, nparams, params, work, rwork );
00103
00104 LAPACKE_free( work );
00105 exit_level_1:
00106 LAPACKE_free( rwork );
00107 exit_level_0:
00108 if( info == LAPACK_WORK_MEMORY_ERROR ) {
00109 LAPACKE_xerbla( "LAPACKE_cgbrfsx", info );
00110 }
00111 return info;
00112 }