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

Definition at line 533 of file c_dblas2.c.

534  {
535  double *A, *AP;
536  int i,j,k,LDA;
537  CBLAS_UPLO uplo;
538 
539  get_uplo_type(uplow,&uplo);
540 
541  if (*layout == TEST_ROW_MJR) {
542  LDA = *n;
543  A = ( double* )malloc( LDA*LDA*sizeof( double ) );
544  AP = ( double* )malloc( (((LDA+1)*LDA)/2)*sizeof( double ) );
545  if (uplo == CblasUpper) {
546  for( j=0, k=0; j<*n; j++ )
547  for( i=0; i<j+1; i++, k++ )
548  A[ LDA*i+j ]=ap[ k ];
549  for( i=0, k=0; i<*n; i++ )
550  for( j=i; j<*n; j++, k++ )
551  AP[ k ]=A[ LDA*i+j ];
552  }
553  else {
554  for( j=0, k=0; j<*n; j++ )
555  for( i=j; i<*n; i++, k++ )
556  A[ LDA*i+j ]=ap[ k ];
557  for( i=0, k=0; i<*n; i++ )
558  for( j=0; j<i+1; j++, k++ )
559  AP[ k ]=A[ LDA*i+j ];
560  }
561  cblas_dspr2( CblasRowMajor, uplo, *n, *alpha, x, *incx, y, *incy, AP );
562  if (uplo == CblasUpper) {
563  for( i=0, k=0; i<*n; i++ )
564  for( j=i; j<*n; j++, k++ )
565  A[ LDA*i+j ]=AP[ k ];
566  for( j=0, k=0; j<*n; j++ )
567  for( i=0; i<j+1; i++, k++ )
568  ap[ k ]=A[ LDA*i+j ];
569  }
570  else {
571  for( i=0, k=0; i<*n; i++ )
572  for( j=0; j<i+1; j++, k++ )
573  A[ LDA*i+j ]=AP[ k ];
574  for( j=0, k=0; j<*n; j++ )
575  for( i=j; i<*n; i++, k++ )
576  ap[ k ]=A[ LDA*i+j ];
577  }
578  free(A);
579  free(AP);
580  }
581  else
582  cblas_dspr2( CblasColMajor, uplo, *n, *alpha, x, *incx, y, *incy, ap );
583 }
void cblas_dspr2(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, const int N, const double alpha, const double *X, const int incX, const double *Y, const int incY, double *A)
Definition: cblas_dspr2.c:10
#define LDA
Definition: example_user.c:12
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: