lapack_int LAPACKE_zgttrs( int matrix_layout, char trans, lapack_int n, lapack_int nrhs, const lapack_complex_double* dl, const lapack_complex_double* d, const lapack_complex_double* du, const lapack_complex_double* du2, const lapack_int* ipiv, lapack_complex_double* b, lapack_int ldb ) { if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_zgttrs", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_zge_nancheck( matrix_layout, n, nrhs, b, ldb ) ) { return -10; } if( LAPACKE_z_nancheck( n, d, 1 ) ) { return -6; } if( LAPACKE_z_nancheck( n-1, dl, 1 ) ) { return -5; } if( LAPACKE_z_nancheck( n-1, du, 1 ) ) { return -7; } if( LAPACKE_z_nancheck( n-2, du2, 1 ) ) { return -8; } #endif return LAPACKE_zgttrs_work( matrix_layout, trans, n, nrhs, dl, d, du, du2, ipiv, b, ldb ); }
lapack_int LAPACKE_zlaset( int matrix_layout, char uplo, lapack_int m, lapack_int n, lapack_complex_double alpha, lapack_complex_double beta, lapack_complex_double* a, lapack_int lda ) { if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_zlaset", -1 ); return -1; } /***************************************************************************** * Note: we do not check NaNs in A since the goal of this subroutine is to * initialized A. It is OK if A has NaNs in input. *****************************************************************************/ #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_z_nancheck( 1, &alpha, 1 ) ) { return -5; } if( LAPACKE_z_nancheck( 1, &beta, 1 ) ) { return -6; } #endif return LAPACKE_zlaset_work( matrix_layout, uplo, m, n, alpha, beta, a, lda ); }
lapack_int LAPACKE_zlarfx( int matrix_layout, char side, lapack_int m, lapack_int n, const lapack_complex_double* v, lapack_complex_double tau, lapack_complex_double* c, lapack_int ldc, lapack_complex_double* work ) { lapack_int lv; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_zlarfx", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK if( LAPACKE_get_nancheck() ) { /* Optionally check input matrices for NaNs */ if( LAPACKE_zge_nancheck( matrix_layout, m, n, c, ldc ) ) { return -7; } if( LAPACKE_z_nancheck( 1, &tau, 1 ) ) { return -6; } lv = (LAPACKE_lsame( side, 'l' ) ? m : n); if( LAPACKE_z_nancheck( lv, v, 1 ) ) { return -5; } } #endif return LAPACKE_zlarfx_work( matrix_layout, side, m, n, v, tau, c, ldc, work ); }
lapack_int LAPACKE_zgtsv( int matrix_order, lapack_int n, lapack_int nrhs, lapack_complex_double* dl, lapack_complex_double* d, lapack_complex_double* du, lapack_complex_double* b, lapack_int ldb ) { if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_zgtsv", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_zge_nancheck( matrix_order, n, nrhs, b, ldb ) ) { return -7; } if( LAPACKE_z_nancheck( n, d, 1 ) ) { return -5; } if( LAPACKE_z_nancheck( n-1, dl, 1 ) ) { return -4; } if( LAPACKE_z_nancheck( n-1, du, 1 ) ) { return -6; } #endif return LAPACKE_zgtsv_work( matrix_order, n, nrhs, dl, d, du, b, ldb ); }
lapack_int LAPACKE_zgglse( int matrix_order, lapack_int m, lapack_int n, lapack_int p, lapack_complex_double* a, lapack_int lda, lapack_complex_double* b, lapack_int ldb, lapack_complex_double* c, lapack_complex_double* d, lapack_complex_double* x ) { lapack_int info = 0; lapack_int lwork = -1; lapack_complex_double* work = NULL; lapack_complex_double work_query; if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_zgglse", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_zge_nancheck( matrix_order, m, n, a, lda ) ) { return -5; } if( LAPACKE_zge_nancheck( matrix_order, p, n, b, ldb ) ) { return -7; } if( LAPACKE_z_nancheck( m, c, 1 ) ) { return -9; } if( LAPACKE_z_nancheck( p, d, 1 ) ) { return -10; } #endif /* Query optimal working array(s) size */ info = LAPACKE_zgglse_work( matrix_order, m, n, p, a, lda, b, ldb, c, d, x, &work_query, lwork ); if( info != 0 ) { goto exit_level_0; } lwork = LAPACK_Z2INT( work_query ); /* Allocate memory for work arrays */ work = (lapack_complex_double*) LAPACKE_malloc( sizeof(lapack_complex_double) * lwork ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_zgglse_work( matrix_order, m, n, p, a, lda, b, ldb, c, d, x, work, lwork ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_zgglse", info ); } return info; }
lapack_int LAPACKE_zlarft( int matrix_layout, char direct, char storev, lapack_int n, lapack_int k, const lapack_complex_double* v, lapack_int ldv, const lapack_complex_double* tau, lapack_complex_double* t, lapack_int ldt ) { lapack_int ncols_v, nrows_v; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_zlarft", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ ncols_v = LAPACKE_lsame( storev, 'c' ) ? k : ( LAPACKE_lsame( storev, 'r' ) ? n : 1); nrows_v = LAPACKE_lsame( storev, 'c' ) ? n : ( LAPACKE_lsame( storev, 'r' ) ? k : 1); if( LAPACKE_z_nancheck( k, tau, 1 ) ) { return -8; } if( LAPACKE_zge_nancheck( matrix_layout, nrows_v, ncols_v, v, ldv ) ) { return -6; } #endif return LAPACKE_zlarft_work( matrix_layout, direct, storev, n, k, v, ldv, tau, t, ldt ); }
lapack_int LAPACKE_zhsein( int matrix_layout, char job, char eigsrc, char initv, const lapack_logical* select, lapack_int n, const lapack_complex_double* h, lapack_int ldh, lapack_complex_double* w, lapack_complex_double* vl, lapack_int ldvl, lapack_complex_double* vr, lapack_int ldvr, lapack_int mm, lapack_int* m, lapack_int* ifaill, lapack_int* ifailr ) { lapack_int info = 0; double* rwork = NULL; lapack_complex_double* work = NULL; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_zhsein", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_zge_nancheck( matrix_layout, n, n, h, ldh ) ) { return -7; } if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'l' ) ) { if( LAPACKE_zge_nancheck( matrix_layout, n, mm, vl, ldvl ) ) { return -10; } } if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'r' ) ) { if( LAPACKE_zge_nancheck( matrix_layout, n, mm, vr, ldvr ) ) { return -12; } } if( LAPACKE_z_nancheck( n, w, 1 ) ) { 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,n) * MAX(1,n) ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_1; } /* Call middle-level interface */ info = LAPACKE_zhsein_work( matrix_layout, job, eigsrc, initv, select, n, h, ldh, w, vl, ldvl, vr, ldvr, mm, m, work, rwork, ifaill, ifailr ); /* 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_zhsein", info ); } return info; }
lapack_int LAPACKE_ztfsm( int matrix_layout, char transr, char side, char uplo, char trans, char diag, lapack_int m, lapack_int n, lapack_complex_double alpha, const lapack_complex_double* a, lapack_complex_double* b, lapack_int ldb ) { if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_ztfsm", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK if( LAPACKE_get_nancheck() ) { /* Optionally check input matrices for NaNs */ if( IS_Z_NONZERO(alpha) ) { if( LAPACKE_ztf_nancheck( matrix_layout, transr, uplo, diag, n, a ) ) { return -10; } } if( LAPACKE_z_nancheck( 1, &alpha, 1 ) ) { return -9; } if( IS_Z_NONZERO(alpha) ) { if( LAPACKE_zge_nancheck( matrix_layout, m, n, b, ldb ) ) { return -11; } } } #endif return LAPACKE_ztfsm_work( matrix_layout, transr, side, uplo, trans, diag, m, n, alpha, a, b, ldb ); }
lapack_int LAPACKE_zptcon( lapack_int n, const double* d, const lapack_complex_double* e, double anorm, double* rcond ) { lapack_int info = 0; double* work = NULL; #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_d_nancheck( 1, &anorm, 1 ) ) { return -4; } if( LAPACKE_d_nancheck( n, d, 1 ) ) { return -2; } if( LAPACKE_z_nancheck( n-1, e, 1 ) ) { return -3; } #endif /* Allocate memory for working array(s) */ work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,n) ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_zptcon_work( n, d, e, anorm, rcond, work ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_zptcon", info ); } return info; }
lapack_logical LAPACKE_ztp_nancheck( int matrix_order, char uplo, char diag, lapack_int n, const lapack_complex_double *ap ) { lapack_int i, len; lapack_logical colmaj, upper, unit; if( ap == NULL ) return (lapack_logical) 0; colmaj = ( matrix_order == LAPACK_COL_MAJOR ); upper = LAPACKE_lsame( uplo, 'u' ); unit = LAPACKE_lsame( diag, 'u' ); if( ( !colmaj && ( matrix_order != LAPACK_ROW_MAJOR ) ) || ( !upper && !LAPACKE_lsame( uplo, 'l' ) ) || ( !unit && !LAPACKE_lsame( diag, 'n' ) ) ) { /* Just exit if any of input parameters are wrong */ return (lapack_logical) 0; } if( unit ) { /* Unit case, diagonal should be excluded from the check for NaN. */ /* Since col_major upper and row_major lower are equal, * and col_major lower and row_major upper are equals too - * using one code for equal cases. XOR( colmaj, upper ) */ if( ( colmaj || upper ) && !( colmaj && upper ) ) { for( i = 1; i < n; i++ ) if( LAPACKE_z_nancheck( i, &ap[ ((size_t)i+1)*i/2 ], 1 ) ) return (lapack_logical) 1; } else { for( i = 0; i < n-1; i++ ) if( LAPACKE_z_nancheck( n-i-1, &ap[ (size_t)i+1 + i*((size_t)2*n-i+1)/2 ], 1 ) ) return (lapack_logical) 1; } return (lapack_logical) 0; } else { /* Non-unit case - just check whole array for NaNs. */ len = n*(n+1)/2; return LAPACKE_z_nancheck( len, ap, 1 ); } }
lapack_int LAPACKE_zupmtr( int matrix_order, char side, char uplo, char trans, lapack_int m, lapack_int n, const lapack_complex_double* ap, const lapack_complex_double* tau, lapack_complex_double* c, lapack_int ldc ) { lapack_int info = 0; /* Additional scalars declarations for work arrays */ lapack_int lwork; lapack_complex_double* work = NULL; if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_zupmtr", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ lapack_int r = LAPACKE_lsame( side, 'l' ) ? m : n; if( LAPACKE_zpp_nancheck( r, ap ) ) { return -7; } if( LAPACKE_zge_nancheck( matrix_order, m, n, c, ldc ) ) { return -9; } if( LAPACKE_z_nancheck( m-1, tau, 1 ) ) { return -8; } #endif /* Additional scalars initializations for work arrays */ if( LAPACKE_lsame( side, 'l' ) ) { lwork = MAX(1,n); } else if( LAPACKE_lsame( side, 'r' ) ) { lwork = MAX(1,m); } else { lwork = 1; /* Any value */ } /* Allocate memory for working array(s) */ work = (lapack_complex_double*) LAPACKE_malloc( sizeof(lapack_complex_double) * lwork ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_zupmtr_work( matrix_order, side, uplo, trans, m, n, ap, tau, c, ldc, work ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_zupmtr", info ); } return info; }
lapack_int LAPACKE_zunmtr( int matrix_layout, char side, char uplo, char trans, lapack_int m, lapack_int n, const lapack_complex_double* a, lapack_int lda, const lapack_complex_double* tau, lapack_complex_double* c, lapack_int ldc ) { lapack_int info = 0; lapack_int lwork = -1; lapack_complex_double* work = NULL; lapack_complex_double work_query; lapack_int r; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_zunmtr", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ r = LAPACKE_lsame( side, 'l' ) ? m : n; if( LAPACKE_zge_nancheck( matrix_layout, r, r, a, lda ) ) { return -7; } if( LAPACKE_zge_nancheck( matrix_layout, m, n, c, ldc ) ) { return -10; } if( LAPACKE_z_nancheck( m-1, tau, 1 ) ) { return -9; } #endif /* Query optimal working array(s) size */ info = LAPACKE_zunmtr_work( matrix_layout, side, uplo, trans, m, n, a, lda, tau, c, ldc, &work_query, lwork ); if( info != 0 ) { goto exit_level_0; } lwork = LAPACK_Z2INT( work_query ); /* Allocate memory for work arrays */ work = (lapack_complex_double*) LAPACKE_malloc( sizeof(lapack_complex_double) * lwork ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_zunmtr_work( matrix_layout, side, uplo, trans, m, n, a, lda, tau, c, ldc, work, lwork ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_zunmtr", info ); } return info; }
lapack_logical LAPACKE_zhs_nancheck( int matrix_order, lapack_int n, const lapack_complex_double *a, lapack_int lda ) { lapack_logical subdiag_nans; if( a == NULL ) return (lapack_logical) 0; /* Check subdiagonal first */ if( matrix_order == LAPACK_COL_MAJOR ) { subdiag_nans = LAPACKE_z_nancheck( n-1, &a[1], lda+1 ); } else if ( matrix_order == LAPACK_ROW_MAJOR ) { subdiag_nans = LAPACKE_z_nancheck( n-1, &a[lda], lda+1 ); } else { return (lapack_logical) 0; } /* Check upper triangular if subdiagonal has no NaNs. */ return subdiag_nans || LAPACKE_ztr_nancheck( matrix_order, 'u', 'n', n, a, lda); }
lapack_int LAPACKE_zsyr( int matrix_order, char uplo, lapack_int n, lapack_complex_double alpha, const lapack_complex_double* x, lapack_int incx, lapack_complex_double* a, lapack_int lda ) { if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_zsyr", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_zsy_nancheck( matrix_order, uplo, n, a, lda ) ) { return -7; } if( LAPACKE_z_nancheck( 1, &alpha, 1 ) ) { return -4; } if( LAPACKE_z_nancheck( n, x, 1 ) ) { return -5; } #endif return LAPACKE_zsyr_work( matrix_order, uplo, n, alpha, x, incx, a, lda ); }
lapack_int LAPACKE_zlarfx( int matrix_order, char side, lapack_int m, lapack_int n, const lapack_complex_double* v, lapack_complex_double tau, lapack_complex_double* c, lapack_int ldc, lapack_complex_double* work ) { if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_zlarfx", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_zge_nancheck( matrix_order, m, n, c, ldc ) ) { return -7; } if( LAPACKE_z_nancheck( 1, &tau, 1 ) ) { return -6; } if( LAPACKE_z_nancheck( m, v, 1 ) ) { return -5; } #endif return LAPACKE_zlarfx_work( matrix_order, side, m, n, v, tau, c, ldc, work ); }
lapack_int LAPACKE_zungrq( int matrix_layout, lapack_int m, lapack_int n, lapack_int k, lapack_complex_double* a, lapack_int lda, const lapack_complex_double* tau ) { lapack_int info = 0; lapack_int lwork = -1; lapack_complex_double* work = NULL; lapack_complex_double work_query; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_zungrq", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK if( LAPACKE_get_nancheck() ) { /* Optionally check input matrices for NaNs */ if( LAPACKE_zge_nancheck( matrix_layout, m, n, a, lda ) ) { return -5; } if( LAPACKE_z_nancheck( k, tau, 1 ) ) { return -7; } } #endif /* Query optimal working array(s) size */ info = LAPACKE_zungrq_work( matrix_layout, m, n, k, a, lda, tau, &work_query, lwork ); if( info != 0 ) { goto exit_level_0; } lwork = LAPACK_Z2INT( work_query ); /* Allocate memory for work arrays */ work = (lapack_complex_double*) LAPACKE_malloc( sizeof(lapack_complex_double) * lwork ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_zungrq_work( matrix_layout, m, n, k, a, lda, tau, work, lwork ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_zungrq", info ); } return info; }
lapack_int LAPACKE_zsytri_3( int matrix_layout, char uplo, lapack_int n, lapack_complex_double* a, lapack_int lda, const lapack_complex_double* e, const lapack_int* ipiv ) { lapack_int info = 0; lapack_int lwork = -1; lapack_complex_double* work = NULL; lapack_complex_double work_query; lapack_int e_start = LAPACKE_lsame( uplo, 'U' ) ? 1 : 0; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_zsytri_3", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK if( LAPACKE_get_nancheck() ) { /* Optionally check input matrices for NaNs */ if( LAPACKE_zsy_nancheck( matrix_layout, uplo, n, a, lda ) ) { return -4; } if( LAPACKE_z_nancheck( n-1, e + e_start, 1 ) ) { return -6; } } #endif /* Query optimal working array(s) size */ info = LAPACKE_zsytri_3_work( matrix_layout, uplo, n, a, lda, e, ipiv, &work_query, lwork ); if( info != 0 ) { goto exit_level_0; } lwork = LAPACK_Z2INT( work_query ); /* Allocate memory for working array(s) */ work = (lapack_complex_double*) LAPACKE_malloc( sizeof(lapack_complex_double) * lwork ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_zsytri_3_work( matrix_layout, uplo, n, a, lda, e, ipiv, work, lwork ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_zsytri_3", info ); } return info; }
lapack_int LAPACKE_zpttrs( int matrix_order, char uplo, lapack_int n, lapack_int nrhs, const double* d, const lapack_complex_double* e, lapack_complex_double* b, lapack_int ldb ) { if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_zpttrs", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_zge_nancheck( matrix_order, n, nrhs, b, ldb ) ) { return -7; } if( LAPACKE_d_nancheck( n, d, 1 ) ) { return -5; } if( LAPACKE_z_nancheck( n-1, e, 1 ) ) { return -6; } #endif return LAPACKE_zpttrs_work( matrix_order, uplo, n, nrhs, d, e, b, ldb ); }
lapack_logical LAPACKE_zhp_nancheck( lapack_int n, const lapack_complex_double *ap ) { lapack_int len = n*(n+1)/2; return LAPACKE_z_nancheck( len, ap, 1 ); }
lapack_int LAPACKE_zgtrfs( int matrix_layout, char trans, lapack_int n, lapack_int nrhs, const lapack_complex_double* dl, const lapack_complex_double* d, const lapack_complex_double* du, const lapack_complex_double* dlf, const lapack_complex_double* df, const lapack_complex_double* duf, const lapack_complex_double* du2, const lapack_int* ipiv, const lapack_complex_double* b, lapack_int ldb, lapack_complex_double* x, lapack_int ldx, double* ferr, double* berr ) { lapack_int info = 0; double* rwork = NULL; lapack_complex_double* work = NULL; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_zgtrfs", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_zge_nancheck( matrix_layout, n, nrhs, b, ldb ) ) { return -13; } if( LAPACKE_z_nancheck( n, d, 1 ) ) { return -6; } if( LAPACKE_z_nancheck( n, df, 1 ) ) { return -9; } if( LAPACKE_z_nancheck( n-1, dl, 1 ) ) { return -5; } if( LAPACKE_z_nancheck( n-1, dlf, 1 ) ) { return -8; } if( LAPACKE_z_nancheck( n-1, du, 1 ) ) { return -7; } if( LAPACKE_z_nancheck( n-2, du2, 1 ) ) { return -11; } if( LAPACKE_z_nancheck( n-1, duf, 1 ) ) { return -10; } if( LAPACKE_zge_nancheck( matrix_layout, n, nrhs, x, ldx ) ) { return -15; } #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_zgtrfs_work( matrix_layout, trans, n, nrhs, dl, d, du, dlf, df, duf, du2, ipiv, b, ldb, x, ldx, 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_zgtrfs", info ); } return info; }