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

◆ F77_zgemm()

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

Definition at line 15 of file c_zblas3.c.

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