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

◆ F77_sspr()

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

Definition at line 478 of file c_sblas2.c.

479 {
480 float *A, *AP;
481 CBLAS_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}
CBLAS_UPLO
Definition cblas.h:41
@ CblasUpper
Definition cblas.h:41
void cblas_sspr(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, const CBLAS_INT N, const float alpha, const float *X, const CBLAS_INT incX, float *Ap)
Definition cblas_sspr.c:12
@ CblasColMajor
Definition cblas.h:39
@ CblasRowMajor
Definition cblas.h:39
#define CBLAS_INT
Definition cblas.h:24
#define TEST_ROW_MJR
Definition cblas_test.h:12
void get_uplo_type(char *type, CBLAS_UPLO *uplo)
Definition auxiliary.c:18
Here is the call graph for this function: