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_cpbsvx( int matrix_order, char fact, char uplo, lapack_int n,
00038 lapack_int kd, lapack_int nrhs,
00039 lapack_complex_float* ab, lapack_int ldab,
00040 lapack_complex_float* afb, lapack_int ldafb,
00041 char* equed, float* s, lapack_complex_float* b,
00042 lapack_int ldb, lapack_complex_float* x,
00043 lapack_int ldx, float* rcond, float* ferr,
00044 float* berr )
00045 {
00046 lapack_int info = 0;
00047 float* rwork = NULL;
00048 lapack_complex_float* work = NULL;
00049 if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) {
00050 LAPACKE_xerbla( "LAPACKE_cpbsvx", -1 );
00051 return -1;
00052 }
00053 #ifndef LAPACK_DISABLE_NAN_CHECK
00054
00055 if( LAPACKE_cpb_nancheck( matrix_order, uplo, n, kd, ab, ldab ) ) {
00056 return -7;
00057 }
00058 if( LAPACKE_lsame( fact, 'f' ) ) {
00059 if( LAPACKE_cpb_nancheck( matrix_order, uplo, n, kd, afb, ldafb ) ) {
00060 return -9;
00061 }
00062 }
00063 if( LAPACKE_cge_nancheck( matrix_order, n, nrhs, b, ldb ) ) {
00064 return -13;
00065 }
00066 if( LAPACKE_lsame( fact, 'f' ) && LAPACKE_lsame( *equed, 'y' ) ) {
00067 if( LAPACKE_s_nancheck( n, s, 1 ) ) {
00068 return -12;
00069 }
00070 }
00071 #endif
00072
00073 rwork = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,n) );
00074 if( rwork == NULL ) {
00075 info = LAPACK_WORK_MEMORY_ERROR;
00076 goto exit_level_0;
00077 }
00078 work = (lapack_complex_float*)
00079 LAPACKE_malloc( sizeof(lapack_complex_float) * MAX(1,2*n) );
00080 if( work == NULL ) {
00081 info = LAPACK_WORK_MEMORY_ERROR;
00082 goto exit_level_1;
00083 }
00084
00085 info = LAPACKE_cpbsvx_work( matrix_order, fact, uplo, n, kd, nrhs, ab, ldab,
00086 afb, ldafb, equed, s, b, ldb, x, ldx, rcond,
00087 ferr, berr, work, rwork );
00088
00089 LAPACKE_free( work );
00090 exit_level_1:
00091 LAPACKE_free( rwork );
00092 exit_level_0:
00093 if( info == LAPACK_WORK_MEMORY_ERROR ) {
00094 LAPACKE_xerbla( "LAPACKE_cpbsvx", info );
00095 }
00096 return info;
00097 }