16 {
17
18 double *A, *B, *C;
21
24
27 LDA = *k+1;
28 A = (double *)malloc( (*m)*LDA*sizeof( double ) );
29 for( i=0; i<*m; i++ )
30 for( j=0; j<*k; j++ )
31 A[i*LDA+j]=a[j*(*lda)+i];
32 }
33 else {
34 LDA = *m+1;
35 A = ( double* )malloc( LDA*(*k)*sizeof( double ) );
36 for( i=0; i<*k; i++ )
37 for( j=0; j<*m; j++ )
38 A[i*LDA+j]=a[j*(*lda)+i];
39 }
41 LDB = *n+1;
42 B = ( double* )malloc( (*k)*LDB*sizeof( double ) );
43 for( i=0; i<*k; i++ )
44 for( j=0; j<*n; j++ )
45 B[i*LDB+j]=b[j*(*ldb)+i];
46 }
47 else {
48 LDB = *k+1;
49 B = ( double* )malloc( LDB*(*n)*sizeof( double ) );
50 for( i=0; i<*n; i++ )
51 for( j=0; j<*k; j++ )
52 B[i*LDB+j]=b[j*(*ldb)+i];
53 }
54 LDC = *n+1;
55 C = ( double* )malloc( (*m)*LDC*sizeof( double ) );
56 for( j=0; j<*n; j++ )
57 for( i=0; i<*m; i++ )
58 C[i*LDC+j]=c[j*(*ldc)+i];
59
61 B, LDB, *beta, C, LDC );
62 for( j=0; j<*n; j++ )
63 for( i=0; i<*m; i++ )
64 c[j*(*ldc)+i]=C[i*LDC+j];
65 free(A);
66 free(B);
67 free(C);
68 }
71 b, *ldb, *beta, c, *ldc );
72 else
74 b, *ldb, *beta, c, *ldc );
75}
void cblas_dgemm(CBLAS_LAYOUT layout, CBLAS_TRANSPOSE TransA, CBLAS_TRANSPOSE TransB, const CBLAS_INT M, 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_transpose_type(char *type, CBLAS_TRANSPOSE *trans)