534 {
535 double *A, *AP;
538
540
542 LDA = *n;
543 A = ( double* )malloc( LDA*LDA*sizeof( double ) );
544 AP = ( double* )malloc( (((LDA+1)*LDA)/2)*sizeof( double ) );
546 for( j=0, k=0; j<*n; j++ )
547 for( i=0; i<j+1; i++, k++ )
548 A[ LDA*i+j ]=ap[ k ];
549 for( i=0, k=0; i<*n; i++ )
550 for( j=i; j<*n; j++, k++ )
551 AP[ k ]=A[ LDA*i+j ];
552 }
553 else {
554 for( j=0, k=0; j<*n; j++ )
555 for( i=j; i<*n; i++, k++ )
556 A[ LDA*i+j ]=ap[ k ];
557 for( i=0, k=0; i<*n; i++ )
558 for( j=0; j<i+1; j++, k++ )
559 AP[ k ]=A[ LDA*i+j ];
560 }
563 for( i=0, k=0; i<*n; i++ )
564 for( j=i; j<*n; j++, k++ )
565 A[ LDA*i+j ]=AP[ k ];
566 for( j=0, k=0; j<*n; j++ )
567 for( i=0; i<j+1; i++, k++ )
568 ap[ k ]=A[ LDA*i+j ];
569 }
570 else {
571 for( i=0, k=0; i<*n; i++ )
572 for( j=0; j<i+1; j++, k++ )
573 A[ LDA*i+j ]=AP[ k ];
574 for( j=0, k=0; j<*n; j++ )
575 for( i=j; i<*n; i++, k++ )
576 ap[ k ]=A[ LDA*i+j ];
577 }
578 free(A);
579 free(AP);
580 }
581 else
583}
void cblas_dspr2(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT incX, const double *Y, const CBLAS_INT incY, double *A)
void get_uplo_type(char *type, CBLAS_UPLO *uplo)