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_zgbrfs( int matrix_order, char trans, lapack_int n,
00038 lapack_int kl, lapack_int ku, lapack_int nrhs,
00039 const lapack_complex_double* ab, lapack_int ldab,
00040 const lapack_complex_double* afb, lapack_int ldafb,
00041 const lapack_int* ipiv,
00042 const lapack_complex_double* b, lapack_int ldb,
00043 lapack_complex_double* x, lapack_int ldx,
00044 double* ferr, double* berr )
00045 {
00046 lapack_int info = 0;
00047 double* rwork = NULL;
00048 lapack_complex_double* work = NULL;
00049 if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) {
00050 LAPACKE_xerbla( "LAPACKE_zgbrfs", -1 );
00051 return -1;
00052 }
00053 #ifndef LAPACK_DISABLE_NAN_CHECK
00054
00055 if( LAPACKE_zgb_nancheck( matrix_order, n, n, kl, ku, ab, ldab ) ) {
00056 return -7;
00057 }
00058 if( LAPACKE_zgb_nancheck( matrix_order, n, n, kl, kl+ku, afb, ldafb ) ) {
00059 return -9;
00060 }
00061 if( LAPACKE_zge_nancheck( matrix_order, n, nrhs, b, ldb ) ) {
00062 return -12;
00063 }
00064 if( LAPACKE_zge_nancheck( matrix_order, n, nrhs, x, ldx ) ) {
00065 return -14;
00066 }
00067 #endif
00068
00069 rwork = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,n) );
00070 if( rwork == NULL ) {
00071 info = LAPACK_WORK_MEMORY_ERROR;
00072 goto exit_level_0;
00073 }
00074 work = (lapack_complex_double*)
00075 LAPACKE_malloc( sizeof(lapack_complex_double) * MAX(1,2*n) );
00076 if( work == NULL ) {
00077 info = LAPACK_WORK_MEMORY_ERROR;
00078 goto exit_level_1;
00079 }
00080
00081 info = LAPACKE_zgbrfs_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_zgbrfs", info );
00091 }
00092 return info;
00093 }