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

Definition at line 481 of file c_dblas2.c.

482  {
483  double *A, *AP;
484  int i,j,k,LDA;
485  CBLAS_UPLO uplo;
486 
487  get_uplo_type(uplow,&uplo);
488 
489  if (*layout == TEST_ROW_MJR) {
490  LDA = *n;
491  A = ( double* )malloc( LDA*LDA*sizeof( double ) );
492  AP = ( double* )malloc( (((LDA+1)*LDA)/2)*sizeof( double ) );
493  if (uplo == CblasUpper) {
494  for( j=0, k=0; j<*n; j++ )
495  for( i=0; i<j+1; i++, k++ )
496  A[ LDA*i+j ]=ap[ k ];
497  for( i=0, k=0; i<*n; i++ )
498  for( j=i; j<*n; j++, k++ )
499  AP[ k ]=A[ LDA*i+j ];
500  }
501  else {
502  for( j=0, k=0; j<*n; j++ )
503  for( i=j; i<*n; i++, k++ )
504  A[ LDA*i+j ]=ap[ k ];
505  for( i=0, k=0; i<*n; i++ )
506  for( j=0; j<i+1; j++, k++ )
507  AP[ k ]=A[ LDA*i+j ];
508  }
509  cblas_dspr( CblasRowMajor, uplo, *n, *alpha, x, *incx, AP );
510  if (uplo == CblasUpper) {
511  for( i=0, k=0; i<*n; i++ )
512  for( j=i; j<*n; j++, k++ )
513  A[ LDA*i+j ]=AP[ k ];
514  for( j=0, k=0; j<*n; j++ )
515  for( i=0; i<j+1; i++, k++ )
516  ap[ k ]=A[ LDA*i+j ];
517  }
518  else {
519  for( i=0, k=0; i<*n; i++ )
520  for( j=0; j<i+1; j++, k++ )
521  A[ LDA*i+j ]=AP[ k ];
522  for( j=0, k=0; j<*n; j++ )
523  for( i=j; i<*n; i++, k++ )
524  ap[ k ]=A[ LDA*i+j ];
525  }
526  free(A);
527  free(AP);
528  }
529  else
530  cblas_dspr( CblasColMajor, uplo, *n, *alpha, x, *incx, ap );
531 }
void cblas_dspr(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, const int N, const double alpha, const double *X, const int incX, double *Ap)
Definition: cblas_dspr.c:12
#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: