本文整理汇总了C#中MatrixD.Invert方法的典型用法代码示例。如果您正苦于以下问题:C# MatrixD.Invert方法的具体用法?C# MatrixD.Invert怎么用?C# MatrixD.Invert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MatrixD
的用法示例。
在下文中一共展示了MatrixD.Invert方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InvertException3
public void InvertException3()
{
MatrixD m = new MatrixD(new double[,] {{1, 2, 3},
{2, 5, 8},
{7, 6, -1},
{4, 9, 7}}).Transposed;
m.Invert();
}
示例2: InvertException
public void InvertException()
{
MatrixD m = new MatrixD(new double[,] {{1, 2, 3, 4},
{2, 5, 8, 3},
{7, 6, -1, 1},
{3, 7, 11, 7}});
m.Invert();
}
示例3: InvertException2
public void InvertException2()
{
MatrixD m = new MatrixD(4, 4);
m.Invert();
}
示例4: Invert
public void Invert()
{
Assert.AreEqual(MatrixD.CreateIdentity(3, 3), MatrixD.CreateIdentity(3, 3).Inverse);
MatrixD m = new MatrixD(new double[,] {{1, 2, 3, 4},
{2, 5, 8, 3},
{7, 6, -1, 1},
{4, 9, 7, 7}});
MatrixD inverse = m.Clone();
m.Invert();
VectorD v = new VectorD(4, 1);
VectorD w = m * v;
Assert.IsTrue(VectorD.AreNumericallyEqual(v, inverse * w));
Assert.IsTrue(MatrixD.AreNumericallyEqual(MatrixD.CreateIdentity(4, 4), m * inverse));
m = new MatrixD(new double[,] {{1, 2, 3},
{2, 5, 8},
{7, 6, -1},
{4, 9, 7}});
// To check the pseudo-inverse we use the definition: A*A.Transposed*A = A
// see http://en.wikipedia.org/wiki/Moore-Penrose_pseudoinverse
inverse = m.Clone();
inverse.Invert();
Assert.IsTrue(MatrixD.AreNumericallyEqual(m, m * inverse * m));
}