GEMM[tsa,tsb,α,a,b,β,c]
computes the matrix-matrix multiplication α optsa[a].optsb[b]+β c and resets c to the result.
GEMM
GEMM[tsa,tsb,α,a,b,β,c]
computes the matrix-matrix multiplication α optsa[a].optsb[b]+β c and resets c to the result.
更多信息和选项
- To use GEMM, you first need to load the BLAS Package using Needs["LinearAlgebra`BLAS`"].
- The following arguments must be given:
-
tsa input string transposition string for a tsb input string transposition string for b α input expression scalar mutliple a input expression rectangular matrix b input expression rectangular matrix β input expression scalar multiple c input/output symbol rectangular matrix; the symbol value is modified in place - The transposition strings describing the operators optsa and optsb and may be specified as:
-
"N" no transposition "T" transpose "C" conjugate transpose - Dimensions of the matrix arguments must be such that the dot product and addition are well defined.
范例
打开所有单元 关闭所有单元基本范例 (1)
Needs["LinearAlgebra`BLAS`"]Compute Transpose[a].b+2 c and save it in c:
c = {{0, 2}, {2, -4}};
a = {{1, 3}, {2, 4}};
b = {{-1, 2}, {2, -1}};
GEMM["T", "N", 1, a, b, 2, c];
cScope (4)
c = {{2.3, 1.2}, {3.7, 1.5}};
a = {{-2.1, 0}, {1.4, 2.4}};
b = {{0, 1.2}, {-1.3, 4.6}};
GEMM["N", "N", 2, a, b, 1, c];
cc = {{2.3 + 3.I, 1.2 I}, {-3. + 2.I, 4.1}};
a = {{2.1, 1.4 I}, {3.5 I, 0.4 + I}};
b = {{0, 1.2}, {-1.3 - 2.I, -1.0}};
GEMM["N", "C", 2I, a, b, 1, c];
cc = {{0, 2`20}, {2`20, -4}};
a = {{1, 3}, {2, 4}};
b = {{-1, 2}, {2, -1}};
GEMM["T", "N", 1, a, b, 2, c];
cClear[c1, c2];
c = {{c1}, {c2}};
a = {{a11, a12}, {a21, a22}};
b = {{b1}, {b2}};
GEMM["N", "N", α, a, b, β, c];
cProperties & Relations (3)
GEMM["N","N",α,a,b,β,c] is equivalent to c=α a.b+β c:
c = c1 = RandomReal[1, {4, 5}];
a = RandomReal[1, {4, 4}];
b = RandomReal[1, {4, 5}];
GEMM["N", "N", 3, a, b, -2, c];
c == 3 a.b - 2 c1GEMM["T","N",α,a,b,β,b] is equivalent to c=α Transpose[a].b+β c:
c = c1 = RandomReal[1, {4, 5}];
a = RandomReal[1, {4, 4}];
b = RandomReal[1, {4, 5}];
GEMM["T", "N", 3, a, b, -2, c];
c == 3 Transpose[a].b - 2 c1GEMM["C","T",α,a,b,β,b] is equivalent to c=α ConjugateTranspose[a].Transpose[b]+β c:
c = c1 = RandomComplex[1 + I, {4, 5}];
a = RandomComplex[1 + I, {4, 4}];
b = RandomComplex[1 + I, {5, 4}];
GEMM["C", "T", 3 + 2I, a, b, -2 + I, c];
c == (3 + 2I) ConjugateTranspose[a].Transpose[b] + (-2 + I) c1Possible Issues (2)
The last argument must be a symbol:
a = {{1, 3}, {2, 4}};
b = {{1, 2}, {1, 2}};
GEMM["N", "N", 1, a, b, 2, {{2, 3}, {0, 1}}]The last argument must be initialized to a matrix:
Clear[c];
a = {{1, 3}, {2, 4}};
b = {{1, 2}, {1, 2}};
GEMM["N", "N", 1, a, b, 2, c]文本
Wolfram Research (2017),GEMM,Wolfram 语言函数,https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/GEMM.html.
CMS
Wolfram 语言. 2017. "GEMM." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/GEMM.html.
APA
Wolfram 语言. (2017). GEMM. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/GEMM.html 年
BibTeX
@misc{reference.wolfram_2026_gemm, author="Wolfram Research", title="{GEMM}", year="2017", howpublished="\url{https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/GEMM.html}", note=[Accessed: 09-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_gemm, organization={Wolfram Research}, title={GEMM}, year={2017}, url={https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/GEMM.html}, note=[Accessed: 09-August-2026]}