479 {
480 float *A, *AP;
483
485
487 LDA = *n;
488 A = ( float* )malloc( LDA*LDA*sizeof( float ) );
489 AP = ( float* )malloc( (((LDA+1)*LDA)/2)*sizeof( float ) );
491 for( j=0, k=0; j<*n; j++ )
492 for( i=0; i<j+1; i++, k++ )
493 A[ LDA*i+j ]=ap[ k ];
494 for( i=0, k=0; i<*n; i++ )
495 for( j=i; j<*n; j++, k++ )
496 AP[ k ]=A[ LDA*i+j ];
497 }
498 else {
499 for( j=0, k=0; j<*n; j++ )
500 for( i=j; i<*n; i++, k++ )
501 A[ LDA*i+j ]=ap[ k ];
502 for( i=0, k=0; i<*n; i++ )
503 for( j=0; j<i+1; j++, k++ )
504 AP[ k ]=A[ LDA*i+j ];
505 }
508 for( i=0, k=0; i<*n; i++ )
509 for( j=i; j<*n; j++, k++ )
510 A[ LDA*i+j ]=AP[ k ];
511 for( j=0, k=0; j<*n; j++ )
512 for( i=0; i<j+1; i++, k++ )
513 ap[ k ]=A[ LDA*i+j ];
514 }
515 else {
516 for( i=0, k=0; i<*n; i++ )
517 for( j=0; j<i+1; j++, k++ )
518 A[ LDA*i+j ]=AP[ k ];
519 for( j=0, k=0; j<*n; j++ )
520 for( i=j; i<*n; i++, k++ )
521 ap[ k ]=A[ LDA*i+j ];
522 }
523 free(A); free(AP);
524 }
525 else
527}
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)