LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ F77_dsyr2k()

void F77_dsyr2k ( CBLAS_INT * layout,
char * uplow,
char * transp,
CBLAS_INT * n,
CBLAS_INT * k,
double * alpha,
double * a,
CBLAS_INT * lda,
double * b,
CBLAS_INT * ldb,
double * beta,
double * c,
CBLAS_INT * ldc )

Definition at line 269 of file c_dblas3.c.

275 {
276 CBLAS_INT i,j,LDA,LDB,LDC;
277 double *A, *B, *C;
278 CBLAS_UPLO uplo;
279 CBLAS_TRANSPOSE trans;
280
281 get_uplo_type(uplow,&uplo);
282 get_transpose_type(transp,&trans);
283
284 if (*layout == TEST_ROW_MJR) {
285 if (trans == CblasNoTrans) {
286 LDA = *k+1;
287 LDB = *k+1;
288 A = ( double* )malloc( (*n)*LDA*sizeof( double ) );
289 B = ( double* )malloc( (*n)*LDB*sizeof( double ) );
290 for( i=0; i<*n; i++ )
291 for( j=0; j<*k; j++ ) {
292 A[i*LDA+j]=a[j*(*lda)+i];
293 B[i*LDB+j]=b[j*(*ldb)+i];
294 }
295 }
296 else {
297 LDA = *n+1;
298 LDB = *n+1;
299 A = ( double* )malloc( LDA*(*k)*sizeof( double ) );
300 B = ( double* )malloc( LDB*(*k)*sizeof( double ) );
301 for( i=0; i<*k; i++ )
302 for( j=0; j<*n; j++ ){
303 A[i*LDA+j]=a[j*(*lda)+i];
304 B[i*LDB+j]=b[j*(*ldb)+i];
305 }
306 }
307 LDC = *n+1;
308 C = ( double* )malloc( (*n)*LDC*sizeof( double ) );
309 for( i=0; i<*n; i++ )
310 for( j=0; j<*n; j++ )
311 C[i*LDC+j]=c[j*(*ldc)+i];
312 cblas_dsyr2k(CblasRowMajor, uplo, trans, *n, *k, *alpha, A, LDA,
313 B, LDB, *beta, C, LDC );
314 for( j=0; j<*n; j++ )
315 for( i=0; i<*n; i++ )
316 c[j*(*ldc)+i]=C[i*LDC+j];
317 free(A);
318 free(B);
319 free(C);
320 }
321 else if (*layout == TEST_COL_MJR)
322 cblas_dsyr2k(CblasColMajor, uplo, trans, *n, *k, *alpha, a, *lda,
323 b, *ldb, *beta, c, *ldc );
324 else
325 cblas_dsyr2k(UNDEFINED, uplo, trans, *n, *k, *alpha, a, *lda,
326 b, *ldb, *beta, c, *ldc );
327}
#define UNDEFINED
Definition c_dblas3.c:12
#define TEST_ROW_MJR
Definition c_dblas3.c:11
#define TEST_COL_MJR
Definition c_dblas3.c:10
CBLAS_UPLO
Definition cblas.h:41
CBLAS_TRANSPOSE
Definition cblas.h:40
@ CblasNoTrans
Definition cblas.h:40
@ CblasColMajor
Definition cblas.h:39
@ CblasRowMajor
Definition cblas.h:39
#define CBLAS_INT
Definition cblas.h:24
void cblas_dsyr2k(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, CBLAS_TRANSPOSE Trans, const CBLAS_INT N, const CBLAS_INT K, const double alpha, const double *A, const CBLAS_INT lda, const double *B, const CBLAS_INT ldb, const double beta, double *C, const CBLAS_INT ldc)
void get_uplo_type(char *type, CBLAS_UPLO *uplo)
Definition auxiliary.c:18
void get_transpose_type(char *type, CBLAS_TRANSPOSE *trans)
Definition auxiliary.c:8
Here is the call graph for this function: