35 #include <qpOASES/Utils.hpp> 38 extern "C" void dgemm_(
const char *TRANSA,
const char *TRANSB,
39 const unsigned long *
M,
const unsigned long *
N,
const unsigned long *K,
40 const double *ALPHA,
const double *
A,
const unsigned long *LDA,
const double *B,
const unsigned long *LDB,
41 const double *BETA,
double *C,
const unsigned long *LDC
44 unsigned long i, j, k;
47 for (k = 0; k < *
N; k++)
48 for (j = 0; j < *
M; j++)
51 for (k = 0; k < *
N; k++)
52 for (j = 0; j < *
M; j++)
53 C[j+(*LDC)*k] = -C[j+(*LDC)*k];
55 for (k = 0; k < *
N; k++)
56 for (j = 0; j < *
M; j++)
57 C[j+(*LDC)*k] *= *BETA;
61 for (k = 0; k < *
N; k++)
62 for (j = 0; j < *
M; j++)
63 for (i = 0; i < *K; i++)
64 C[j+(*LDC)*k] += A[j+(*LDA)*i] * B[i+(*LDB)*k];
66 for (k = 0; k < *
N; k++)
67 for (j = 0; j < *
M; j++)
68 for (i = 0; i < *K; i++)
69 C[j+(*LDC)*k] -= A[j+(*LDA)*i] * B[i+(*LDB)*k];
71 for (k = 0; k < *
N; k++)
72 for (j = 0; j < *
M; j++)
73 for (i = 0; i < *K; i++)
74 C[j+(*LDC)*k] += *ALPHA * A[j+(*LDA)*i] * B[i+(*LDB)*k];
77 for (k = 0; k < *
N; k++)
78 for (j = 0; j < *
M; j++)
79 for (i = 0; i < *K; i++)
80 C[j+(*LDC)*k] += A[i+(*LDA)*j] * B[i+(*LDB)*k];
82 for (k = 0; k < *
N; k++)
83 for (j = 0; j < *
M; j++)
84 for (i = 0; i < *K; i++)
85 C[j+(*LDC)*k] -= A[i+(*LDA)*j] * B[i+(*LDB)*k];
87 for (k = 0; k < *
N; k++)
88 for (j = 0; j < *
M; j++)
89 for (i = 0; i < *K; i++)
90 C[j+(*LDC)*k] += *ALPHA * A[i+(*LDA)*j] * B[i+(*LDB)*k];
93 extern "C" void sgemm_(
const char *TRANSA,
const char *TRANSB,
94 const unsigned long *
M,
const unsigned long *
N,
const unsigned long *K,
95 const float *ALPHA,
const float *
A,
const unsigned long *LDA,
const float *B,
const unsigned long *LDB,
96 const float *BETA,
float *C,
const unsigned long *LDC
99 unsigned long i, j, k;
102 for (k = 0; k < *
N; k++)
103 for (j = 0; j < *
M; j++)
106 for (k = 0; k < *
N; k++)
107 for (j = 0; j < *
M; j++)
108 C[j+(*LDC)*k] = -C[j+(*LDC)*k];
110 for (k = 0; k < *
N; k++)
111 for (j = 0; j < *
M; j++)
112 C[j+(*LDC)*k] *= *BETA;
114 if (TRANSA[0] ==
'N')
116 for (k = 0; k < *
N; k++)
117 for (j = 0; j < *
M; j++)
118 for (i = 0; i < *K; i++)
119 C[j+(*LDC)*k] += A[j+(*LDA)*i] * B[i+(*LDB)*k];
121 for (k = 0; k < *
N; k++)
122 for (j = 0; j < *
M; j++)
123 for (i = 0; i < *K; i++)
124 C[j+(*LDC)*k] -= A[j+(*LDA)*i] * B[i+(*LDB)*k];
126 for (k = 0; k < *
N; k++)
127 for (j = 0; j < *
M; j++)
128 for (i = 0; i < *K; i++)
129 C[j+(*LDC)*k] += *ALPHA * A[j+(*LDA)*i] * B[i+(*LDB)*k];
132 for (k = 0; k < *
N; k++)
133 for (j = 0; j < *
M; j++)
134 for (i = 0; i < *K; i++)
135 C[j+(*LDC)*k] += A[i+(*LDA)*j] * B[i+(*LDB)*k];
137 for (k = 0; k < *
N; k++)
138 for (j = 0; j < *
M; j++)
139 for (i = 0; i < *K; i++)
140 C[j+(*LDC)*k] -= A[i+(*LDA)*j] * B[i+(*LDB)*k];
142 for (k = 0; k < *
N; k++)
143 for (j = 0; j < *
M; j++)
144 for (i = 0; i < *K; i++)
145 C[j+(*LDC)*k] += *ALPHA * A[i+(*LDA)*j] * B[i+(*LDB)*k];
BooleanType isZero(real_t x, real_t TOL=ZERO)
void sgemm_(const char *TRANSA, const char *TRANSB, const unsigned long *M, const unsigned long *N, const unsigned long *K, const float *ALPHA, const float *A, const unsigned long *LDA, const float *B, const unsigned long *LDB, const float *BETA, float *C, const unsigned long *LDC)
BooleanType isEqual(real_t x, real_t y, real_t TOL=ZERO)
#define REFER_NAMESPACE_QPOASES
void dgemm_(const char *TRANSA, const char *TRANSB, const unsigned long *M, const unsigned long *N, const unsigned long *K, const double *ALPHA, const double *A, const unsigned long *LDA, const double *B, const unsigned long *LDB, const double *BETA, double *C, const unsigned long *LDC)