535 {
536 float *A, *AP;
539
541
543 LDA = *n;
544 A = ( float* )malloc( LDA*LDA*sizeof( float ) );
545 AP = ( float* )malloc( (((LDA+1)*LDA)/2)*sizeof( float ) );
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 }
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
583}
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)
void get_uplo_type(char *type, CBLAS_UPLO *uplo)