LAPACK  3.10.1 LAPACK: Linear Algebra PACKage

## ◆ F77_dgemm()

 void F77_dgemm ( int * layout, char * transpa, char * transpb, int * m, int * n, int * k, double * alpha, double * a, int * lda, double * b, int * ldb, double * beta, double * c, int * ldc )

Definition at line 14 of file c_dblas3.c.

16  {
17
18  double *A, *B, *C;
19  int i,j,LDA, LDB, LDC;
20  CBLAS_TRANSPOSE transa, transb;
21
22  get_transpose_type(transpa, &transa);
23  get_transpose_type(transpb, &transb);
24
25  if (*layout == TEST_ROW_MJR) {
26  if (transa == CblasNoTrans) {
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  }
40  if (transb == CblasNoTrans) {
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
60  cblas_dgemm( CblasRowMajor, transa, transb, *m, *n, *k, *alpha, A, LDA,
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  }
69  else if (*layout == TEST_COL_MJR)
70  cblas_dgemm( CblasColMajor, transa, transb, *m, *n, *k, *alpha, a, *lda,
71  b, *ldb, *beta, c, *ldc );
72  else
73  cblas_dgemm( UNDEFINED, transa, transb, *m, *n, *k, *alpha, a, *lda,
74  b, *ldb, *beta, c, *ldc );
75 }
#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_TRANSPOSE
Definition: cblas.h:28
@ CblasNoTrans
Definition: cblas.h:28
@ CblasColMajor
Definition: cblas.h:27
@ CblasRowMajor
Definition: cblas.h:27
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)
Definition: cblas_dgemm.c:12
void get_transpose_type(char *type, CBLAS_TRANSPOSE *trans)
Definition: auxiliary.c:8
#define LDB
Definition: example_user.c:13
#define LDA
Definition: example_user.c:12
Here is the call graph for this function:
Here is the caller graph for this function: