LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
void F77_chpr2 ( int *  layout,
char *  uplow,
int *  n,
CBLAS_TEST_COMPLEX alpha,
CBLAS_TEST_COMPLEX x,
int *  incx,
CBLAS_TEST_COMPLEX y,
int *  incy,
CBLAS_TEST_COMPLEX ap 
)

Definition at line 666 of file c_cblas2.c.

668  {
669  CBLAS_TEST_COMPLEX *A, *AP;
670  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 }
void cblas_chpr2(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, const int N, const void *alpha, const void *X, const int incX, const void *Y, const int incY, void *Ap)
Definition: cblas_chpr2.c:12
#define LDA
Definition: example_user.c:12
#define UNDEFINED
Definition: cblas_test.h:19
#define TEST_COL_MJR
Definition: cblas_test.h:16
CBLAS_UPLO
Definition: cblas.h:21
void get_uplo_type(char *type, CBLAS_UPLO *uplo)
Definition: auxiliary.c:18
#define TEST_ROW_MJR
Definition: cblas_test.h:12

Here is the call graph for this function: