inline 
 void hpr (CBLAS_ORDER const Order, CBLAS_UPLO const Uplo,
           int const N, double const alpha, 
           traits::complex_d const* X, int const incX, 
           traits::complex_d* Ap)
 {
   cblas_zhpr (Order, Uplo, N, alpha, 
               static_cast<void const*> (X), incX, 
               static_cast<void*> (Ap)); 
 }
Beispiel #2
0
void F77_zhpr(int *layout, char *uplow, int *n, double *alpha,
              CBLAS_TEST_ZOMPLEX *x, int *incx, CBLAS_TEST_ZOMPLEX *ap) {
    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_zhpr(CblasRowMajor, UNDEFINED, *n, *alpha, x, *incx, ap );
        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_zhpr(CblasRowMajor, uplo, *n, *alpha, x, *incx, AP );
            if (uplo == CblasUpper) {
                for( i=0, k=0; i<*n; i++ )
                    for( j=i; j<*n; j++, k++ ) {
                        A[ LDA*i+j ].real=AP[ k ].real;
                        A[ LDA*i+j ].imag=AP[ k ].imag;
                    }
                for( j=0, k=0; j<*n; j++ )
                    for( i=0; i<j+1; i++, k++ ) {
                        ap[ k ].real=A[ LDA*i+j ].real;
                        ap[ k ].imag=A[ LDA*i+j ].imag;
                    }
            }
            else {
                for( i=0, k=0; i<*n; i++ )
                    for( j=0; j<i+1; j++, k++ ) {
                        A[ LDA*i+j ].real=AP[ k ].real;
                        A[ LDA*i+j ].imag=AP[ k ].imag;
                    }
                for( j=0, k=0; j<*n; j++ )
                    for( i=j; i<*n; i++, k++ ) {
                        ap[ k ].real=A[ LDA*i+j ].real;
                        ap[ k ].imag=A[ LDA*i+j ].imag;
                    }
            }
            free(A);
            free(AP);
        }
    }
    else if (*layout == TEST_COL_MJR)
        cblas_zhpr(CblasColMajor, uplo, *n, *alpha, x, *incx, ap );
    else
        cblas_zhpr(UNDEFINED, uplo, *n, *alpha, x, *incx, ap );
}
inline void hpr( const Order, const UpLo, const int n, const double alpha,
        const std::complex<double>* x, const int incx,
        std::complex<double>* ap ) {
    cblas_zhpr( cblas_option< Order >::value, cblas_option< UpLo >::value, n,
            alpha, x, incx, ap );
}