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

◆ F77_sspr2()

void F77_sspr2 ( CBLAS_INT layout,
char *  uplow,
CBLAS_INT n,
float *  alpha,
float *  x,
CBLAS_INT incx,
float *  y,
CBLAS_INT incy,
float *  ap 
)

Definition at line 529 of file c_sblas2.c.

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