我想将矩阵乘以 D*W',其中 W' 是 W 的转置版本。
虽然我将使用 DGEMM,但我在 @IanBush 的帮助下发现,这种情况下的 LDB 应该是矩阵 W 的行数而不是列数。本例的代码是
Call dgemm('n', 't', N1, M1, N1, 1.0_wp, D, N1, W, M1, 0.0_wp, c, n1)
Run Code Online (Sandbox Code Playgroud)
其中 n1 和 m1 是我的矩阵的维度
Dimensions of the matrices:
W = M1*N1
D = N1*N1
Run Code Online (Sandbox Code Playgroud)
正如官方文档中所说
LDB is INTEGER
On entry, LDB specifies the first dimension of B as declared
in the calling (sub) program. When TRANSB = 'N' or 'n' then
LDB must be at least max( 1, k ), otherwise …Run Code Online (Sandbox Code Playgroud)