Exemplo n.º 1
0
inline void tbsv( const Order, const UpLo, const Trans, const Diag,
        const int n, const int k, const std::complex<double>* a,
        const int lda, std::complex<double>* x, const int incx ) {
    cblas_ztbsv( cblas_option< Order >::value, cblas_option< UpLo >::value,
            cblas_option< Trans >::value, cblas_option< Diag >::value, n, k,
            a, lda, x, incx );
}
Exemplo n.º 2
0
void F77_ztbsv(int *layout, char *uplow, char *transp, char *diagn,
               int *n, int *k, CBLAS_TEST_ZOMPLEX *a, int *lda, CBLAS_TEST_ZOMPLEX *x,
               int *incx) {

    CBLAS_TEST_ZOMPLEX *A;
    int irow, jcol, i, j, LDA;
    CBLAS_TRANSPOSE trans;
    CBLAS_UPLO uplo;
    CBLAS_DIAG diag;

    get_transpose_type(transp,&trans);
    get_uplo_type(uplow,&uplo);
    get_diag_type(diagn,&diag);

    if (*layout == TEST_ROW_MJR) {
        if (uplo != CblasUpper && uplo != CblasLower )
            cblas_ztbsv(CblasRowMajor, UNDEFINED, trans, diag, *n, *k, a, *lda, x,
                        *incx);
        else {
            LDA = *k+2;
            A=(CBLAS_TEST_ZOMPLEX*)malloc((*n+*k)*LDA*sizeof(CBLAS_TEST_ZOMPLEX ));
            if (uplo == CblasUpper) {
                for( i=0; i<*k; i++ ) {
                    irow=*k-i;
                    jcol=(*k)-i;
                    for( j=jcol; j<*n; j++ ) {
                        A[ LDA*(j-jcol)+irow ].real=a[ (*lda)*j+i ].real;
                        A[ LDA*(j-jcol)+irow ].imag=a[ (*lda)*j+i ].imag;
                    }
                }
                i=*k;
                irow=*k-i;
                for( j=0; j<*n; j++ ) {
                    A[ LDA*j+irow ].real=a[ (*lda)*j+i ].real;
                    A[ LDA*j+irow ].imag=a[ (*lda)*j+i ].imag;
                }
            }
            else {
                i=0;
                irow=*k-i;
                for( j=0; j<*n; j++ ) {
                    A[ LDA*j+irow ].real=a[ (*lda)*j+i ].real;
                    A[ LDA*j+irow ].imag=a[ (*lda)*j+i ].imag;
                }
                for( i=1; i<*k+1; i++ ) {
                    irow=*k-i;
                    jcol=i;
                    for( j=jcol; j<(*n+*k); j++ ) {
                        A[ LDA*j+irow ].real=a[ (*lda)*(j-jcol)+i ].real;
                        A[ LDA*j+irow ].imag=a[ (*lda)*(j-jcol)+i ].imag;
                    }
                }
            }
            cblas_ztbsv(CblasRowMajor, uplo, trans, diag, *n, *k, A, LDA,
                        x, *incx);
            free(A);
        }
    }
    else if (*layout == TEST_COL_MJR)
        cblas_ztbsv(CblasColMajor, uplo, trans, diag, *n, *k, a, *lda, x, *incx);
    else
        cblas_ztbsv(UNDEFINED, uplo, trans, diag, *n, *k, a, *lda, x, *incx);
}