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

◆ F77_chpr2()

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

Definition at line 666 of file c_cblas2.c.

668 {
669 CBLAS_TEST_COMPLEX *A, *AP;
670 CBLAS_INT i,j,k,LDA;
671 CBLAS_UPLO uplo;
672
673 get_uplo_type(uplow,&uplo);
674
675 if (*layout == TEST_ROW_MJR) {
676 if (uplo != CblasUpper && uplo != CblasLower )
677 cblas_chpr2( CblasRowMajor, UNDEFINED, *n, alpha, x, *incx, y,
678 *incy, ap );
679 else {
680 LDA = *n;
681 A=(CBLAS_TEST_COMPLEX*)malloc( LDA*LDA*sizeof(CBLAS_TEST_COMPLEX ) );
682 AP=(CBLAS_TEST_COMPLEX*)malloc( (((LDA+1)*LDA)/2)*
683 sizeof( CBLAS_TEST_COMPLEX ));
684 if (uplo == CblasUpper) {
685 for( j=0, k=0; j<*n; j++ )
686 for( i=0; i<j+1; i++, k++ ) {
687 A[ LDA*i+j ].real=ap[ k ].real;
688 A[ LDA*i+j ].imag=ap[ k ].imag;
689 }
690 for( i=0, k=0; i<*n; i++ )
691 for( j=i; j<*n; j++, k++ ) {
692 AP[ k ].real=A[ LDA*i+j ].real;
693 AP[ k ].imag=A[ LDA*i+j ].imag;
694 }
695 }
696 else {
697 for( j=0, k=0; j<*n; j++ )
698 for( i=j; i<*n; i++, k++ ) {
699 A[ LDA*i+j ].real=ap[ k ].real;
700 A[ LDA*i+j ].imag=ap[ k ].imag;
701 }
702 for( i=0, k=0; i<*n; i++ )
703 for( j=0; j<i+1; j++, k++ ) {
704 AP[ k ].real=A[ LDA*i+j ].real;
705 AP[ k ].imag=A[ LDA*i+j ].imag;
706 }
707 }
708 cblas_chpr2( CblasRowMajor, uplo, *n, alpha, x, *incx, y, *incy, AP );
709 if (uplo == CblasUpper) {
710 for( i=0, k=0; i<*n; i++ )
711 for( j=i; j<*n; j++, k++ ) {
712 A[ LDA*i+j ].real=AP[ k ].real;
713 A[ LDA*i+j ].imag=AP[ k ].imag;
714 }
715 for( j=0, k=0; j<*n; j++ )
716 for( i=0; i<j+1; i++, k++ ) {
717 ap[ k ].real=A[ LDA*i+j ].real;
718 ap[ k ].imag=A[ LDA*i+j ].imag;
719 }
720 }
721 else {
722 for( i=0, k=0; i<*n; i++ )
723 for( j=0; j<i+1; j++, k++ ) {
724 A[ LDA*i+j ].real=AP[ k ].real;
725 A[ LDA*i+j ].imag=AP[ k ].imag;
726 }
727 for( j=0, k=0; j<*n; j++ )
728 for( i=j; i<*n; i++, k++ ) {
729 ap[ k ].real=A[ LDA*i+j ].real;
730 ap[ k ].imag=A[ LDA*i+j ].imag;
731 }
732 }
733 free(A);
734 free(AP);
735 }
736 }
737 else if (*layout == TEST_COL_MJR)
738 cblas_chpr2( CblasColMajor, uplo, *n, alpha, x, *incx, y, *incy, ap );
739 else
740 cblas_chpr2( UNDEFINED, uplo, *n, alpha, x, *incx, y, *incy, ap );
741}
CBLAS_UPLO
Definition cblas.h:41
@ CblasLower
Definition cblas.h:41
@ CblasUpper
Definition cblas.h:41
@ CblasColMajor
Definition cblas.h:39
@ CblasRowMajor
Definition cblas.h:39
void cblas_chpr2(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_chpr2.c:12
#define CBLAS_INT
Definition cblas.h:24
#define UNDEFINED
Definition cblas_test.h:19
#define TEST_ROW_MJR
Definition cblas_test.h:12
#define TEST_COL_MJR
Definition cblas_test.h:16
void get_uplo_type(char *type, CBLAS_UPLO *uplo)
Definition auxiliary.c:18
Here is the call graph for this function: