482 {
483 double *A, *AP;
486
488
490 LDA = *n;
491 A = ( double* )malloc( LDA*LDA*sizeof( double ) );
492 AP = ( double* )malloc( (((LDA+1)*LDA)/2)*sizeof( double ) );
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 }
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
531}
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)
void get_uplo_type(char *type, CBLAS_UPLO *uplo)