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_cgbrfs( int matrix_order, char trans, lapack_int n,
00038 lapack_int kl, lapack_int ku, lapack_int nrhs,
00039 const lapack_complex_float* ab, lapack_int ldab,
00040 const lapack_complex_float* afb, lapack_int ldafb,
00041 const lapack_int* ipiv,
00042 const lapack_complex_float* b, lapack_int ldb,
00043 lapack_complex_float* x, lapack_int ldx, 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_cgbrfs", -1 );
00051 return -1;
00052 }
00053 #ifndef LAPACK_DISABLE_NAN_CHECK
00054
00055 if( LAPACKE_cgb_nancheck( matrix_order, n, n, kl, ku, ab, ldab ) ) {
00056 return -7;
00057 }
00058 if( LAPACKE_cgb_nancheck( matrix_order, n, n, kl, kl+ku, afb, ldafb ) ) {
00059 return -9;
00060 }
00061 if( LAPACKE_cge_nancheck( matrix_order, n, nrhs, b, ldb ) ) {
00062 return -12;
00063 }
00064 if( LAPACKE_cge_nancheck( matrix_order, n, nrhs, x, ldx ) ) {
00065 return -14;
00066 }
00067 #endif
00068
00069 rwork = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,n) );
00070 if( rwork == NULL ) {
00071 info = LAPACK_WORK_MEMORY_ERROR;
00072 goto exit_level_0;
00073 }
00074 work = (lapack_complex_float*)
00075 LAPACKE_malloc( sizeof(lapack_complex_float) * MAX(1,2*n) );
00076 if( work == NULL ) {
00077 info = LAPACK_WORK_MEMORY_ERROR;
00078 goto exit_level_1;
00079 }
00080
00081 info = LAPACKE_cgbrfs_work( matrix_order, trans, n, kl, ku, nrhs, ab, ldab,
00082 afb, ldafb, ipiv, b, ldb, x, ldx, ferr, berr,
00083 work, rwork );
00084
00085 LAPACKE_free( work );
00086 exit_level_1:
00087 LAPACKE_free( rwork );
00088 exit_level_0:
00089 if( info == LAPACK_WORK_MEMORY_ERROR ) {
00090 LAPACKE_xerbla( "LAPACKE_cgbrfs", info );
00091 }
00092 return info;
00093 }