如何进行矩阵乘法? [英] How to do matrix multiplication?
本文介绍了如何进行矩阵乘法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用c ++或c#中的矩阵和向量?如何设置n乘m的矩阵,就像在matlab中我们说A = M * N,需要什么名称空间或库?
How to work with matrices and vectors in c++ or c#? How to set matrices of n by m, simply as in matlab that we say A=M*N, what are the needed namespaces or libraries?
推荐答案
希望这些链接帮助你...
矩阵分解 [ ^ ]
C#矩阵库 [ ^ ]
矩阵乘法 [ ^ ]
问候
Hope these links helps you...
Matrix Decomposition[^]
C# Matrix Library[^]
Matrix multiplication[^]
Regards
请看我对这个问题的评论。
首先,矩阵乘法是相当微不足道的数学运算。请参阅,例如: http://en.wikipedia.org/wiki/Matrix_multiplication [ ^ ]。
要编码它只是根据定义行事。
现在,您可以定义适当的运算符'*',并且使用与您的A = M *完全相同N
样本。这就是您所需要的:
http://en.wikipedia.org/wiki/Operator_overloading [ ^ ];
C ++:
http://www.learncpp.com/cpp-教程/ 91-介绍 - 运算符重载 [ ^ ],
http://www.learncpp.com/cpp-tutorial/92-overloading-the-arithmetic-operators [ ^ ],
http://en.wikibooks .org / wiki / C ++ _ Programming / Operators / Operator_Overloading [ ^ ],
C#:
http://msdn.microsoft.com/en-us/library/8edha89s.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/aa288467%28v=vs.71%29.aspx [< a href =http://msdn.microsoft.com/en-us/library/aa288467%28v=vs.71%29.aspxtarget =_ blanktitle =New Window> ^ ] (旧但很有用)。
-SA
Please see my comment to the question.
First, matrix multiplication is quite a trivial mathematical operation. Please see, for example: http://en.wikipedia.org/wiki/Matrix_multiplication[^].
To code it, just act by definition.
Now, you can define appropriate operator '*' and use is exactly like in yourA=M*N
sample. This is all you need:
http://en.wikipedia.org/wiki/Operator_overloading[^];
C++:
http://www.learncpp.com/cpp-tutorial/91-introduction-to-operator-overloading[^],
http://www.learncpp.com/cpp-tutorial/92-overloading-the-arithmetic-operators[^],
http://en.wikibooks.org/wiki/C++_Programming/Operators/Operator_Overloading[^],
C#:
http://msdn.microsoft.com/en-us/library/8edha89s.aspx[^],
http://msdn.microsoft.com/en-us/library/aa288467%28v=vs.71%29.aspx[^] (old but quite usable).
—SA
这篇关于如何进行矩阵乘法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文