LAPACK 3.12.1
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 530 of file c_sblas2.c.

535 {
536 float *A, *AP;
537 CBLAS_INT i,j,k,LDA;
538 CBLAS_UPLO uplo;
539
540 get_uplo_type(uplow,&uplo);
541
542 if (*layout == TEST_ROW_MJR) {
543 LDA = *n;
544 A = ( float* )malloc( LDA*LDA*sizeof( float ) );
545 AP = ( float* )malloc( (((LDA+1)*LDA)/2)*sizeof( float ) );
546 if (uplo == CblasUpper) {
547 for( j=0, k=0; j<*n; j++ )
548 for( i=0; i<j+1; i++, k++ )
549 A[ LDA*i+j ]=ap[ k ];
550 for( i=0, k=0; i<*n; i++ )
551 for( j=i; j<*n; j++, k++ )
552 AP[ k ]=A[ LDA*i+j ];
553 }
554 else {
555 for( j=0, k=0; j<*n; j++ )
556 for( i=j; i<*n; i++, k++ )
557 A[ LDA*i+j ]=ap[ k ];
558 for( i=0, k=0; i<*n; i++ )
559 for( j=0; j<i+1; j++, k++ )
560 AP[ k ]=A[ LDA*i+j ];
561 }
562 cblas_sspr( CblasRowMajor, uplo, *n, *alpha, x, *incx, AP );
563 if (uplo == CblasUpper) {
564 for( i=0, k=0; i<*n; i++ )
565 for( j=i; j<*n; j++, k++ )
566 A[ LDA*i+j ]=AP[ k ];
567 for( j=0, k=0; j<*n; j++ )
568 for( i=0; i<j+1; i++, k++ )
569 ap[ k ]=A[ LDA*i+j ];
570 }
571 else {
572 for( i=0, k=0; i<*n; i++ )
573 for( j=0; j<i+1; j++, k++ )
574 A[ LDA*i+j ]=AP[ k ];
575 for( j=0, k=0; j<*n; j++ )
576 for( i=j; i<*n; i++, k++ )
577 ap[ k ]=A[ LDA*i+j ];
578 }
579 free(A); free(AP);
580 }
581 else
582 cblas_sspr( CblasColMajor, uplo, *n, *alpha, x, *incx, ap );
583}
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:21
void get_uplo_type(char *type, CBLAS_UPLO *uplo)
Definition auxiliary.c:18
Here is the call graph for this function: