530 {
531 float *A, *AP;
534
536
538 LDA = *n;
539 A = ( float* )malloc( LDA*LDA*sizeof( float ) );
540 AP = ( float* )malloc( (((LDA+1)*LDA)/2)*sizeof( float ) );
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 }
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
579}
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)
void get_uplo_type(char *type, CBLAS_UPLO *uplo)