【问题标题】:Matrix.Multiply in C#, how does it work?C# 中的 Matrix.Multiply,它是如何工作的?
【发布时间】:2017-01-24 09:08:44
【问题描述】:

所以,我在MSDN 上找到了一个关于它的文档,但我没有找到它是如何工作的,比如这个例子:

private void multiplicationExample()
{

    Matrix matrix1 = new Matrix(5, 10, 15, 20, 25, 30);
    Matrix matrix2 = new Matrix(2, 4, 6, 8, 10, 12);

    // matrixResult is equal to (70,100,150,220,240,352) 
    Matrix matrixResult = Matrix.Multiply(matrix1, matrix2);

    // matrixResult2 is also
    // equal to (70,100,150,220,240,352) 
    Matrix matrixResult2 = matrix1 * matrix2;
}

我的问题是,这个矩阵有什么维度?像 3x2 还是 2x3?如何在这种方法中读取 Matrix 结构?如何确定尺寸?

谢谢你。

【问题讨论】:

  • 请注意,System.Windows.Media.Matrix 是一种有限的数据类型,专为one special purpose 设计:“表示用于二维空间中的变换的 3x3 仿射变换矩阵。”如果您想执行一般数学矩阵计算,请搜索更合适的类型,可能在 .NET 框架之外。
  • 如果您按照文档中的相应链接获取更多信息,您将找到所有必要的信息。

标签: c# winforms matrix matrix-multiplication


【解决方案1】:

【讨论】:

  • 那么,这种乘法不能是动态的吗?仅适用于 2x2 对吗?谢谢你的信息:D
  • System.Numerics 中有一个 4x4 矩阵,我认为 msdn.microsoft.com/de-de/library/… 但不知道库中的一般矩阵实现。
【解决方案2】:

如果你想做矩阵运算,我最近开始使用Accord 包(可通过NuGet 获得)。它对我来说很好用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多