inline void hpr (CBLAS_ORDER const Order, CBLAS_UPLO const Uplo, int const N, float const alpha, traits::complex_f const* X, int const incX, traits::complex_f* Ap) { cblas_chpr (Order, Uplo, N, alpha, static_cast<void const*> (X), incX, static_cast<void*> (Ap)); }
void F77_chpr(int *order, char *uplow, int *n, float *alpha, CBLAS_TEST_COMPLEX *x, int *incx, CBLAS_TEST_COMPLEX *ap) { CBLAS_TEST_COMPLEX *A, *AP; int i,j,k,LDA; enum CBLAS_UPLO uplo; get_uplo_type(uplow,&uplo); if (*order == TEST_ROW_MJR) { if (uplo != CblasUpper && uplo != CblasLower ) cblas_chpr(CblasRowMajor, UNDEFINED, *n, *alpha, x, *incx, ap ); else { LDA = *n; A = (CBLAS_TEST_COMPLEX* )malloc(LDA*LDA*sizeof(CBLAS_TEST_COMPLEX ) ); AP = ( CBLAS_TEST_COMPLEX* )malloc( (((LDA+1)*LDA)/2)* sizeof( CBLAS_TEST_COMPLEX )); 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_chpr(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 (*order == TEST_COL_MJR) cblas_chpr(CblasColMajor, uplo, *n, *alpha, x, *incx, ap ); else cblas_chpr(UNDEFINED, uplo, *n, *alpha, x, *incx, ap ); }
inline void hpr( const Order, const UpLo, const int n, const float alpha, const std::complex<float>* x, const int incx, std::complex<float>* ap ) { cblas_chpr( cblas_option< Order >::value, cblas_option< UpLo >::value, n, alpha, x, incx, ap ); }