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

◆ F77_chpr()

void F77_chpr ( CBLAS_INT * layout,
char * uplow,
CBLAS_INT * n,
float * alpha,
CBLAS_TEST_COMPLEX * x,
CBLAS_INT * incx,
CBLAS_TEST_COMPLEX * ap )

Definition at line 635 of file c_cblas2.c.

640 {
641 CBLAS_TEST_COMPLEX *A, *AP;
642 CBLAS_INT i,j,k,LDA;
643 CBLAS_UPLO uplo;
644
645 get_uplo_type(uplow,&uplo);
646
647 if (*layout == TEST_ROW_MJR) {
648 if (uplo != CblasUpper && uplo != CblasLower )
649 cblas_chpr(CblasRowMajor, UNDEFINED, *n, *alpha, x, *incx, ap );
650 else {
651 LDA = *n;
652 A = (CBLAS_TEST_COMPLEX* )malloc(LDA*LDA*sizeof(CBLAS_TEST_COMPLEX ) );
653 AP = ( CBLAS_TEST_COMPLEX* )malloc( (((LDA+1)*LDA)/2)*
654 sizeof( CBLAS_TEST_COMPLEX ));
655 if (uplo == CblasUpper) {
656 for( j=0, k=0; j<*n; j++ )
657 for( i=0; i<j+1; i++, k++ ){
658 A[ LDA*i+j ].real=ap[ k ].real;
659 A[ LDA*i+j ].imag=ap[ k ].imag;
660 }
661 for( i=0, k=0; i<*n; i++ )
662 for( j=i; j<*n; j++, k++ ){
663 AP[ k ].real=A[ LDA*i+j ].real;
664 AP[ k ].imag=A[ LDA*i+j ].imag;
665 }
666 }
667 else {
668 for( j=0, k=0; j<*n; j++ )
669 for( i=j; i<*n; i++, k++ ){
670 A[ LDA*i+j ].real=ap[ k ].real;
671 A[ LDA*i+j ].imag=ap[ k ].imag;
672 }
673 for( i=0, k=0; i<*n; i++ )
674 for( j=0; j<i+1; j++, k++ ){
675 AP[ k ].real=A[ LDA*i+j ].real;
676 AP[ k ].imag=A[ LDA*i+j ].imag;
677 }
678 }
679 cblas_chpr(CblasRowMajor, uplo, *n, *alpha, x, *incx, AP );
680 if (uplo == CblasUpper) {
681 for( i=0, k=0; i<*n; i++ )
682 for( j=i; j<*n; j++, k++ ){
683 A[ LDA*i+j ].real=AP[ k ].real;
684 A[ LDA*i+j ].imag=AP[ k ].imag;
685 }
686 for( j=0, k=0; j<*n; j++ )
687 for( i=0; i<j+1; i++, k++ ){
688 ap[ k ].real=A[ LDA*i+j ].real;
689 ap[ k ].imag=A[ LDA*i+j ].imag;
690 }
691 }
692 else {
693 for( i=0, k=0; i<*n; i++ )
694 for( j=0; j<i+1; j++, k++ ){
695 A[ LDA*i+j ].real=AP[ k ].real;
696 A[ LDA*i+j ].imag=AP[ k ].imag;
697 }
698 for( j=0, k=0; j<*n; j++ )
699 for( i=j; i<*n; i++, k++ ){
700 ap[ k ].real=A[ LDA*i+j ].real;
701 ap[ k ].imag=A[ LDA*i+j ].imag;
702 }
703 }
704 free(A);
705 free(AP);
706 }
707 }
708 else if (*layout == TEST_COL_MJR)
709 cblas_chpr(CblasColMajor, uplo, *n, *alpha, x, *incx, ap );
710 else
711 cblas_chpr(UNDEFINED, uplo, *n, *alpha, x, *incx, ap );
712}
void cblas_chpr(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, const CBLAS_INT N, const float alpha, const void *X, const CBLAS_INT incX, void *A)
Definition cblas_chpr.c:12
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
#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: