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

◆ F77_cgemm()

void F77_cgemm ( CBLAS_INT layout,
char *  transpa,
char *  transpb,
CBLAS_INT m,
CBLAS_INT n,
CBLAS_INT k,
CBLAS_TEST_COMPLEX alpha,
CBLAS_TEST_COMPLEX a,
CBLAS_INT lda,
CBLAS_TEST_COMPLEX b,
CBLAS_INT ldb,
CBLAS_TEST_COMPLEX beta,
CBLAS_TEST_COMPLEX c,
CBLAS_INT ldc 
)

Definition at line 14 of file c_cblas3.c.

17 {
18
19 CBLAS_TEST_COMPLEX *A, *B, *C;
20 CBLAS_INT i,j,LDA, LDB, LDC;
21 CBLAS_TRANSPOSE transa, transb;
22
23 get_transpose_type(transpa, &transa);
24 get_transpose_type(transpb, &transb);
25
26 if (*layout == TEST_ROW_MJR) {
27 if (transa == CblasNoTrans) {
28 LDA = *k+1;
29 A=(CBLAS_TEST_COMPLEX*)malloc((*m)*LDA*sizeof(CBLAS_TEST_COMPLEX));
30 for( i=0; i<*m; i++ )
31 for( j=0; j<*k; j++ ) {
32 A[i*LDA+j].real=a[j*(*lda)+i].real;
33 A[i*LDA+j].imag=a[j*(*lda)+i].imag;
34 }
35 }
36 else {
37 LDA = *m+1;
38 A=(CBLAS_TEST_COMPLEX* )malloc(LDA*(*k)*sizeof(CBLAS_TEST_COMPLEX));
39 for( i=0; i<*k; i++ )
40 for( j=0; j<*m; j++ ) {
41 A[i*LDA+j].real=a[j*(*lda)+i].real;
42 A[i*LDA+j].imag=a[j*(*lda)+i].imag;
43 }
44 }
45
46 if (transb == CblasNoTrans) {
47 LDB = *n+1;
48 B=(CBLAS_TEST_COMPLEX* )malloc((*k)*LDB*sizeof(CBLAS_TEST_COMPLEX) );
49 for( i=0; i<*k; i++ )
50 for( j=0; j<*n; j++ ) {
51 B[i*LDB+j].real=b[j*(*ldb)+i].real;
52 B[i*LDB+j].imag=b[j*(*ldb)+i].imag;
53 }
54 }
55 else {
56 LDB = *k+1;
57 B=(CBLAS_TEST_COMPLEX* )malloc(LDB*(*n)*sizeof(CBLAS_TEST_COMPLEX));
58 for( i=0; i<*n; i++ )
59 for( j=0; j<*k; j++ ) {
60 B[i*LDB+j].real=b[j*(*ldb)+i].real;
61 B[i*LDB+j].imag=b[j*(*ldb)+i].imag;
62 }
63 }
64
65 LDC = *n+1;
66 C=(CBLAS_TEST_COMPLEX* )malloc((*m)*LDC*sizeof(CBLAS_TEST_COMPLEX));
67 for( j=0; j<*n; j++ )
68 for( i=0; i<*m; i++ ) {
69 C[i*LDC+j].real=c[j*(*ldc)+i].real;
70 C[i*LDC+j].imag=c[j*(*ldc)+i].imag;
71 }
72 cblas_cgemm( CblasRowMajor, transa, transb, *m, *n, *k, alpha, A, LDA,
73 B, LDB, beta, C, LDC );
74 for( j=0; j<*n; j++ )
75 for( i=0; i<*m; i++ ) {
76 c[j*(*ldc)+i].real=C[i*LDC+j].real;
77 c[j*(*ldc)+i].imag=C[i*LDC+j].imag;
78 }
79 free(A);
80 free(B);
81 free(C);
82 }
83 else if (*layout == TEST_COL_MJR)
84 cblas_cgemm( CblasColMajor, transa, transb, *m, *n, *k, alpha, a, *lda,
85 b, *ldb, beta, c, *ldc );
86 else
87 cblas_cgemm( UNDEFINED, transa, transb, *m, *n, *k, alpha, a, *lda,
88 b, *ldb, beta, c, *ldc );
89}
#define UNDEFINED
Definition c_cblas3.c:12
#define TEST_ROW_MJR
Definition c_cblas3.c:11
#define TEST_COL_MJR
Definition c_cblas3.c:10
CBLAS_TRANSPOSE
Definition cblas.h:40
@ CblasNoTrans
Definition cblas.h:40
@ CblasColMajor
Definition cblas.h:39
@ CblasRowMajor
Definition cblas.h:39
void cblas_cgemm(CBLAS_LAYOUT layout, CBLAS_TRANSPOSE TransA, CBLAS_TRANSPOSE TransB, const CBLAS_INT M, const CBLAS_INT N, const CBLAS_INT K, const void *alpha, const void *A, const CBLAS_INT lda, const void *B, const CBLAS_INT ldb, const void *beta, void *C, const CBLAS_INT ldc)
Definition cblas_cgemm.c:12
#define CBLAS_INT
Definition cblas.h:24
void get_transpose_type(char *type, CBLAS_TRANSPOSE *trans)
Definition auxiliary.c:8
Here is the call graph for this function: