Ejemplo n.º 1
0
void F77_zhpmv(int *layout, char *uplow, int *n, CBLAS_TEST_ZOMPLEX *alpha,
               CBLAS_TEST_ZOMPLEX *ap, CBLAS_TEST_ZOMPLEX *x, int *incx,
               CBLAS_TEST_ZOMPLEX *beta, CBLAS_TEST_ZOMPLEX *y, int *incy) {

    CBLAS_TEST_ZOMPLEX *A, *AP;
    int i,j,k,LDA;
    CBLAS_UPLO uplo;

    get_uplo_type(uplow,&uplo);
    if (*layout == TEST_ROW_MJR) {
        if (uplo != CblasUpper && uplo != CblasLower )
            cblas_zhpmv(CblasRowMajor, UNDEFINED, *n, alpha, ap, x, *incx,
                        beta, y, *incy);
        else {
            LDA = *n;
            A = (CBLAS_TEST_ZOMPLEX* )malloc(LDA*LDA*sizeof(CBLAS_TEST_ZOMPLEX ));
            AP = (CBLAS_TEST_ZOMPLEX* )malloc( (((LDA+1)*LDA)/2)*
                                               sizeof( CBLAS_TEST_ZOMPLEX ));
            if (uplo == CblasUpper) {
                for( j=0, k=0; j<*n; j++ )
                    for( i=0; i<j+1; i++, k++ ) {
                        A[ LDA*i+j ].real=ap[ k ].real;
                        A[ LDA*i+j ].imag=ap[ k ].imag;
                    }
                for( i=0, k=0; i<*n; i++ )
                    for( j=i; j<*n; j++, k++ ) {
                        AP[ k ].real=A[ LDA*i+j ].real;
                        AP[ k ].imag=A[ LDA*i+j ].imag;
                    }
            }
            else {
                for( j=0, k=0; j<*n; j++ )
                    for( i=j; i<*n; i++, k++ ) {
                        A[ LDA*i+j ].real=ap[ k ].real;
                        A[ LDA*i+j ].imag=ap[ k ].imag;
                    }
                for( i=0, k=0; i<*n; i++ )
                    for( j=0; j<i+1; j++, k++ ) {
                        AP[ k ].real=A[ LDA*i+j ].real;
                        AP[ k ].imag=A[ LDA*i+j ].imag;
                    }
            }
            cblas_zhpmv( CblasRowMajor, uplo, *n, alpha, AP, x, *incx, beta, y,
                         *incy );
            free(A);
            free(AP);
        }
    }
    else if (*layout == TEST_COL_MJR)
        cblas_zhpmv( CblasColMajor, uplo, *n, alpha, ap, x, *incx, beta, y,
                     *incy );
    else
        cblas_zhpmv( UNDEFINED, uplo, *n, alpha, ap, x, *incx, beta, y,
                     *incy );
}
Ejemplo n.º 2
0
 inline 
 void hpmv (CBLAS_ORDER const Order, CBLAS_UPLO const Uplo,
            int const N, traits::complex_d const& alpha, 
            traits::complex_d const* Ap, 
            traits::complex_d const* X, int const incX,
            traits::complex_d const& beta, 
            traits::complex_d* Y, int const incY) 
 {
   cblas_zhpmv (Order, Uplo, N, 
                static_cast<void const*> (&alpha), 
                static_cast<void const*> (Ap), 
                static_cast<void const*> (X), incX, 
                static_cast<void const*> (&beta), 
                static_cast<void*> (Y), incY);
 }
Ejemplo n.º 3
0
/* f77 interface */
void zhpmv_(char *uplo, int *n, double *alpha, double *Ap,
            double *X, int *incx, double *beta, double *Y, int *incy)
{
    
    Blasx_Debug_Output("Calling zhpmv_ interface\n");
    Blasx_Debug_Output("uplo:%c\n",*uplo);
    enum CBLAS_UPLO Uplo;
    int info = 0;
    if (F77UploToCBlasUplo(uplo,&Uplo) < 0)                     info =  1;
    if (info != 0) {
        xerbla_(ERROR_NAME, &info);
        return;
    }
    cblas_zhpmv(CblasColMajor, Uplo,
                *n, alpha, Ap,
                X, *incx,
                beta, Y, *incy);
}