您可以使用DGEMM进行操作,但是使用DGER在风格上是正确的,这是专用的外部产品实现。因此,它更容易正确使用:
cblas_dger(CblasRowMajor, /* you’re using row-major storage */
dx1, /* the matrix X has dx1 rows ... */
dx2, /* ... and dx2 columns. */
1.0, /* scale factor to apply to x1x2' */
x1,
1, /* stride between elements of x1. */
x2,
1, /* stride between elements of x2. */
X,
dx2); /* leading dimension of matrix X. */
DGEMM 做 拥有一个不错的功能 \beta = 0
为您初始化结果矩阵,从而使您免于需要在通话之前明确归零。 @Artem Shinkarov的答案提供了有关如何使用DGEMM的很好描述。