lapack_int LAPACKE_zspsvx( int matrix_order, char fact, char uplo, lapack_int n, lapack_int nrhs, const lapack_complex_double* ap, lapack_complex_double* afp, lapack_int* ipiv, const lapack_complex_double* b, lapack_int ldb, lapack_complex_double* x, lapack_int ldx, double* rcond, double* ferr, double* berr ) { lapack_int info = 0; double* rwork = NULL; lapack_complex_double* work = NULL; if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_zspsvx", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_lsame( fact, 'f' ) ) { if( LAPACKE_zsp_nancheck( n, afp ) ) { return -7; } } if( LAPACKE_zsp_nancheck( n, ap ) ) { return -6; } if( LAPACKE_zge_nancheck( matrix_order, n, nrhs, b, ldb ) ) { return -9; } #endif /* Allocate memory for working array(s) */ rwork = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,n) ); if( rwork == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } work = (lapack_complex_double*) LAPACKE_malloc( sizeof(lapack_complex_double) * MAX(1,2*n) ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_1; } /* Call middle-level interface */ info = LAPACKE_zspsvx_work( matrix_order, fact, uplo, n, nrhs, ap, afp, ipiv, b, ldb, x, ldx, rcond, ferr, berr, work, rwork ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_1: LAPACKE_free( rwork ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_zspsvx", info ); } return info; }
lapack_int LAPACKE_zsptri( int matrix_layout, char uplo, lapack_int n, lapack_complex_double* ap, const lapack_int* ipiv ) { lapack_int info = 0; lapack_complex_double* work = NULL; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_zsptri", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK if( LAPACKE_get_nancheck() ) { /* Optionally check input matrices for NaNs */ if( LAPACKE_zsp_nancheck( n, ap ) ) { return -4; } } #endif /* Allocate memory for working array(s) */ work = (lapack_complex_double*) LAPACKE_malloc( sizeof(lapack_complex_double) * MAX(1,n) ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_zsptri_work( matrix_layout, uplo, n, ap, ipiv, work ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_zsptri", info ); } return info; }
lapack_int LAPACKE_zsptrf( int matrix_layout, char uplo, lapack_int n, lapack_complex_double* ap, lapack_int* ipiv ) { if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_zsptrf", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_zsp_nancheck( n, ap ) ) { return -4; } #endif return LAPACKE_zsptrf_work( matrix_layout, uplo, n, ap, ipiv ); }
lapack_int LAPACKE_zspsv( int matrix_layout, char uplo, lapack_int n, lapack_int nrhs, lapack_complex_double* ap, lapack_int* ipiv, lapack_complex_double* b, lapack_int ldb ) { if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_zspsv", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_zsp_nancheck( n, ap ) ) { return -5; } if( LAPACKE_zge_nancheck( matrix_layout, n, nrhs, b, ldb ) ) { return -7; } #endif return LAPACKE_zspsv_work( matrix_layout, uplo, n, nrhs, ap, ipiv, b, ldb ); }