LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ F77_zhpr2()

void F77_zhpr2 ( CBLAS_INT * layout,
char * uplow,
CBLAS_INT * n,
CBLAS_TEST_ZOMPLEX * alpha,
CBLAS_TEST_ZOMPLEX * x,
CBLAS_INT * incx,
CBLAS_TEST_ZOMPLEX * y,
CBLAS_INT * incy,
CBLAS_TEST_ZOMPLEX * ap )

Definition at line 714 of file c_zblas2.c.

720 {
721 CBLAS_TEST_ZOMPLEX *A, *AP;
722 CBLAS_INT i,j,k,LDA;
723 CBLAS_UPLO uplo;
724
725 get_uplo_type(uplow,&uplo);
726
727 if (*layout == TEST_ROW_MJR) {
728 if (uplo != CblasUpper && uplo != CblasLower )
729 cblas_zhpr2( CblasRowMajor, UNDEFINED, *n, alpha, x, *incx, y,
730 *incy, ap );
731 else {
732 LDA = *n;
733 A=(CBLAS_TEST_ZOMPLEX*)malloc( LDA*LDA*sizeof(CBLAS_TEST_ZOMPLEX ) );
734 AP=(CBLAS_TEST_ZOMPLEX*)malloc( (((LDA+1)*LDA)/2)*
735 sizeof( CBLAS_TEST_ZOMPLEX ));
736 if (uplo == CblasUpper) {
737 for( j=0, k=0; j<*n; j++ )
738 for( i=0; i<j+1; i++, k++ ) {
739 A[ LDA*i+j ].real=ap[ k ].real;
740 A[ LDA*i+j ].imag=ap[ k ].imag;
741 }
742 for( i=0, k=0; i<*n; i++ )
743 for( j=i; j<*n; j++, k++ ) {
744 AP[ k ].real=A[ LDA*i+j ].real;
745 AP[ k ].imag=A[ LDA*i+j ].imag;
746 }
747 }
748 else {
749 for( j=0, k=0; j<*n; j++ )
750 for( i=j; i<*n; i++, k++ ) {
751 A[ LDA*i+j ].real=ap[ k ].real;
752 A[ LDA*i+j ].imag=ap[ k ].imag;
753 }
754 for( i=0, k=0; i<*n; i++ )
755 for( j=0; j<i+1; j++, k++ ) {
756 AP[ k ].real=A[ LDA*i+j ].real;
757 AP[ k ].imag=A[ LDA*i+j ].imag;
758 }
759 }
760 cblas_zhpr2( CblasRowMajor, uplo, *n, alpha, x, *incx, y, *incy, AP );
761 if (uplo == CblasUpper) {
762 for( i=0, k=0; i<*n; i++ )
763 for( j=i; j<*n; j++, k++ ) {
764 A[ LDA*i+j ].real=AP[ k ].real;
765 A[ LDA*i+j ].imag=AP[ k ].imag;
766 }
767 for( j=0, k=0; j<*n; j++ )
768 for( i=0; i<j+1; i++, k++ ) {
769 ap[ k ].real=A[ LDA*i+j ].real;
770 ap[ k ].imag=A[ LDA*i+j ].imag;
771 }
772 }
773 else {
774 for( i=0, k=0; i<*n; i++ )
775 for( j=0; j<i+1; j++, k++ ) {
776 A[ LDA*i+j ].real=AP[ k ].real;
777 A[ LDA*i+j ].imag=AP[ k ].imag;
778 }
779 for( j=0, k=0; j<*n; j++ )
780 for( i=j; i<*n; i++, k++ ) {
781 ap[ k ].real=A[ LDA*i+j ].real;
782 ap[ k ].imag=A[ LDA*i+j ].imag;
783 }
784 }
785 free(A);
786 free(AP);
787 }
788 }
789 else if (*layout == TEST_COL_MJR)
790 cblas_zhpr2( CblasColMajor, uplo, *n, alpha, x, *incx, y, *incy, ap );
791 else
792 cblas_zhpr2( UNDEFINED, uplo, *n, alpha, x, *incx, y, *incy, ap );
793}
CBLAS_UPLO
Definition cblas.h:41
@ CblasLower
Definition cblas.h:41
@ CblasUpper
Definition cblas.h:41
void cblas_zhpr2(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, const CBLAS_INT N, const void *alpha, const void *X, const CBLAS_INT incX, const void *Y, const CBLAS_INT incY, void *Ap)
Definition cblas_zhpr2.c:12
@ CblasColMajor
Definition cblas.h:39
@ CblasRowMajor
Definition cblas.h:39
#define CBLAS_INT
Definition cblas.h:24
#define UNDEFINED
Definition cblas_test.h:28
#define TEST_ROW_MJR
Definition cblas_test.h:21
#define TEST_COL_MJR
Definition cblas_test.h:25
void get_uplo_type(char *type, CBLAS_UPLO *uplo)
Definition auxiliary.c:18
Here is the call graph for this function: