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

## ◆ F77_dspr()

 void F77_dspr ( CBLAS_INT * layout, char * uplow, CBLAS_INT * n, double * alpha, double * x, CBLAS_INT * incx, double * ap )

Definition at line 481 of file c_dblas2.c.

482 {
483 double *A, *AP;
484 CBLAS_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}
CBLAS_UPLO
Definition cblas.h:41
@ CblasUpper
Definition cblas.h:41
void cblas_dspr(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT incX, double *Ap)
Definition cblas_dspr.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: