LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
void F77_cgemm ( int *  layout,
char *  transpa,
char *  transpb,
int *  m,
int *  n,
int *  k,
CBLAS_TEST_COMPLEX alpha,
CBLAS_TEST_COMPLEX a,
int *  lda,
CBLAS_TEST_COMPLEX b,
int *  ldb,
CBLAS_TEST_COMPLEX beta,
CBLAS_TEST_COMPLEX c,
int *  ldc 
)

Definition at line 14 of file c_cblas3.c.

17  {
18 
19  CBLAS_TEST_COMPLEX *A, *B, *C;
20  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 }
void get_transpose_type(char *type, CBLAS_TRANSPOSE *trans)
Definition: auxiliary.c:8
#define UNDEFINED
Definition: c_cblas3.c:12
#define TEST_COL_MJR
Definition: c_cblas3.c:10
#define LDB
Definition: example_user.c:13
void cblas_cgemm(CBLAS_LAYOUT layout, CBLAS_TRANSPOSE TransA, CBLAS_TRANSPOSE TransB, const int M, const int N, const int K, const void *alpha, const void *A, const int lda, const void *B, const int ldb, const void *beta, void *C, const int ldc)
Definition: cblas_cgemm.c:12
CBLAS_TRANSPOSE
Definition: cblas.h:20
#define LDA
Definition: example_user.c:12
#define TEST_ROW_MJR
Definition: c_cblas3.c:11

Here is the call graph for this function: