LAPACK  3.10.0
LAPACK: Linear Algebra PACKage

◆ F77_sspr()

void F77_sspr ( int *  layout,
char *  uplow,
int *  n,
float *  alpha,
float *  x,
int *  incx,
float *  ap 
)

Definition at line 478 of file c_sblas2.c.

479  {
480  float *A, *AP;
481  int i,j,k,LDA;
482  CBLAS_UPLO uplo;
483 
484  get_uplo_type(uplow,&uplo);
485 
486  if (*layout == TEST_ROW_MJR) {
487  LDA = *n;
488  A = ( float* )malloc( LDA*LDA*sizeof( float ) );
489  AP = ( float* )malloc( (((LDA+1)*LDA)/2)*sizeof( float ) );
490  if (uplo == CblasUpper) {
491  for( j=0, k=0; j<*n; j++ )
492  for( i=0; i<j+1; i++, k++ )
493  A[ LDA*i+j ]=ap[ k ];
494  for( i=0, k=0; i<*n; i++ )
495  for( j=i; j<*n; j++, k++ )
496  AP[ k ]=A[ LDA*i+j ];
497  }
498  else {
499  for( j=0, k=0; j<*n; j++ )
500  for( i=j; i<*n; i++, k++ )
501  A[ LDA*i+j ]=ap[ k ];
502  for( i=0, k=0; i<*n; i++ )
503  for( j=0; j<i+1; j++, k++ )
504  AP[ k ]=A[ LDA*i+j ];
505  }
506  cblas_sspr( CblasRowMajor, uplo, *n, *alpha, x, *incx, AP );
507  if (uplo == CblasUpper) {
508  for( i=0, k=0; i<*n; i++ )
509  for( j=i; j<*n; j++, k++ )
510  A[ LDA*i+j ]=AP[ k ];
511  for( j=0, k=0; j<*n; j++ )
512  for( i=0; i<j+1; i++, k++ )
513  ap[ k ]=A[ LDA*i+j ];
514  }
515  else {
516  for( i=0, k=0; i<*n; i++ )
517  for( j=0; j<i+1; j++, k++ )
518  A[ LDA*i+j ]=AP[ k ];
519  for( j=0, k=0; j<*n; j++ )
520  for( i=j; i<*n; i++, k++ )
521  ap[ k ]=A[ LDA*i+j ];
522  }
523  free(A); free(AP);
524  }
525  else
526  cblas_sspr( CblasColMajor, uplo, *n, *alpha, x, *incx, ap );
527 }
void cblas_sspr(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, const CBLAS_INDEX N, const float alpha, const float *X, const CBLAS_INDEX incX, float *Ap)
Definition: cblas_sspr.c:12
CBLAS_UPLO
Definition: cblas.h:21
@ CblasUpper
Definition: cblas.h:21
@ CblasColMajor
Definition: cblas.h:19
@ CblasRowMajor
Definition: cblas.h:19
#define TEST_ROW_MJR
Definition: cblas_test.h:12
void get_uplo_type(char *type, CBLAS_UPLO *uplo)
Definition: auxiliary.c:18
#define LDA
Definition: example_user.c:12
Here is the call graph for this function:
Here is the caller graph for this function: